00001 {*********************************************************}
00002 { }
00003 { Zeos Database Objects }
00004 { MySQL Database Connectivity Classes }
00005 { }
00006 { Originally written by Sergey Seroukhov }
00007 { }
00008 {*********************************************************}
00009
00010 {@********************************************************}
00011 { Copyright (c) 1999-2006 Zeos Development Group }
00012 { }
00013 { License Agreement: }
00014 { }
00015 { This library is distributed in the hope that it will be }
00016 { useful, but WITHOUT ANY WARRANTY; without even the }
00017 { implied warranty of MERCHANTABILITY or FITNESS FOR }
00018 { A PARTICULAR PURPOSE. See the GNU Lesser General }
00019 { Public License for more details. }
00020 { }
00021 { The source code of the ZEOS Libraries and packages are }
00022 { distributed under the Library GNU General Public }
00023 { License (see the file COPYING / COPYING.ZEOS) }
00024 { with the following modification: }
00025 { As a special exception, the copyright holders of this }
00026 { library give you permission to link this library with }
00027 { independent modules to produce an executable, }
00028 { regardless of the license terms of these independent }
00029 { modules, and to copy and distribute the resulting }
00030 { executable under terms of your choice, provided that }
00031 { you also meet, for each linked independent module, }
00032 { the terms and conditions of the license of that module. }
00033 { An independent module is a module which is not derived }
00034 { from or based on this library. If you modify this }
00035 { library, you may extend this exception to your version }
00036 { of the library, but you are not obligated to do so. }
00037 { If you do not wish to do so, delete this exception }
00038 { statement from your version. }
00039 { }
00040 { }
00041 { The project web site is located on: }
00042 { http:
00043 { http:
00044 { svn:
00045 { }
00046 { http:
00047 { http:
00048 { }
00049 { }
00050 { }
00051 { Zeos Development Group. }
00052 {********************************************************@}
00053
00054 unit ZPlainFirebirdInterbaseConstants;
00055
00056 interface
00057
00058 {$I ZPlain.inc}
00059
00060 uses
00061 ZCompatibility;
00062
00063 const
00064 IBLocalBufferLength = 512;
00065 IBBigLocalBufferLength = IBLocalBufferLength * 2;
00066 IBHugeLocalBufferLength = IBBigLocalBufferLength * 20;
00067
00068 ISC_NULL = -1;
00069 ISC_NOTNULL = 0;
00070
00071 ISC_TRUE = 1;
00072 ISC_FALSE = 0;
00073 DSQL_CLOSE = 1;
00074 DSQL_DROP = 2;
00075
00076 SQLDA_VERSION1 = 1;
00077 SQLDA_VERSION2 = 2;
00078 SQL_DIALECT_V5 = 1;
00079 SQL_DIALECT_V6 = 3;
00080 SQL_DIALECT_CURRENT = SQL_DIALECT_V6; (* latest IB DIALECT *)
00081
00082 { SQL definitions }
00083 SQL_VARYING = 448;
00084 SQL_TEXT = 452;
00085 SQL_DOUBLE = 480;
00086 SQL_FLOAT = 482;
00087 SQL_LONG = 496;
00088 SQL_SHORT = 500;
00089 SQL_TIMESTAMP = 510;
00090 SQL_BLOB = 520;
00091 SQL_D_FLOAT = 530;
00092 SQL_ARRAY = 540;
00093 SQL_QUAD = 550;
00094 SQL_TYPE_TIME = 560;
00095 SQL_TYPE_DATE = 570;
00096 SQL_INT64 = 580;
00097 SQL_BOOLEAN = 590;
00098 SQL_DATE = SQL_TIMESTAMP;
00099
00100 { SQL types definitions from RDB$FIELDS}
00101 RDB_VARCHAR = 37;
00102 RDB_VARCHAR2 = 38;
00103 RDB_CSTRING = 40;
00104 RDB_CSTRING2 = 41;
00105 RDB_CHAR = 14;
00106 RDB_CHAR2 = 15;
00107 RDB_D_FLOAT = 11;
00108 RDB_DOUBLE = 27;
00109 RDB_FLOAT = 10;
00110 RDB_INT64 = 16;
00111 RDB_QUAD = 9;
00112 RDB_BLOB_ID = 45;
00113 RDB_INTEGER = 8;
00114 RDB_SMALLINT = 7;
00115 RDB_DATE = 12;
00116 RDB_TIME = 13;
00117 RDB_TIMESTAMP = 35;
00118 RDB_BOOLEAN = 17;
00119 RDB_BLOB = 261;
00120 { SQL subtypes definitions from RDB$FIELDS}
00121 CS_NONE = 0;
00122 CS_BINARY = 1;
00123 CS_ASCII = 2;
00124 CS_UNICODE_FSS = 3;
00125 CS_METADATA = CS_UNICODE_FSS;
00126
00127 RDB_BLOB_NONE = 0;
00128 RDB_BLOB_TEXT = 1;
00129 RDB_BLOB_BLR = 2;
00130 RDB_BLOB_ACL = 3;
00131 RDB_BLOB_RESERVED = 4;
00132 RDB_BLOB_ENCODED = 5;
00133 RDB_BLOB_DESCRIPTION = 6;
00134 RDB_NUMBERS_NONE = 0;
00135 RDB_NUMBERS_NUMERIC = 1;
00136 RDB_NUMBERS_DECIMAL = 2;
00137
00138 { Blob Subtypes }
00139 { types less than zero are reserved for customer use }
00140 isc_blob_untyped = 0;
00141
00142 { internal subtypes }
00143 isc_blob_text = 1;
00144 isc_blob_blr = 2;
00145 isc_blob_acl = 3;
00146 isc_blob_ranges = 4;
00147 isc_blob_summary = 5;
00148 isc_blob_format = 6;
00149 isc_blob_tra = 7;
00150 isc_blob_extfile = 8;
00151
00152 { the range 20-30 is reserved for dBASE and Paradox types }
00153 isc_blob_formatted_memo = 20;
00154 isc_blob_paradox_ole = 21;
00155 isc_blob_graphic = 22;
00156 isc_blob_dbase_ole = 23;
00157 isc_blob_typed_binary = 24;
00158
00159 {* Blob information items *}
00160 isc_info_blob_num_segments = 4;
00161 isc_info_blob_max_segment = 5;
00162 isc_info_blob_total_length = 6;
00163 isc_info_blob_type = 7;
00164
00165 {* error codes *}
00166 isc_segment = 335544366;
00167 isc_segstr_eof = 335544367;
00168 isc_lock_conflict = 335544345;
00169
00170 { Database parameter block stuff }
00171 isc_dpb_version1 = 1;
00172 isc_dpb_cdd_pathname = 1;
00173 isc_dpb_allocation = 2;
00174 isc_dpb_journal = 3;
00175 isc_dpb_page_size = 4;
00176 isc_dpb_num_buffers = 5;
00177 isc_dpb_buffer_length = 6;
00178 isc_dpb_debug = 7;
00179 isc_dpb_garbage_collect = 8;
00180 isc_dpb_verify = 9;
00181 isc_dpb_sweep = 10;
00182 isc_dpb_enable_journal = 11;
00183 isc_dpb_disable_journal = 12;
00184 isc_dpb_dbkey_scope = 13;
00185 isc_dpb_number_of_users = 14;
00186 isc_dpb_trace = 15;
00187 isc_dpb_no_garbage_collect = 16;
00188 isc_dpb_damaged = 17;
00189 isc_dpb_license = 18;
00190 isc_dpb_sys_user_name = 19;
00191 isc_dpb_encrypt_key = 20;
00192 isc_dpb_activate_shadow = 21;
00193 isc_dpb_sweep_interval = 22;
00194 isc_dpb_delete_shadow = 23;
00195 isc_dpb_force_write = 24;
00196 isc_dpb_begin_log = 25;
00197 isc_dpb_quit_log = 26;
00198 isc_dpb_no_reserve = 27;
00199 isc_dpb_user_name = 28;
00200 isc_dpb_password = 29;
00201 isc_dpb_password_enc = 30;
00202 isc_dpb_sys_user_name_enc = 31;
00203 isc_dpb_interp = 32;
00204 isc_dpb_online_dump = 33;
00205 isc_dpb_old_file_size = 34;
00206 isc_dpb_old_num_files = 35;
00207 isc_dpb_old_file = 36;
00208 isc_dpb_old_start_page = 37;
00209 isc_dpb_old_start_seqno = 38;
00210 isc_dpb_old_start_file = 39;
00211 isc_dpb_drop_walfile = 40;
00212 isc_dpb_old_dump_id = 41;
00213 isc_dpb_wal_backup_dir = 42;
00214 isc_dpb_wal_chkptlen = 43;
00215 isc_dpb_wal_numbufs = 44;
00216 isc_dpb_wal_bufsize = 45;
00217 isc_dpb_wal_grp_cmt_wait = 46;
00218 isc_dpb_lc_messages = 47;
00219 isc_dpb_lc_ctype = 48;
00220 isc_dpb_cache_manager = 49;
00221 isc_dpb_shutdown = 50;
00222 isc_dpb_online = 51;
00223 isc_dpb_shutdown_delay = 52;
00224 isc_dpb_reserved = 53;
00225 isc_dpb_overwrite = 54;
00226 isc_dpb_sec_attach = 55;
00227 isc_dpb_disable_wal = 56;
00228 isc_dpb_connect_timeout = 57;
00229 isc_dpb_dummy_packet_interval = 58;
00230 isc_dpb_gbak_attach = 59;
00231 isc_dpb_sql_role_name = 60;
00232 isc_dpb_set_page_buffers = 61;
00233 isc_dpb_working_directory = 62;
00234 isc_dpb_SQL_dialect = 63;
00235 isc_dpb_set_db_readonly = 64;
00236 isc_dpb_set_db_SQL_dialect = 65;
00237 isc_dpb_gfix_attach = 66;
00238 isc_dpb_gstat_attach = 67;
00239 isc_dpb_last_dpb_constant = isc_dpb_gstat_attach;
00240
00241 { isc_dpb_verify specific flags }
00242 isc_dpb_pages = 1;
00243 isc_dpb_records = 2;
00244 isc_dpb_indices = 4;
00245 isc_dpb_transactions = 8;
00246 isc_dpb_no_update = 16;
00247 isc_dpb_repair = 32;
00248 isc_dpb_ignore = 64;
00249
00250 { isc_dpb_shutdown specific flags }
00251 isc_dpb_shut_cache = 1;
00252 isc_dpb_shut_attachment = 2;
00253 isc_dpb_shut_transaction = 4;
00254 isc_dpb_shut_force = 8;
00255
00256 { Transaction parameter block stuff }
00257 isc_tpb_version1 = 1;
00258 isc_tpb_version3 = 3;
00259 isc_tpb_consistency = 1;
00260 isc_tpb_concurrency = 2;
00261 isc_tpb_shared = 3;
00262 isc_tpb_protected = 4;
00263 isc_tpb_exclusive = 5;
00264 isc_tpb_wait = 6;
00265 isc_tpb_nowait = 7;
00266 isc_tpb_read = 8;
00267 isc_tpb_write = 9;
00268 isc_tpb_lock_read = 10;
00269 isc_tpb_lock_write = 11;
00270 isc_tpb_verb_time = 12;
00271 isc_tpb_commit_time = 13;
00272 isc_tpb_ignore_limbo = 14;
00273 isc_tpb_read_committed = 15;
00274 isc_tpb_autocommit = 16;
00275 isc_tpb_rec_version = 17;
00276 isc_tpb_no_rec_version = 18;
00277 isc_tpb_restart_requests = 19;
00278 isc_tpb_no_auto_undo = 20;
00279 isc_tpb_last_tpb_constant = isc_tpb_no_auto_undo;
00280
00281 { Blob Parameter Block }
00282 isc_bpb_version1 = 1;
00283 isc_bpb_source_type = 1;
00284 isc_bpb_target_type = 2;
00285 isc_bpb_type = 3;
00286 isc_bpb_source_interp = 4;
00287 isc_bpb_target_interp = 5;
00288 isc_bpb_filter_parameter = 6;
00289
00290 { SQL information items }
00291 isc_info_sql_select = 4;
00292 isc_info_sql_bind = 5;
00293 isc_info_sql_num_variables = 6;
00294 isc_info_sql_describe_vars = 7;
00295 isc_info_sql_describe_end = 8;
00296 isc_info_sql_sqlda_seq = 9;
00297 isc_info_sql_message_seq = 10;
00298 isc_info_sql_type = 11;
00299 isc_info_sql_sub_type = 12;
00300 isc_info_sql_scale = 13;
00301 isc_info_sql_length = 14;
00302 isc_info_sql_null_ind = 15;
00303 isc_info_sql_field = 16;
00304 isc_info_sql_relation = 17;
00305 isc_info_sql_owner = 18;
00306 isc_info_sql_alias = 19;
00307 isc_info_sql_sqlda_start = 20;
00308 isc_info_sql_stmt_type = 21;
00309 isc_info_sql_get_plan = 22;
00310 isc_info_sql_records = 23;
00311 isc_info_sql_batch_fetch = 24;
00312
00313 { SQL information return values }
00314 isc_info_sql_stmt_select = 1;
00315 isc_info_sql_stmt_insert = 2;
00316 isc_info_sql_stmt_update = 3;
00317 isc_info_sql_stmt_delete = 4;
00318 isc_info_sql_stmt_ddl = 5;
00319 isc_info_sql_stmt_get_segment = 6;
00320 isc_info_sql_stmt_put_segment = 7;
00321 isc_info_sql_stmt_exec_procedure = 8;
00322 isc_info_sql_stmt_start_trans = 9;
00323 isc_info_sql_stmt_commit = 10;
00324 isc_info_sql_stmt_rollback = 11;
00325 isc_info_sql_stmt_select_for_upd = 12;
00326 isc_info_sql_stmt_set_generator = 13;
00327
00328 isc_bpb_type_segmented = 0;
00329 isc_bpb_type_stream = 1;
00330
00331 {************** Information call declarations **************}
00332
00333 { Common, structural codes }
00334 isc_info_end = 1;
00335 isc_info_truncated = 2;
00336 isc_info_error = 3;
00337 isc_info_data_not_ready = 4;
00338 isc_info_flag_end = 127;
00339
00340 { Request information items }
00341 isc_info_number_messages = 4;
00342 isc_info_max_message = 5;
00343 isc_info_max_send = 6;
00344 isc_info_max_receive = 7;
00345 isc_info_state = 8;
00346 isc_info_message_number = 9;
00347 isc_info_message_size = 10;
00348 isc_info_request_cost = 11;
00349 isc_info_access_path = 12;
00350 isc_info_req_select_count = 13;
00351 isc_info_req_insert_count = 14;
00352 isc_info_req_update_count = 15;
00353 isc_info_req_delete_count = 16;
00354
00355 { Database information items }
00356 isc_info_db_id = 4;
00357 isc_info_reads = 5;
00358 isc_info_writes = 6;
00359 isc_info_fetches = 7;
00360 isc_info_marks = 8;
00361 isc_info_implementation = 11;
00362 isc_info_version = 12;
00363 isc_info_base_level = 13;
00364 isc_info_page_size = 14;
00365 isc_info_num_buffers = 15;
00366 isc_info_limbo = 16;
00367 isc_info_current_memory = 17;
00368 isc_info_max_memory = 18;
00369 isc_info_window_turns = 19;
00370 isc_info_license = 20;
00371 isc_info_allocation = 21;
00372 isc_info_attachment_id = 22;
00373 isc_info_read_seq_count = 23;
00374 isc_info_read_idx_count = 24;
00375 isc_info_insert_count = 25;
00376 isc_info_update_count = 26;
00377 isc_info_delete_count = 27;
00378 isc_info_backout_count = 28;
00379 isc_info_purge_count = 29;
00380 isc_info_expunge_count = 30;
00381 isc_info_sweep_interval = 31;
00382 isc_info_ods_version = 32;
00383 isc_info_ods_minor_version = 33;
00384 isc_info_no_reserve = 34;
00385 isc_info_logfile = 35;
00386 isc_info_cur_logfile_name = 36;
00387 isc_info_cur_log_part_offset = 37;
00388 isc_info_num_wal_buffers = 38;
00389 isc_info_wal_buffer_size = 39;
00390 isc_info_wal_ckpt_length = 40;
00391 isc_info_wal_cur_ckpt_interval = 41;
00392 isc_info_wal_prv_ckpt_fname = 42;
00393 isc_info_wal_prv_ckpt_poffset = 43;
00394 isc_info_wal_recv_ckpt_fname = 44;
00395 isc_info_wal_recv_ckpt_poffset = 45;
00396 isc_info_wal_grpc_wait_usecs = 47;
00397 isc_info_wal_num_io = 48;
00398 isc_info_wal_avg_io_size = 49;
00399 isc_info_wal_num_commits = 50;
00400 isc_info_wal_avg_grpc_size = 51;
00401 isc_info_forced_writes = 52;
00402 isc_info_user_names = 53;
00403 isc_info_page_errors = 54;
00404 isc_info_record_errors = 55;
00405 isc_info_bpage_errors = 56;
00406 isc_info_dpage_errors = 57;
00407 isc_info_ipage_errors = 58;
00408 isc_info_ppage_errors = 59;
00409 isc_info_tpage_errors = 60;
00410 isc_info_set_page_buffers = 61;
00411 isc_info_db_SQL_dialect = 62;
00412 isc_info_db_read_only = 63;
00413 isc_info_db_size_in_pages = 64;
00414
00415 type
00416 ULong = Cardinal;
00417 UChar = Char;
00418 Short = SmallInt;
00419
00420 ISC_LONG = LongInt;
00421 UISC_LONG = ULong;
00422 ISC_INT64 = Int64;
00423 ISC_STATUS = LongInt;
00424 UISC_STATUS = ULong;
00425 PISC_LONG = ^ISC_LONG;
00426 PUISC_LONG = ^UISC_LONG;
00427 PISC_STATUS = ^ISC_STATUS;
00428 PPISC_STATUS = ^PISC_STATUS;
00429 PUISC_STATUS = ^UISC_STATUS;
00430 PShort = ^Short;
00431 PPChar = ^PChar;
00432 UShort = Word;
00433 PVoid = Pointer;
00434
00435 { C Date/Time Structure }
00436 TCTimeStructure = record
00437 tm_sec: Integer; { Seconds }
00438 tm_min: Integer; { Minutes }
00439 tm_hour: Integer; { Hour (0--23) }
00440 tm_mday: Integer; { Day of month (1--31) }
00441 tm_mon: Integer; { Month (0--11) }
00442 tm_year: Integer; { Year (calendar year minus 1900) }
00443 tm_wday: Integer; { Weekday (0--6) Sunday = 0) }
00444 tm_yday: Integer; { Day of year (0--365) }
00445 tm_isdst: Integer; { 0 if daylight savings time is not in effect) }
00446 end;
00447 PCTimeStructure = ^TCTimeStructure;
00448 TM = TCTimeStructure;
00449 PTM = ^TM;
00450
00451 TISC_VARYING = record
00452 strlen: Short;
00453 str: array[0..0] of Char;
00454 end;
00455 PISC_VARYING = ^TISC_VARYING;
00456
00457 { InterBase Handle Definitions }
00458 TISC_BLOB_HANDLE = PVoid;
00459 PISC_BLOB_HANDLE = ^TISC_BLOB_HANDLE;
00460 TISC_DB_HANDLE = PVoid;
00461 PISC_DB_HANDLE = ^TISC_DB_HANDLE;
00462 TISC_STMT_HANDLE = PVoid;
00463 PISC_STMT_HANDLE = ^TISC_STMT_HANDLE;
00464 TISC_TR_HANDLE = PVoid;
00465 PISC_TR_HANDLE = ^TISC_TR_HANDLE;
00466 TISC_CALLBACK = procedure;
00467
00468 { Time & Date Support }
00469 ISC_DATE = LongInt;
00470 PISC_DATE = ^ISC_DATE;
00471 ISC_TIME = ULong;
00472 PISC_TIME = ^ISC_TIME;
00473
00474 TISC_TIMESTAMP = record
00475 timestamp_time: ISC_TIME;
00476 timestamp_date: ISC_DATE;
00477 end;
00478 PISC_TIMESTAMP = ^TISC_TIMESTAMP;
00479
00480 { Blob id structure }
00481 TGDS_QUAD = record
00482 gds_quad_high: ISC_LONG;
00483 gds_quad_low: UISC_LONG;
00484 end;
00485 PGDS_QUAD = ^TGDS_QUAD;
00486
00487 TISC_QUAD = TGDS_QUAD;
00488 PISC_QUAD = ^TISC_QUAD;
00489
00490 TISC_ARRAY_BOUND = record
00491 array_bound_lower: Short;
00492 array_bound_upper: Short;
00493 end;
00494 PISC_ARRAY_BOUND = ^TISC_ARRAY_BOUND;
00495
00496 TISC_ARRAY_DESC = record
00497 array_desc_dtype: UChar;
00498 array_desc_scale: Char;
00499 array_desc_length: Short;
00500 array_desc_field_name: array[0..31] of Char;
00501 array_desc_relation_name: array[0..31] of Char;
00502 array_desc_dimensions: Short;
00503 array_desc_flags: Short;
00504 array_desc_bounds: array[0..15] of TISC_ARRAY_BOUND;
00505 end;
00506 PISC_ARRAY_DESC = ^TISC_ARRAY_DESC;
00507
00508 TISC_BLOB_DESC = record
00509 blob_desc_subtype: Short;
00510 blob_desc_charset: Short;
00511 blob_desc_segment_size: Short;
00512 blob_desc_field_name: array[0..31] of UChar;
00513 blob_desc_relation_name: array[0..31] of UChar;
00514 end;
00515 PISC_BLOB_DESC = ^TISC_BLOB_DESC;
00516
00517 { Declare the extended SQLDA }
00518 TXSQLVAR = record
00519 sqltype: Short; { datatype of field }
00520 sqlscale: Short; { scale factor }
00521 sqlsubtype: Short; { datatype subtype - BLOBs }
00522 { & text types only }
00523 sqllen: Short; { length of data area }
00524 sqldata: PChar; { address of data }
00525 sqlind: PSmallInt; { address of indicator }
00526 { variable }
00527 sqlname_length: Short; { length of sqlname field }
00528 { name of field, name length + space for NULL }
00529 sqlname: array[0..31] of Char;
00530 relname_length: Short; { length of relation name }
00531 { field's relation name + space for NULL }
00532 relname: array[0..31] of Char;
00533 ownname_length: Short; { length of owner name }
00534 { relation's owner name + space for NULL }
00535 ownname: array[0..31] of Char;
00536 aliasname_length: Short; { length of alias name }
00537 { relation's alias name + space for NULL }
00538 aliasname: array[0..31] of Char;
00539 end;
00540 PXSQLVAR = ^TXSQLVAR;
00541
00542 TXSQLDA = record
00543 version: Short; { version of this XSQLDA }
00544 { XSQLDA name field }
00545 sqldaid: array[0..7] of Char;
00546 sqldabc: ISC_LONG; { length in bytes of SQLDA }
00547 sqln: Short; { number of fields allocated }
00548 sqld: Short; { actual number of fields }
00549 { first field address }
00550 sqlvar: array[0..0] of TXSQLVAR;
00551 end;
00552 PXSQLDA = ^TXSQLDA;
00553
00554 {****************************************************}
00555 { This record type is for passing arguments to }
00556 { isc_start_transaction (See docs) }
00557 {****************************************************}
00558 TISC_START_TRANS = record
00559 db_handle: PISC_DB_HANDLE;
00560 tpb_length: Word;
00561 tpb_address: PChar;
00562 end;
00563
00564 {****************************************************}
00565 { This record type is for passing arguments to }
00566 { isc_start_multiple (see docs) }
00567 {****************************************************}
00568 TISC_TEB = record
00569 db_handle: PISC_DB_HANDLE;
00570 tpb_length: LongInt;
00571 tpb_address: PChar;
00572 end;
00573 PISC_TEB = ^TISC_TEB;
00574 TISC_TEB_ARRAY = array[0..0] of TISC_TEB;
00575 PISC_TEB_ARRAY = ^TISC_TEB_ARRAY;
00576
00577 { Interbase status array }
00578 PARRAY_ISC_STATUS = ^TARRAY_ISC_STATUS;
00579 TARRAY_ISC_STATUS = array[0..20] of ISC_STATUS;
00580
00581 implementation
00582
00583 end.