📄 jvquibase.pas
字号:
ISC_ARRAY_BOUND = record
array_bound_lower: Smallint;
array_bound_upper: Smallint;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ISC_ARRAY_BOUND}{$ENDIF}
TISCArrayBound = ISC_ARRAY_BOUND;
{$IFDEF IB7_UP}
PISCArrayDescV2 = ^TISCArrayDescV2;
ISC_ARRAY_DESC_V2 = record
array_desc_version: Smallint;
array_desc_dtype: Char;
array_desc_subtype: Char;
array_desc_scale: Char;
array_desc_length: Word;
array_desc_field_name: array [0..METADATALENGTH - 1] of Char;
array_desc_relation_name: array [0..METADATALENGTH - 1] of Char;
array_desc_dimensions: Smallint;
array_desc_flags: Smallint;
array_desc_bounds: array [0..15] of TISCArrayBound;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ISC_ARRAY_DESC_V2}{$ENDIF}
TISCArrayDescV2 = ISC_ARRAY_DESC_V2;
const
ARR_DESC_VERSION2 = 2;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ARR_DESC_VERSION2}{$ENDIF}
ARR_DESC_CURRENT_VERSION = ARR_DESC_VERSION2;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ARR_DESC_CURRENT_VERSION}{$ENDIF}
type
PISCBlobDescV2 = ^TISCBlobDescV2;
ISC_BLOB_DESC_V2 = record
blob_desc_version: Smallint;
blob_desc_subtype: Smallint;
blob_desc_charset: Smallint;
blob_desc_segment_size: Smallint;
blob_desc_field_name: array [0..METADATALENGTH - 1] of Char;
blob_desc_relation_name: array [0..METADATALENGTH - 1] of Char;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ISC_BLOB_DESC_V2}{$ENDIF}
TISCBlobDescV2 = ISC_BLOB_DESC_V2;
const
BLB_DESC_VERSION2 = 2;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM BLB_DESC_VERSION2}{$ENDIF}
BLB_DESC_CURRENT_VERSION = BLB_DESC_VERSION2;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM BLB_DESC_CURRENT_VERSION}{$ENDIF}
{$ENDIF IB7_UP}
type
PISCArrayDesc = ^TISCArrayDesc;
ISC_ARRAY_DESC = record
array_desc_dtype: Char;
array_desc_scale: Char;
array_desc_length: Word;
array_desc_field_name: array [0..METADATALENGTH - 1] of Char;
array_desc_relation_name: array [0..METADATALENGTH - 1] of Char;
array_desc_dimensions: Smallint;
array_desc_flags: Smallint;
array_desc_bounds: array [0..15] of TISCArrayBound;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ISC_ARRAY_DESC}{$ENDIF}
TISCArrayDesc = {$IFDEF TYPE_IDENTITY} type {$ENDIF} ISC_ARRAY_DESC;
PISCBlobDesc = ^TISCBlobDesc;
ISC_BLOB_DESC = record
blob_desc_subtype: Smallint;
blob_desc_charset: Smallint;
blob_desc_segment_size: Smallint;
blob_desc_field_name: array [0..METADATALENGTH - 1] of Char;
blob_desc_relation_name: array [0..METADATALENGTH - 1] of Char;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ISC_BLOB_DESC}{$ENDIF}
TISCBlobDesc = {$IFDEF TYPE_IDENTITY} type {$ENDIF} ISC_BLOB_DESC;
(***************************
* Blob control structure *
***************************)
TISCStatusFn = function: ISCStatus;
PISCBlobCtl = ^TISCBlobCtl;
ISC_BLOB_CTL = record
ctl_source: TISCStatusFn; // Source filter
ctl_source_handle: PISCBlobCtl; // Argument to pass to source filter
ctl_to_sub_type: Smallint; // Target type
ctl_from_sub_type: Smallint; // Source type
ctl_buffer_length: Word; // Length of buffer
ctl_segment_length: Word; // Length of current segment
ctl_bpb_length: Word; // Length of blob parameter block
ctl_bpb: PChar; // Address of blob parameter block
ctl_buffer: PChar; // Address of segment buffer
ctl_max_segment: ISCLong; // Length of longest segment
ctl_number_segments: ISCLong; // Total number of segments
ctl_total_length: ISCLong; // Total length of blob
ctl_status: PISCStatus; // Address of status vector
ctl_data: array [0..7] of Longint; // Application specific data
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM ISC_BLOB_CTL}{$ENDIF}
TISCBlobCtl = ISC_BLOB_CTL;
(***************************)
(* Blob stream definitions *)
(***************************)
PBStream = ^TBStream;
BSTREAM = record
bstr_blob: PPointer; // Blob handle
bstr_buffer: PChar; // Address of buffer
bstr_ptr: PChar; // Next character
bstr_length: Smallint; // Length of buffer
bstr_cnt: Smallint; // Characters in buffer
bstr_mode: Char; // (mode) ? OUTPUT : INPUT
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM BSTREAM}{$ENDIF}
TBStream = BSTREAM;
(********************************************************************
* CVC: Public blob interface definition held in val.h. *
* For some unknown reason, it was only documented in langRef *
* and being the structure passed by the engine to UDFs it never *
* made its way into this public definitions file. *
* Being its original name "blob", I renamed it blobcallback here. *
* I did the full definition with the proper parameters instead of *
* the weak C declaration with any number and type of parameters. *
* Since the first parameter -BLB- is unknown outside the engine, *
* it's more accurate to use void* than int* as the blob pointer *
********************************************************************)
//#if !defined(_JRD_VAL_H_) && !defined(REQUESTER)
(* Blob passing structure *)
type
{$IFDEF FB102ORYF867}
lseek_mode =
(blb_seek_INVALID_0, blb_seek_relative, blb_seek_from_tail);
{$IFDEF USE_IBASE_H}{$EXTERNALSYM lseek_mode}{$ENDIF}
TLSeekMode = lseek_mode;
{$ENDIF FB102ORYF867}
TBlobGetSegmentFn = function(hnd: Pointer; buffer: PChar; buf_size: ISCUShort;
var result_len: ISCUShort): Smallint; stdcall;
TBlobPutSegmentFn = procedure(hnd: PPointer; buffer: PChar;
buf_size: ISCUShort); stdcall;
TBlobLSeekFn = function(hnd: PPointer; mode: ISCUShort; offset: ISCLong): ISCLong; stdcall;
{$IFDEF FB102ORYF867}
PBlobCallBack = ^TBlobCallBack;
BLOBCALLBACK = record
blob_get_segment: TBlobGetSegmentFn;
blob_handle: PPointer;
blob_number_segments: ISCLong;
blob_max_segment: ISCLong;
blob_total_length: ISCLong;
blob_put_segment: TBlobPutSegmentFn;
blob_lseek: TBlobLSeekFn;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM BLOBCALLBACK}{$ENDIF}
TBlobCallBack = BLOBCALLBACK;
//#endif /* !defined(_JRD_VAL_H_) && !defined(REQUESTER) */
(********************************************************************
* CVC: Public descriptor interface held in dsc.h. *
* We need it documented to be able to recognize NULL in UDFs. *
* Being its original name "dsc", I renamed it paramdsc here. *
* Notice that I adjust to the original definition: contrary to *
* other cases, the typedef is the same struct not the pointer. *
* I included the enumeration of dsc_dtype possible values. *
* Ultimately, dsc.h should be part of the public interface. *
********************************************************************)
//#if !defined(_JRD_DSC_H_)
(* This is the famous internal descriptor that UDFs can use, too. *)
PParamDsc = ^TParamDsc;
PARAMDSC = record
dsc_dtype: Char;
dsc_scale: Shortint;
dsc_length: ISCUShort;
dsc_sub_type: Smallint;
dsc_flags: ISCUShort;
dsc_address: PChar;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM PARAMDSC}{$ENDIF}
TParamDsc = PARAMDSC;
//#if !defined(_JRD_VAL_H_)
(* This is a helper struct to work with varchars. *)
PParamVary = ^TParamVary;
PARAMVARY = record
vary_length: ISCUShort;
vary_string: array [0..0] of Char;
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM PARAMVARY}{$ENDIF}
TParamVary = PARAMVARY;
//#endif /* !defined(_JRD_VAL_H_) */
(* values for dsc_flags *)
(* Note: DSC_null is only reliably set for local variables
(blr_variable) *)
const
DSC_null = 1;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM DSC_null}{$ENDIF}
DSC_no_subtype = 2; (* dsc has no sub type specified *)
{$IFDEF USE_IBASE_H}{$EXTERNALSYM DSC_no_subtype}{$ENDIF}
DSC_nullable = 4; (* not stored. instead, is derived
from metadata primarily to flag
SQLDA (in DSQL) *)
{$IFDEF USE_IBASE_H}{$EXTERNALSYM DSC_nullable}{$ENDIF}
(* Note that dtype_null actually means that we do not yet know the
dtype for this descriptor. A nice cleanup item would be to globally
change it to dtype_unknown. --chrisj 1999-02-17 *)
dtype_null = 0;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_null}{$ENDIF}
dtype_text = 1;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_text}{$ENDIF}
dtype_cstring = 2;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_cstring}{$ENDIF}
dtype_varying = 3;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_varying}{$ENDIF}
dtype_packed = 6;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_packed}{$ENDIF}
dtype_byte = 7;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_byte}{$ENDIF}
dtype_short = 8;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_short}{$ENDIF}
dtype_long = 9;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_long}{$ENDIF}
dtype_quad = 10;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_quad}{$ENDIF}
dtype_real = 11;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_real}{$ENDIF}
dtype_double = 12;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_double}{$ENDIF}
dtype_d_float = 13;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_d_float}{$ENDIF}
dtype_sql_date = 14;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_sql_date}{$ENDIF}
dtype_sql_time = 15;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_sql_time}{$ENDIF}
dtype_timestamp = 16;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_timestamp}{$ENDIF}
dtype_blob = 17;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_blob}{$ENDIF}
dtype_array = 18;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_array}{$ENDIF}
dtype_int64 = 19;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM dtype_int64}{$ENDIF}
DTYPE_TYPE_MAX = 20;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM DTYPE_TYPE_MAX}{$ENDIF}
//#endif /* !defined(_JRD_DSC_H_) */
{$ENDIF FB102ORYF867}
(***************************
* Dynamic SQL definitions *
***************************)
(******************************
* Declare the extended SQLDA *
******************************)
{$IFDEF IB7_UP}
(***********************************************************************
* Older and obsolete XSQLVAR, ISC_BLOB_DESC, ISC_ARRAY_DESC strucutres.
* NOTE:These structure will no longer be available in future releases.
* This is kept only for backward compatability.
* Please refrain from using these old structures.
* It is strongly recomended to use the newer SQLDA version
* and related XSQLVAR, ISC_BLOB_DESC, ISC_ARRAY_DESC structures.
***********************************************************************)
type
PXSQLVarV1 = ^TXSQLVarV1;
XSQLVAR_V1 = record
sqltype: Smallint; // datatype of field
sqlscale: Smallint; // scale factor
sqlsubtype: Smallint; // datatype subtype
sqllen: Smallint; // length of data area
sqldata: PChar; // address of data
sqlind: PSmallInt; // address of indicator variable
sqlname_length: Smallint; // length of sqlname field
sqlname: array [0..METADATALENGTH - 1] of Char; // name of field, name length + space for NULL
relname_length: Smallint; // length of relation name
relname: array [0..METADATALENGTH - 1] of Char; // field's relation name + space for NULL
ownname_length: Smallint; // length of owner name
ownname: array [0..METADATALENGTH - 1] of Char; // relation's owner name + space for NULL
aliasname_length: Smallint; // length of alias name
aliasname: array [0..METADATALENGTH - 1] of Char; // relation's alias name + space for NULL
end;
{$IFDEF USE_IBASE_H}{$EXTERNALSYM XSQLVAR_V1}{$ENDIF}
TXSQLVarV1 = XSQLVAR_V1;
PXSQLVar = ^TXSQLVar;
XSQLVAR = record
sqltype: Smallint; // datatype of field
sqlscale: Smallint; // scale factor
sqlprecision: Smallint; // precision : Reserved for future
sqlsubtype: Smallint; // datatype subtype
sqllen: Smallint; // length of data area
sqldata: PChar; // address of data
sqlind: PSmallint; // address of indicator variable
sqlname_length: Smallint; // length of sqlname field
sqlname: array [0..METADATALENGTH - 1] of Char; // name of field, name length + space for NULL
relname_length: Smallint; // length of relation name
relname: array [0..METADATALENGTH - 1] of Char; // field's relation name + space for NULL
ownname_length: Smallint; // length of owner name
ownname: array [0..METADATALENGTH - 1] of Char; // relation's owner name + space for NULL
aliasname_length: Smallint; // length of alias name
aliasname: array [0..METADATALENGTH - 1] of Char; // relation's alias name + space for NULL
end;
{$ELSE}
type
PXSQLVar = ^TXSQLVar;
XSQLVAR = record
sqltype: Smallint; // datatype of field
sqlscale: Smallint; // scale factor
sqlsubtype: Smallint; // datatype subtype - BLOBs & Text types only
sqllen: Smallint; // length of data area
sqldata: PChar; // address of data
sqlind: PSmallint; // address of indicator variable
sqlname_length: Smallint; // length of sqlname field
sqlname: array [0..METADATALENGTH - 1] of Char; // name of field, name length + space for NULL
relname_length: Smallint; // length of relation name
relname: array [0..METADATALENGTH - 1] of Char; // field's relation name + space for NULL
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -