home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / packages / win32ada / data.z / win32-sql.ads < prev    next >
Encoding:
Text File  |  1996-03-15  |  14.6 KB  |  268 lines

  1. -- $Source: /home/harp/1/proto/monoBANK/winnt/win32-sql.ads,v $ 
  2. -- $Revision: 1.13 $ $Date: 96/03/15 12:55:55 $ $Author: stm $ 
  3. -- See end of file for Copyright (c) information.
  4.  
  5. with Interfaces.C;
  6.  
  7. package Win32.Sql is
  8.  
  9.     use type Interfaces.C.Char_Array;
  10.  
  11.     ODBCVER                        : constant := 16#201#;   -- sql.h:24
  12.     SQL_SPEC_MAJOR                 : constant := 2;         -- sql.h:33
  13.     SQL_SPEC_MINOR                 : constant := 1;         -- sql.h:34
  14.     SQL_SPEC_STRING                : constant CHAR_Array := "02.01" & Nul;
  15.                                                             -- sql.h:35
  16.     SQL_SQLSTATE_SIZE              : constant := 5;         -- sql.h:37
  17.     SQL_MAX_MESSAGE_LENGTH         : constant := 512;       -- sql.h:38
  18.     SQL_MAX_DSN_LENGTH             : constant := 32;        -- sql.h:39
  19.     SQL_INVALID_HANDLE             : constant := -2;        -- sql.h:42
  20.     SQL_ERROR                      : constant := -1;        -- sql.h:43
  21.     SQL_SUCCESS                    : constant := 0;         -- sql.h:44
  22.     SQL_SUCCESS_WITH_INFO          : constant := 1;         -- sql.h:45
  23.     SQL_NO_DATA_FOUND              : constant := 100;       -- sql.h:46
  24.     SQL_CHAR                       : constant := 1;         -- sql.h:49
  25.     SQL_NUMERIC                    : constant := 2;         -- sql.h:50
  26.     SQL_DECIMAL                    : constant := 3;         -- sql.h:51
  27.     SQL_INTEGER                    : constant := 4;         -- sql.h:52
  28.     SQL_SMALLINT                   : constant := 5;         -- sql.h:53
  29.     SQL_FLOAT                      : constant := 6;         -- sql.h:54
  30.     SQL_REAL                       : constant := 7;         -- sql.h:55
  31.     SQL_DOUBLE                     : constant := 8;         -- sql.h:56
  32.     SQL_VARCHAR                    : constant := 12;        -- sql.h:57
  33.     SQL_TYPE_MIN                   : constant := 1;         -- sql.h:59
  34.     SQL_TYPE_NULL                  : constant := 0;         -- sql.h:60
  35.     SQL_TYPE_MAX                   : constant := 12;        -- sql.h:61
  36.     SQL_C_CHAR                     : constant := 1;         -- sql.h:65
  37.     SQL_C_LONG                     : constant := 4;         -- sql.h:66
  38.     SQL_C_SHORT                    : constant := 5;         -- sql.h:67
  39.     SQL_C_FLOAT                    : constant := 7;         -- sql.h:68
  40.     SQL_C_DOUBLE                   : constant := 8;         -- sql.h:69
  41.     SQL_C_DEFAULT                  : constant := 99;        -- sql.h:70
  42.     SQL_NO_NULLS                   : constant := 0;         -- sql.h:75
  43.     SQL_NULLABLE                   : constant := 1;         -- sql.h:76
  44.     SQL_NULLABLE_UNKNOWN           : constant := 2;         -- sql.h:77
  45.     SQL_NULL_DATA                  : constant := -1;        -- sql.h:80
  46.     SQL_DATA_AT_EXEC               : constant := -2;        -- sql.h:81
  47.     SQL_NTS                        : constant := -3;        -- sql.h:82
  48.     SQL_CLOSE                      : constant := 0;         -- sql.h:85
  49.     SQL_DROP                       : constant := 1;         -- sql.h:86
  50.     SQL_UNBIND                     : constant := 2;         -- sql.h:87
  51.     SQL_RESET_PARAMS               : constant := 3;         -- sql.h:88
  52.     SQL_COMMIT                     : constant := 0;         -- sql.h:91
  53.     SQL_ROLLBACK                   : constant := 1;         -- sql.h:92
  54.     SQL_COLUMN_COUNT               : constant := 0;         -- sql.h:95
  55.     SQL_COLUMN_NAME                : constant := 1;         -- sql.h:96
  56.     SQL_COLUMN_TYPE                : constant := 2;         -- sql.h:97
  57.     SQL_COLUMN_LENGTH              : constant := 3;         -- sql.h:98
  58.     SQL_COLUMN_PRECISION           : constant := 4;         -- sql.h:99
  59.     SQL_COLUMN_SCALE               : constant := 5;         -- sql.h:100
  60.     SQL_COLUMN_DISPLAY_SIZE        : constant := 6;         -- sql.h:101
  61.     SQL_COLUMN_NULLABLE            : constant := 7;         -- sql.h:102
  62.     SQL_COLUMN_UNSIGNED            : constant := 8;         -- sql.h:103
  63.     SQL_COLUMN_MONEY               : constant := 9;         -- sql.h:104
  64.     SQL_COLUMN_UPDATABLE           : constant := 10;        -- sql.h:105
  65.     SQL_COLUMN_AUTO_INCREMENT      : constant := 11;        -- sql.h:106
  66.     SQL_COLUMN_CASE_SENSITIVE      : constant := 12;        -- sql.h:107
  67.     SQL_COLUMN_SEARCHABLE          : constant := 13;        -- sql.h:108
  68.     SQL_COLUMN_TYPE_NAME           : constant := 14;        -- sql.h:109
  69.     SQL_COLUMN_TABLE_NAME          : constant := 15;        -- sql.h:111
  70.     SQL_COLUMN_OWNER_NAME          : constant := 16;        -- sql.h:112
  71.     SQL_COLUMN_QUALIFIER_NAME      : constant := 17;        -- sql.h:113
  72.     SQL_COLUMN_LABEL               : constant := 18;        -- sql.h:114
  73.     SQL_COLATT_OPT_MAX             : constant := 18;        -- sql.h:115
  74.     SQL_COLUMN_DRIVER_START        : constant := 1000;      -- sql.h:119
  75.     SQL_COLATT_OPT_MIN             : constant := 0;         -- sql.h:121
  76.     SQL_ATTR_READONLY              : constant := 0;         -- sql.h:124
  77.     SQL_ATTR_WRITE                 : constant := 1;         -- sql.h:125
  78.     SQL_ATTR_READWRITE_UNKNOWN     : constant := 2;         -- sql.h:126
  79.     SQL_UNSEARCHABLE               : constant := 0;         -- sql.h:130
  80.     SQL_LIKE_ONLY                  : constant := 1;         -- sql.h:131
  81.     SQL_ALL_EXCEPT_LIKE            : constant := 2;         -- sql.h:132
  82.     SQL_SEARCHABLE                 : constant := 3;         -- sql.h:133
  83.     SQL_NULL_HENV                  : constant := 0;         -- sql.h:136
  84.     SQL_NULL_HDBC                  : constant := 0;         -- sql.h:137
  85.     SQL_NULL_HSTMT                 : constant := 0;         -- sql.h:138
  86.  
  87.     type SCHAR is new Win32.CHAR;                           -- sql.h:154
  88.     type SDWORD is new Win32.LONG;                          -- sql.h:155
  89.     type SWORD is new Win32.SHORT;                          -- sql.h:156
  90.     type UDWORD is new Win32.DWORD;                         -- sql.h:157
  91.     type UWORD is new Win32.WORD;                           -- sql.h:158
  92.     type SLONG is new Win32.LONG;                           -- sql.h:160
  93.     type SSHORT is new Win32.SHORT;                         -- sql.h:161
  94.     type SDOUBLE is new Interfaces.C.Double;                -- sql.h:166
  95.     type LDOUBLE is new Interfaces.C.Double;                -- sql.h:168
  96.     type SFLOAT is new Win32.Float;                         -- sql.h:172
  97.     type RETCODE is new Win32.SHORT;                        -- sql.h:180
  98.  
  99.     subtype PTR is Win32.PVOID;                            -- sql.h:174
  100.     subtype HENV is Win32.PVOID;                           -- sql.h:176
  101.     subtype HDBC is Win32.PVOID;                           -- sql.h:177
  102.     subtype HSTMT is Win32.PVOID;                          -- sql.h:178
  103.  
  104.     function SQLAllocConnect(henv : HENV;
  105.                              phdbc: access HDBC)
  106.                                     return RETCODE;         -- sql.h:185
  107.  
  108.     function SQLAllocEnv(phenv: access HENV) return RETCODE;
  109.                                                             -- sql.h:189
  110.  
  111.     function SQLAllocStmt(hdbc  : HDBC;
  112.                           phstmt: access HSTMT)
  113.                                   return RETCODE;           -- sql.h:192
  114.  
  115.     function SQLBindCol(hstmt     : HSTMT;
  116.                         icol      : UWORD;
  117.                         fCType    : SWORD;
  118.                         rgbValue  : PTR;
  119.                         cbValueMax: SDWORD;
  120.                         pcbValue  : access SDWORD)
  121.                                     return RETCODE;         -- sql.h:196
  122.  
  123.     function SQLCancel(hstmt: HSTMT) return RETCODE;        -- sql.h:204
  124.  
  125.     function SQLColAttributes(hstmt    : HSTMT;
  126.                               icol     : UWORD;
  127.                               fDescType: UWORD;
  128.                               rgbDesc  : PTR;
  129.                               cbDescMax: SWORD;
  130.                               pcbDesc  : access SWORD;
  131.                               pfDesc   : access SDWORD)
  132.                                          return RETCODE;    -- sql.h:207
  133.  
  134.     function SQLConnect(hdbc     : HDBC;
  135.                         szDSN    : Win32.PUCHAR;
  136.                         cbDSN    : SWORD;
  137.                         szUID    : Win32.PUCHAR;
  138.                         cbUID    : SWORD;
  139.                         szAuthStr: Win32.PUCHAR;
  140.                         cbAuthStr: SWORD)
  141.                                    return RETCODE;          -- sql.h:216
  142.  
  143.     function SQLDescribeCol(hstmt       : HSTMT;
  144.                             icol        : UWORD;
  145.                             szColName   : Win32.PUCHAR;
  146.                             cbColNameMax: SWORD;
  147.                             pcbColName  : access SWORD;
  148.                             pfSqlType   : access SWORD;
  149.                             pcbColDef   : access SDWORD;
  150.                             pibScale    : access SWORD;
  151.                             pfNullable  : access SWORD)
  152.                                           return RETCODE;   -- sql.h:225
  153.  
  154.     function SQLDisconnect(hdbc: HDBC) return RETCODE;      -- sql.h:236
  155.  
  156.     function SQLError(henv         : HENV;
  157.                       hdbc         : HDBC;
  158.                       hstmt        : HSTMT;
  159.                       szSqlState   : Win32.PUCHAR;
  160.                       pfNativeError: access SDWORD;
  161.                       szErrorMsg   : Win32.PUCHAR;
  162.                       cbErrorMsgMax: SWORD;
  163.                       pcbErrorMsg  : access SWORD)
  164.                                      return RETCODE;        -- sql.h:239
  165.  
  166.     function SQLExecDirect(hstmt   : HSTMT;
  167.                            szSqlStr: Win32.PUCHAR;
  168.                            cbSqlStr: SDWORD)
  169.                                      return RETCODE;        -- sql.h:249
  170.  
  171.     function SQLExecute(hstmt: HSTMT) return RETCODE;       -- sql.h:254
  172.  
  173.     function SQLFetch(hstmt: HSTMT) return RETCODE;         -- sql.h:257
  174.  
  175.     function SQLFreeConnect(hdbc: HDBC) return RETCODE;     -- sql.h:260
  176.  
  177.     function SQLFreeEnv(henv: HENV) return RETCODE;         -- sql.h:263
  178.  
  179.     function SQLFreeStmt(hstmt  : HSTMT;
  180.                          fOption: UWORD)
  181.                                   return RETCODE;           -- sql.h:266
  182.  
  183.     function SQLGetCursorName(hstmt      : HSTMT;
  184.                               szCursor   : Win32.PUCHAR;
  185.                               cbCursorMax: SWORD;
  186.                               pcbCursor  : access SWORD)
  187.                                            return RETCODE;  -- sql.h:270
  188.  
  189.     function SQLNumResultCols(hstmt: HSTMT;
  190.                               pccol: access SWORD)
  191.                                      return RETCODE;        -- sql.h:276
  192.  
  193.     function SQLPrepare(hstmt   : HSTMT;
  194.                         szSqlStr: Win32.PUCHAR;
  195.                         cbSqlStr: SDWORD)
  196.                                   return RETCODE;           -- sql.h:280
  197.  
  198.     function SQLRowCount(hstmt: HSTMT;
  199.                          pcrow: access SDWORD)
  200.                                 return RETCODE;             -- sql.h:285
  201.  
  202.     function SQLSetCursorName(hstmt   : HSTMT;
  203.                               szCursor: Win32.PUCHAR;
  204.                               cbCursor: SWORD)
  205.                                         return RETCODE;     -- sql.h:289
  206.  
  207.     function SQLTransact(henv : HENV;
  208.                          hdbc : HDBC;
  209.                          fType: UWORD)
  210.                                 return RETCODE;             -- sql.h:294
  211.  
  212.     function SQLSetParam(hstmt   : HSTMT;
  213.                          ipar    : UWORD;
  214.                          fCType  : SWORD;
  215.                          fSqlType: SWORD;
  216.                          cbColDef: UDWORD;
  217.                          ibScale : SWORD;
  218.                          rgbValue: PTR;
  219.                          pcbValue: access SDWORD)
  220.                                    return RETCODE;          -- sql.h:304
  221.  
  222. private
  223.  
  224.     pragma Import(Stdcall, SQLAllocConnect, "SQLAllocConnect");   -- sql.h:185
  225.     pragma Import(Stdcall, SQLAllocEnv, "SQLAllocEnv");           -- sql.h:189
  226.     pragma Import(Stdcall, SQLAllocStmt, "SQLAllocStmt");         -- sql.h:192
  227.     pragma Import(Stdcall, SQLBindCol, "SQLBindCol");             -- sql.h:196
  228.     pragma Import(Stdcall, SQLCancel, "SQLCancel");               -- sql.h:204
  229.     pragma Import(Stdcall, SQLColAttributes, "SQLColAttributes"); -- sql.h:207
  230.     pragma Import(Stdcall, SQLConnect, "SQLConnect");             -- sql.h:216
  231.     pragma Import(Stdcall, SQLDescribeCol, "SQLDescribeCol");     -- sql.h:225
  232.     pragma Import(Stdcall, SQLDisconnect, "SQLDisconnect");       -- sql.h:236
  233.     pragma Import(Stdcall, SQLError, "SQLError");                 -- sql.h:239
  234.     pragma Import(Stdcall, SQLExecDirect, "SQLExecDirect");       -- sql.h:249
  235.     pragma Import(Stdcall, SQLExecute, "SQLExecute");             -- sql.h:254
  236.     pragma Import(Stdcall, SQLFetch, "SQLFetch");                 -- sql.h:257
  237.     pragma Import(Stdcall, SQLFreeConnect, "SQLFreeConnect");     -- sql.h:260
  238.     pragma Import(Stdcall, SQLFreeEnv, "SQLFreeEnv");             -- sql.h:263
  239.     pragma Import(Stdcall, SQLFreeStmt, "SQLFreeStmt");           -- sql.h:266
  240.     pragma Import(Stdcall, SQLGetCursorName, "SQLGetCursorName"); -- sql.h:270
  241.     pragma Import(Stdcall, SQLNumResultCols, "SQLNumResultCols"); -- sql.h:276
  242.     pragma Import(Stdcall, SQLPrepare, "SQLPrepare");             -- sql.h:280
  243.     pragma Import(Stdcall, SQLRowCount, "SQLRowCount");           -- sql.h:285
  244.     pragma Import(Stdcall, SQLSetCursorName, "SQLSetCursorName"); -- sql.h:289
  245.     pragma Import(Stdcall, SQLTransact, "SQLTransact");           -- sql.h:294
  246.     pragma Import(Stdcall, SQLSetParam, "SQLSetParam");           -- sql.h:304
  247.  
  248. -------------------------------------------------------------------------------
  249. --
  250. -- THIS FILE AND ANY ASSOCIATED DOCUMENTATION IS PROVIDED WITHOUT CHARGE
  251. -- "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
  252. -- BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
  253. -- FITNESS FOR A PARTICULAR PURPOSE.  The user assumes the entire risk as to
  254. -- the accuracy and the use of this file.  This file may be used, copied,
  255. -- modified and distributed only by licensees of Microsoft Corporation's
  256. -- WIN32 Software Development Kit in accordance with the terms of the 
  257. -- licensee's End-User License Agreement for Microsoft Software for the
  258. -- WIN32 Development Kit.
  259. --
  260. -- Copyright (c) Intermetrics, Inc. 1995
  261. -- Portions (c) 1985-1994 Microsoft Corporation with permission.
  262. -- Microsoft is a registered trademark and Windows and Windows NT are
  263. -- trademarks of Microsoft Corporation.
  264. --
  265. -------------------------------------------------------------------------------
  266.  
  267. end Win32.Sql;
  268.