Browse Source

* Invalid SQL Types, fixed them

git-svn-id: trunk@5453 -
ivost 18 years ago
parent
commit
10a035eeaf
2 changed files with 26 additions and 24 deletions
  1. 1 1
      packages/base/odbc/Makefile
  2. 25 23
      packages/base/odbc/odbcsql.inc

+ 1 - 1
packages/base/odbc/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/10/13]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/11/20]
 #
 #
 default: all
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince arm-gba powerpc64-linux
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince arm-gba powerpc64-linux

+ 25 - 23
packages/base/odbc/odbcsql.inc

@@ -15,8 +15,9 @@ uses
 {$IFDEF DYNLOADINGODBC}
 {$IFDEF DYNLOADINGODBC}
      Dynlibs,
      Dynlibs,
 {$ENDIF}
 {$ENDIF}
+     ctypes,
      sysutils;
      sysutils;
-     
+
 {$IFDEF Unix}
 {$IFDEF Unix}
   {$DEFINE extdecl:=cdecl}
   {$DEFINE extdecl:=cdecl}
   const
   const
@@ -44,20 +45,21 @@ uses
 *)
 *)
 
 
 type
 type
-  SQLCHAR      = Char;
-  SQLSMALLINT  = smallint;
-  SQLUSMALLINT = Word;
+  SQLCHAR      = char;
+  SQLSMALLINT  = csshort;
+  SQLUSMALLINT = cushort;
   SQLRETURN    = SQLSMALLINT;
   SQLRETURN    = SQLSMALLINT;
-  SQLHANDLE    = LongInt;
+  SQLHANDLE    = pointer;
   SQLHENV      = SQLHANDLE;
   SQLHENV      = SQLHANDLE;
   SQLHDBC      = SQLHANDLE;
   SQLHDBC      = SQLHANDLE;
   SQLHSTMT     = SQLHANDLE;
   SQLHSTMT     = SQLHANDLE;
-  SQLINTEGER   = LongInt;
-  SQLUINTEGER  = Cardinal;
-  SQLPOINTER   = Pointer;
-  SQLREAL      = real;
-  SQLDOUBLE    = Double;
-  SQLFLOAT     = Double;
+  SQLHDESC     = SQLHANDLE;
+  SQLINTEGER   = cint;
+  SQLUINTEGER  = cuint;
+  SQLPOINTER   = pointer;
+  SQLREAL      = cfloat;
+  SQLDOUBLE    = cdouble;
+  SQLFLOAT     = cdouble;
   SQLHWND      = pointer;
   SQLHWND      = pointer;
   PSQLCHAR      = PChar;
   PSQLCHAR      = PChar;
   PSQLINTEGER   = ^SQLINTEGER;
   PSQLINTEGER   = ^SQLINTEGER;
@@ -67,7 +69,7 @@ type
   PSQLREAL      = ^SQLREAL;
   PSQLREAL      = ^SQLREAL;
   PSQLDOUBLE    = ^SQLDOUBLE;
   PSQLDOUBLE    = ^SQLDOUBLE;
   PSQLFLOAT     = ^SQLFLOAT;
   PSQLFLOAT     = ^SQLFLOAT;
-  PSQLHandle    = ^SQLHANDLE;
+  PSQLHANDLE    = ^SQLHANDLE;
 
 
 const
 const
   { SQL data type codes }
   { SQL data type codes }
@@ -441,7 +443,7 @@ const
 
 
   SQL_NO_DATA = 100;
   SQL_NO_DATA = 100;
   SQL_ERROR   = (-1);
   SQL_ERROR   = (-1);
-  SQL_INVALID_HANDLE =(-2);
+  SQL_INVALID_HANDLE = (-2);
 
 
   SQL_STILL_EXECUTING =  2;
   SQL_STILL_EXECUTING =  2;
   SQL_NEED_DATA       = 99;
   SQL_NEED_DATA       = 99;
@@ -710,18 +712,18 @@ const
 {
 {
 /* SQLEndTran() options */
 /* SQLEndTran() options */
 #define SQL_COMMIT          0
 #define SQL_COMMIT          0
-#define SQL_ROLLBACK        1
+#define SQL_ROLLBACK        1}
+
+//* null handles returned by SQLAllocHandle() */
+  SQL_NULL_HENV       = SQLHENV(0);
+  SQL_NULL_HDBC       = SQLHDBC(0);
+  SQL_NULL_HSTMT      = SQLHSTMT(0);
+{$ifdef odbcver3}
+  SQL_NULL_HDESC      = SQLHDESC(0);
+{$endif}
 
 
-/* null handles returned by SQLAllocHandle() */
-#define SQL_NULL_HENV       0
-#define SQL_NULL_HDBC       0
-#define SQL_NULL_HSTMT      0
-#if (ODBCVER >= 0x0300)
-#define SQL_NULL_HDESC      0
-#endif
-}
 //* null handle used in place of parent handle when allocating HENV */
 //* null handle used in place of parent handle when allocating HENV */
-  SQL_NULL_HANDLE = 0;
+  SQL_NULL_HANDLE = SQLHANDLE(0);
 
 
 //* Values that may appear in the result set of SQLSpecialColumns() */
 //* Values that may appear in the result set of SQLSpecialColumns() */
   SQL_SCOPE_CURROW      = 0;
   SQL_SCOPE_CURROW      = 0;