소스 검색

* fcl-db: oracle: roll back some overzealous changes. Comment fixes.

git-svn-id: trunk@28001 -
reiniero 11 년 전
부모
커밋
2557f1bfa3
1개의 변경된 파일15개의 추가작업 그리고 15개의 파일을 삭제
  1. 15 15
      packages/fcl-db/src/sqldb/oracle/oracleconnection.pp

+ 15 - 15
packages/fcl-db/src/sqldb/oracle/oracleconnection.pp

@@ -116,7 +116,7 @@ ResourceString
   SErrHandleAllocFailed = 'The allocation of the error handle failed.';
   SErrHandleAllocFailed = 'The allocation of the error handle failed.';
   SErrOracle = 'Oracle returned error %s:';
   SErrOracle = 'Oracle returned error %s:';
 
 
-//callback functions
+// Callback functions
 
 
 function cbf_no_data(ictxp:Pdvoid; bindp:POCIBind; iter:ub4; index:ub4; bufpp:PPdvoid;
 function cbf_no_data(ictxp:Pdvoid; bindp:POCIBind; iter:ub4; index:ub4; bufpp:PPdvoid;
              alenp:Pub4; piecep:Pub1; indp:PPdvoid):sb4;cdecl;
              alenp:Pub4; piecep:Pub1; indp:PPdvoid):sb4;cdecl;
@@ -134,7 +134,7 @@ function cbf_get_data(octxp:Pdvoid; bindp:POCIBind; iter:ub4; index:ub4; bufpp:P
              alenp:PPub4; piecep:Pub1; indp:PPdvoid; rcodep:PPub2):sb4;cdecl;
              alenp:PPub4; piecep:Pub1; indp:PPdvoid; rcodep:PPub2):sb4;cdecl;
 
 
 begin
 begin
-//only 1 row can be stored. No support for multiple rows. When multiple rows, only last is kept.
+// Only 1 row can be stored. No support for multiple rows: only the last row is kept.
   bufpp^:=TOraFieldBuf(octxp^).Buffer;
   bufpp^:=TOraFieldBuf(octxp^).Buffer;
   indp^ := @TOraFieldBuf(octxp^).Ind;
   indp^ := @TOraFieldBuf(octxp^).Ind;
   TOraFieldBuf(octxp^).Len:=TOraFieldBuf(octxp^).Size;   //reset size to full buffer
   TOraFieldBuf(octxp^).Len:=TOraFieldBuf(octxp^).Size;   //reset size to full buffer
@@ -144,7 +144,7 @@ begin
   result:=OCI_CONTINUE;
   result:=OCI_CONTINUE;
 end;
 end;
 
 
-//conversions
+// Conversions
 
 
 Procedure FmtBCD2Nvu(bcd:tBCD;b:pByte);
 Procedure FmtBCD2Nvu(bcd:tBCD;b:pByte);
 var
 var
@@ -177,10 +177,10 @@ begin
     exp:=(BCDPrecision(bcd)-BCDScale(bcd)+1) div 2;
     exp:=(BCDPrecision(bcd)-BCDScale(bcd)+1) div 2;
     cnt:=exp+(BCDScale(bcd)+1) div 2;
     cnt:=exp+(BCDScale(bcd)+1) div 2;
     // to avoid "ora 01438: value larger than specified precision allowed for this column"
     // to avoid "ora 01438: value larger than specified precision allowed for this column"
-    // remove trailing zeros (scale < 0)
+    // remove trailing zeros (scale < 0)...
     while (nibbles[cnt*2-2]*10+nibbles[cnt*2-1])=0 do
     while (nibbles[cnt*2-2]*10+nibbles[cnt*2-1])=0 do
       cnt:=cnt-1;
       cnt:=cnt-1;
-    // and remove leading zeros (scale > precision)
+    // ... and remove leading zeros (scale > precision)
     j:=0;
     j:=0;
     while (nibbles[j*2]*10+nibbles[j*2+1])=0 do
     while (nibbles[j*2]*10+nibbles[j*2+1])=0 do
       begin
       begin
@@ -530,7 +530,7 @@ begin
     begin
     begin
     if OCIStmtPrepare2(TOracleTrans(ATransaction.Handle).FOciSvcCtx,FOciStmt,FOciError,@buf[1],length(buf),nil,0,OCI_NTV_SYNTAX,OCI_DEFAULT) = OCI_ERROR then
     if OCIStmtPrepare2(TOracleTrans(ATransaction.Handle).FOciSvcCtx,FOciStmt,FOciError,@buf[1],length(buf),nil,0,OCI_NTV_SYNTAX,OCI_DEFAULT) = OCI_ERROR then
       HandleError;
       HandleError;
-    // get statement type
+    // Get statement type
     if OCIAttrGet(FOciStmt,OCI_HTYPE_STMT,@stmttype,nil,OCI_ATTR_STMT_TYPE,FOciError) = OCI_ERROR then
     if OCIAttrGet(FOciStmt,OCI_HTYPE_STMT,@stmttype,nil,OCI_ATTR_STMT_TYPE,FOciError) = OCI_ERROR then
       HandleError;
       HandleError;
     case stmttype of
     case stmttype of
@@ -781,7 +781,7 @@ begin
       begin
       begin
       // Clear OFieldSize. Oracle 9i, 10g doc says *ub4 but some clients use *ub2 leaving
       // Clear OFieldSize. Oracle 9i, 10g doc says *ub4 but some clients use *ub2 leaving
       // high 16 bit untouched resulting in huge values and ORA-01062
       // high 16 bit untouched resulting in huge values and ORA-01062
-      // WARNING: this is not working in big endian systems !!!!
+      // WARNING: this does not work on big endian systems !!!!
       // To be tested if BE systems have this *ub2<->*ub4 problem
       // To be tested if BE systems have this *ub2<->*ub4 problem
       OFieldSize:=0;
       OFieldSize:=0;
 
 
@@ -810,40 +810,40 @@ begin
                                     FieldSize := 4;
                                     FieldSize := 4;
                                     OFieldType := SQLT_VNU;
                                     OFieldType := SQLT_VNU;
                                     OFieldSize:= 22;
                                     OFieldSize:= 22;
-                                    end;
+                                    end
                                   else if Oprecision < 5 then
                                   else if Oprecision < 5 then
                                     begin
                                     begin
                                     FieldType := ftSmallint;
                                     FieldType := ftSmallint;
                                     OFieldType := SQLT_INT;
                                     OFieldType := SQLT_INT;
                                     OFieldSize := sizeof(smallint);
                                     OFieldSize := sizeof(smallint);
-                                    end;
-                                  else //OPrecision=5..9, OScale=0
+                                    end
+                                  else // OPrecision=5..9, OScale=0
                                     begin
                                     begin
                                     FieldType := ftInteger;
                                     FieldType := ftInteger;
                                     OFieldType := SQLT_INT;
                                     OFieldType := SQLT_INT;
                                     OFieldSize:= sizeof(integer);
                                     OFieldSize:= sizeof(integer);
                                     end;
                                     end;
-                                  end;
+                                  end
                                 else if (Oscale = -127) {and (OPrecision=0)} then
                                 else if (Oscale = -127) {and (OPrecision=0)} then
                                   begin
                                   begin
                                   FieldType := ftFloat;
                                   FieldType := ftFloat;
                                   OFieldType := SQLT_FLT;
                                   OFieldType := SQLT_FLT;
                                   OFieldSize:=sizeof(double);
                                   OFieldSize:=sizeof(double);
-                                  end;
+                                  end
                                 else if (Oscale >=0) and (Oscale <=4) and (OPrecision<=12) then
                                 else if (Oscale >=0) and (Oscale <=4) and (OPrecision<=12) then
                                   begin
                                   begin
                                   FieldType := ftBCD;
                                   FieldType := ftBCD;
                                   FieldSize := oscale;
                                   FieldSize := oscale;
                                   OFieldType := SQLT_VNU;
                                   OFieldType := SQLT_VNU;
                                   OFieldSize:= 22;
                                   OFieldSize:= 22;
-                                  end;
+                                  end
                                 else if (OPrecision-Oscale<64) and (Oscale < 64) then // limited to 63 digits before or after decimal point
                                 else if (OPrecision-Oscale<64) and (Oscale < 64) then // limited to 63 digits before or after decimal point
                                   begin
                                   begin
                                   FieldType := ftFMTBCD;
                                   FieldType := ftFMTBCD;
                                   FieldSize := oscale;
                                   FieldSize := oscale;
                                   OFieldType := SQLT_VNU;
                                   OFieldType := SQLT_VNU;
                                   OFieldSize:= 22;
                                   OFieldSize:= 22;
-                                  end;
+                                  end
                                 else // approximation with double, best we can do
                                 else // approximation with double, best we can do
                                   begin
                                   begin
                                   FieldType := ftFloat;
                                   FieldType := ftFloat;
@@ -935,7 +935,7 @@ begin
                            b := fieldbuffers[FieldDef.FieldNo-1].buffer;
                            b := fieldbuffers[FieldDef.FieldNo-1].buffer;
                            size := b[0];
                            size := b[0];
                            cur := 0;
                            cur := 0;
-                           if (b[1] and $80)=$80 then // then the number is positive
+                           if (b[1] and $80)=$80 then // the number is positive
                              begin
                              begin
                              exp := (b[1] and $7f)-65;
                              exp := (b[1] and $7f)-65;
                              for i := 2 to size do
                              for i := 2 to size do