Browse Source

* Patch from Ludo Brands for Mantis #18240. Fixes some float issues which have
scale=0 and precision=0

git-svn-id: trunk@19257 -

marco 14 years ago
parent
commit
962db07cf6
1 changed files with 13 additions and 4 deletions
  1. 13 4
      packages/fcl-db/src/sqldb/oracle/oracleconnection.pp

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

@@ -496,12 +496,21 @@ begin
                                   HandleError;
                                   HandleError;
                                 if OCIAttrGet(Param,OCI_DTYPE_PARAM,@Oscale,nil,OCI_ATTR_SCALE,FOciError) = OCI_ERROR then
                                 if OCIAttrGet(Param,OCI_DTYPE_PARAM,@Oscale,nil,OCI_ATTR_SCALE,FOciError) = OCI_ERROR then
                                   HandleError;
                                   HandleError;
-
                                 if Oscale = 0 then
                                 if Oscale = 0 then
                                   begin
                                   begin
-                                  FieldType := ftInteger;
-                                  OFieldType := SQLT_INT;
-                                  OFieldSize:= sizeof(integer);
+                                  if Oprecision=0 then //Number(0,0) = number(32,4)
+                                    begin              //Warning ftBCD is limited to precision 12
+                                    FieldType := ftBCD;
+                                    FieldSize := 4;
+                                    OFieldType := SQLT_VNU;
+                                    OFieldSize:= 22;
+                                    end
+                                  else
+                                    begin
+                                    FieldType := ftInteger;
+                                    OFieldType := SQLT_INT;
+                                    OFieldSize:= sizeof(integer);
+                                    end;
                                   end
                                   end
                                 else if (oscale = -127) {and (OPrecision=0)} then
                                 else if (oscale = -127) {and (OPrecision=0)} then
                                   begin
                                   begin