📄 sdsyb.hpp
字号:
Byte timestamp[8];
int timestamplen;
Byte textptr[16];
int textptrlen;
} ;
#pragma pack(pop)
typedef _cs_iodesc TCS_IODESC;
#pragma pack(push, 4)
struct _cs_browsedesc
{
int status;
int isbrowse;
char origname[132];
int orignlen;
int tablenum;
char tablename[400];
int tabnlen;
} ;
#pragma pack(pop)
typedef _cs_browsedesc TCS_BROWSEDESC;
#pragma pack(push, 4)
struct _cs_servermsg
{
int msgnumber;
int state;
int severity;
char text[1024];
int textlen;
char svrname[132];
int svrnlen;
char proc[132];
int proclen;
int line;
int status;
Byte sqlstate[8];
int sqlstatelen;
} ;
#pragma pack(pop)
typedef _cs_servermsg TCS_SERVERMSG;
#pragma pack(push, 4)
struct _cs_clientmsg
{
int severity;
int msgnumber;
char msgstring[1024];
int msgstringlen;
int osnumber;
char osstring[1024];
int osstringlen;
int status;
Byte sqlstate[8];
int sqlstatelen;
} ;
#pragma pack(pop)
typedef _cs_clientmsg TCS_CLIENTMSG;
class DELPHICLASS ESDSybError;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION ESDSybError : public Sdcommon::ESDEngineError
{
typedef Sdcommon::ESDEngineError inherited;
public:
#pragma option push -w-inl
/* ESDEngineError.Create */ inline __fastcall ESDSybError(int AErrorCode, int ANativeError, const AnsiString
Msg, int AErrorPos) : Sdcommon::ESDEngineError(AErrorCode, ANativeError, Msg, AErrorPos) { }
#pragma option pop
#pragma option push -w-inl
/* ESDEngineError.CreateDefPos */ inline __fastcall virtual ESDSybError(int AErrorCode, int ANativeError
, const AnsiString Msg) : Sdcommon::ESDEngineError(AErrorCode, ANativeError, Msg) { }
#pragma option pop
public:
#pragma option push -w-inl
/* Exception.CreateFmt */ inline __fastcall ESDSybError(const AnsiString Msg, const System::TVarRec
* Args, const int Args_Size) : Sdcommon::ESDEngineError(Msg, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateRes */ inline __fastcall ESDSybError(int Ident, Extended Dummy) : Sdcommon::ESDEngineError(
Ident, Dummy) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmt */ inline __fastcall ESDSybError(int Ident, const System::TVarRec * Args,
const int Args_Size) : Sdcommon::ESDEngineError(Ident, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateHelp */ inline __fastcall ESDSybError(const AnsiString Msg, int AHelpContext) :
Sdcommon::ESDEngineError(Msg, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmtHelp */ inline __fastcall ESDSybError(const AnsiString Msg, const System::TVarRec
* Args, const int Args_Size, int AHelpContext) : Sdcommon::ESDEngineError(Msg, Args, Args_Size, AHelpContext
) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResHelp */ inline __fastcall ESDSybError(int Ident, int AHelpContext) : Sdcommon::ESDEngineError(
Ident, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmtHelp */ inline __fastcall ESDSybError(int Ident, const System::TVarRec * Args
, const int Args_Size, int AHelpContext) : Sdcommon::ESDEngineError(Ident, Args, Args_Size, AHelpContext
) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~ESDSybError(void) { }
#pragma option pop
};
#pragma pack(pop)
#pragma pack(push, 1)
struct TISybConnInfo
{
Byte ServerType;
void * *ConnPtr;
void * *CmdPtr;
char *szSrvName;
char *szDBName;
} ;
#pragma pack(pop)
class DELPHICLASS TISybDatabase;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TISybDatabase : public Sdcommon::TISqlDatabase
{
typedef Sdcommon::TISqlDatabase inherited;
private:
void *FHandle;
bool FIsSingleConn;
Sdcommon::TISqlCommand* FCurSqlCmd;
bool FIsAnywhere;
bool FEmptyStrAsNull;
void __fastcall AllocHandle(void);
void __fastcall FreeHandle(void);
PCS_CONNECTION __fastcall GetConnPtr(void);
PCS_COMMAND __fastcall GetCmdPtr(void);
char * __fastcall GetDBNamePtr(void);
char * __fastcall GetSrvNamePtr(void);
void __fastcall GetStmtResult(const AnsiString Stmt, int ColNo, Classes::TStrings* List);
void __fastcall HandleInitCmd(PCS_COMMAND ACmd, AnsiString sCmd);
void __fastcall HandleExec(PCS_COMMAND ACmd);
void __fastcall HandleReset(PCS_COMMAND ACmd);
void __fastcall HandleSetIsolation(PCS_CONNECTION AConn);
void __fastcall HandleSetDefOpt(PCS_CONNECTION AConn);
void __fastcall SetDefaultOptions(void);
void __fastcall SetIsAnywhereProp(void);
protected:
void __fastcall Check(int rcd);
void __fastcall CheckExt(int rcd, PCS_CONNECTION ConnPtr);
virtual void * __fastcall GetHandle(void);
virtual void __fastcall DoConnect(const AnsiString sRemoteDatabase, const AnsiString sUserName, const
AnsiString sPassword);
virtual void __fastcall DoDisconnect(bool Force);
virtual void __fastcall DoCommit(void);
virtual void __fastcall DoRollback(void);
virtual void __fastcall DoStartTransaction(void);
virtual void __fastcall SetAutoCommitOption(bool Value);
virtual void __fastcall SetHandle(void * AHandle);
__property bool IsSingleConn = {read=FIsSingleConn, nodefault};
public:
__fastcall virtual TISybDatabase(Classes::TStrings* ADbParams);
__fastcall virtual ~TISybDatabase(void);
virtual Sdcommon::TISqlCommand* __fastcall CreateSqlCommand(void);
virtual AnsiString __fastcall GetAutoIncSQL(void);
virtual int __fastcall GetClientVersion(void);
virtual int __fastcall GetServerVersion(void);
virtual AnsiString __fastcall GetVersionString(void);
virtual Sdcommon::TISqlCommand* __fastcall GetSchemaInfo(Sdcommon::TSDSchemaType ASchemaType, AnsiString
AObjectName);
virtual void __fastcall SetTransIsolation(Sdcommon::TISqlTransIsolation Value);
virtual bool __fastcall SPDescriptionsAvailable(void);
virtual bool __fastcall TestConnected(void);
void __fastcall ReleaseDBHandle(Sdcommon::TISqlCommand* ASqlCmd, bool IsFetchAll);
__property Sdcommon::TISqlCommand* CurSqlCmd = {read=FCurSqlCmd};
__property PCS_CONNECTION ConnPtr = {read=GetConnPtr};
__property PCS_COMMAND CmdPtr = {read=GetCmdPtr};
__property char * SrvNamePtr = {read=GetSrvNamePtr};
__property char * DBNamePtr = {read=GetDBNamePtr};
__property bool IsAnywhere = {read=FIsAnywhere, nodefault};
__property bool EmptyStrAsNull = {read=FEmptyStrAsNull, nodefault};
};
#pragma pack(pop)
class DELPHICLASS TISybCommand;
#pragma pack(push, 4)
class PASCALIMPLEMENTATION TISybCommand : public Sdcommon::TISqlCommand
{
typedef Sdcommon::TISqlCommand inherited;
private:
AnsiString FBindStmt;
int FRowsAffected;
void * *FConnPtr;
void * *FHandle;
bool FRowResult;
bool FIsSingleConn;
bool FEmptyStrAsNull;
bool FConnected;
Classes::TStrings* FColInfo;
bool FNextResults;
bool FEndResults;
bool FIsRTrimChar;
bool FEndOfFetch;
int FMinBlobFieldNo;
void __fastcall Check(int rcd);
void __fastcall Connect(void);
void __fastcall CreateConnection(void);
AnsiString __fastcall CnvtDateTimeToSQLVarChar(Db::TFieldType ADataType, System::TDateTime Value);
_cs_datetime __fastcall CnvtDateTimeToSQLDateTime(System::TDateTime Value);
Db::TDateTimeRec __fastcall CnvtDBDateTime2DateTimeRec(Db::TFieldType ADataType, char * Buffer, int
BufSize);
AnsiString __fastcall CnvtFloatToSQLVarChar(double Value);
AnsiString __fastcall CnvtBlobToSQLHexString(AnsiString Value);
double __fastcall CnvtDBFloatToFloat(const _cs_datafmt &datafmt, void * data);
void __fastcall HandleInitLangCmd(PCS_COMMAND ACmd, AnsiString sCmd);
void __fastcall HandleInitRpcCmd(PCS_COMMAND ACmd, AnsiString ARpcName);
int __fastcall HandleExec(PCS_COMMAND ACmd);
void __fastcall HandleCurReset(PCS_COMMAND ACmd);
void __fastcall HandleReset(PCS_COMMAND ACmd);
void __fastcall HandleSend(PCS_COMMAND ACmd);
bool __fastcall HandleSpResults(PCS_COMMAND ACmd);
PCS_COMMAND __fastcall GetCmdPtr(void);
bool __fastcall GetExecuted(void);
HIDESBASE TISybDatabase* __fastcall GetSqlDatabase(void);
void __fastcall InternalExecute(void);
void __fastcall InternalQBindParams(void);
void __fastcall InternalQExecute(void);
void __fastcall InternalSpBindParams(void);
void __fastcall InternalSpExecute(void);
void __fastcall InternalSpGetParams(void);
void __fastcall InternalGetStatus(void);
void __fastcall ReadNonBindFields(void);
int __fastcall ReadNonBlobField(Sdcommon::TSDFieldDesc* AFieldDesc, void * SelBuf, int BufLen);
protected:
void __fastcall AcquireDBHandle(void);
void __fastcall ReleaseDBHandle(void);
virtual void __fastcall BindParamsBuffer(void);
virtual int __fastcall GetParamsBufferSize(void);
virtual void __fastcall DoPrepare(AnsiString Value);
virtual void __fastcall DoExecDirect(AnsiString Value);
virtual void __fastcall DoExecute(void);
virtual void __fastcall GetFieldDescs(Sdcommon::TSDFieldDescList* Descs);
virtual void * __fastcall GetHandle(void);
virtual void __fastcall InitParamList(void);
virtual void __fastcall SetFieldsBuffer(void);
virtual Db::TFieldType __fastcall FieldDataType(int ExtDataType);
virtual Word __fastcall NativeDataSize(Db::TFieldType FieldType);
virtual int __fastcall NativeDataType(Db::TFieldType FieldType);
virtual bool __fastcall RequiredCnvtFieldType(Db::TFieldType FieldType);
public:
__fastcall virtual TISybCommand(Sdcommon::TISqlDatabase* ASqlDatabase);
__fastcall virtual ~TISybCommand(void);
virtual void __fastcall CloseResultSet(void);
virtual void __fastcall Disconnect(bool Force);
virtual void __fastcall Execute(void);
virtual int __fastcall GetRowsAffected(void);
virtual bool __fastcall NextResultSet(void);
virtual bool __fastcall ResultSetExists(void);
virtual bool __fastcall FetchNextRow(void);
virtual bool __fastcall GetCnvtFieldData(Sdcommon::TSDFieldDesc* AFieldDesc, void * Buffer, int BufSize
);
virtual void __fastcall GetOutputParams(void);
virtual int __fastcall ReadBlob(Sdcommon::TSDFieldDesc* AFieldDesc, Sdcommon::TBytes &BlobData);
__property PCS_COMMAND CmdPtr = {read=GetCmdPtr};
__property bool Executed = {read=GetExecuted, nodefault};
__property TISybDatabase* SqlDatabase = {read=GetSqlDatabase};
};
#pragma pack(pop)
//-- var, const, procedure ---------------------------------------------------
static const Shortint CS_BITS_PER_BYTE = 0x8;
static const int CS_SUCCEED = 0x1;
static const int CS_FAIL = 0x0;
static const int CS_MEM_ERROR = 0xffffffff;
static const int CS_PENDING = 0xfffffffe;
static const int CS_QUIET = 0xfffffffd;
static const int CS_BUSY = 0xfffffffc;
static const int CS_INTERRUPT = 0xfffffffb;
static const int CS_BLK_HAS_TEXT = 0xfffffffa;
static const int CS_CONTINUE = 0xfffffff9;
static const int CS_FATAL = 0xfffffff8;
static const int CS_RET_HAFAILOVER = 0xfffffff7;
static const int CS_CONV_ERR = 0xffffff9c;
static const int CS_EXTERNAL_ERR = 0xffffff38;
static const int CS_INTERNAL_ERR = 0xfffffed4;
static const int CS_COMN_ERR = 0xfffffe70;
static const int CS_CANCELED = 0xffffff36;
static const int CS_ROW_FAIL = 0xffffff35;
static const int CS_END_DATA = 0xffffff34;
static const int CS_END_RESULTS = 0xffffff33;
static const int CS_END_ITEM = 0xffffff32;
static const int CS_NOMSG = 0xffffff31;
static const int CS_TIMED_OUT = 0xffffff30;
static const int CS_PASSTHRU_EOM = 0xffffff2e;
static const int CS_PASSTHRU_MORE = 0xffffff2d;
static const int CS_TRYING = 0xffffff2b;
static const int CS_EBADPARAM = 0xffffff2a;
static const int CS_EBADLEN = 0xffffff29;
static const int CS_ENOCNVRT = 0xffffff28;
static const int CS_EOVERFLOW = 0xffffff9b;
static const int CS_EUNDERFLOW = 0xffffff9a;
static const int CS_EPRECISION = 0xffffff99;
static const int CS_ESCALE = 0xffffff98;
static const int CS_ESYNTAX = 0xffffff97;
static const int CS_EFORMAT = 0xffffff96;
static const int CS_EDOMAIN = 0xffffff95;
static const int CS_EDIVZERO = 0xffffff94;
static const int CS_ERESOURCE = 0xffffff93;
static const int CS_ENULLNOIND = 0xffffff92;
static const int CS_ETRUNCNOIND = 0xffffff91;
static const int CS_ENOBIND = 0xffffff90;
static const int CS_TRUNCATED = 0xffffff8f;
static const int CS_ESTYLE = 0xffffff8e;
static const int CS_EBADXLT = 0xffffff8d;
static const int CS_ENOXLT = 0xffffff8c;
static const int CS_USEREP = 0xffffff8b;
static const int CS_SV_INFORM = 0x0;
static const int CS_SV_API_FAIL = 0x1;
static const int CS_SV_RETRY_FAIL = 0x2;
static const int CS_SV_RESOURCE_FAIL = 0x3;
static const int CS_SV_CONFIG_FAIL = 0x4;
static const int CS_SV_COMM_FAIL = 0x5;
static const int CS_SV_INTERNAL_FAIL = 0x6;
static const int CS_SV_FATAL = 0x7;
static const Shortint CS_STAT_DEFAULT = 0x0;
static const Shortint CS_STAT_MULTIBYTE = 0x1;
static const Shortint CS_STAT_SPACELAST = 0x2;
static const Shortint CS_STAT_NONASCIISP = 0x4;
static const int CS_MAX_LOCALE = 0x44;
static const int CS_MAX_NAME = 0x84;
static const int CS_MAX_PASS = 0x1e;
static const int CS_MAX_CHAR = 0x100;
static const int CS_MAX_DS_STRING = 0x200;
static const int CS_MAX_NUMLEN = 0x21;
static const int CS_TRUE = 0x1;
static const int CS_FALSE = 0x0;
static const int CS_NULLTERM = 0xfffffff7;
static const int CS_WILDCARD = 0xffffff9d;
static const int CS_NO_LIMIT = 0xffffd8f1;
static const int CS_UNUSED = 0xfffe7961;
static const int CS_UNEXPIRED = 0xfff0bdc1;
static const int USER_UNICHAR_TYPE = 0x22;
static const int USER_UNIVARCHAR_TYPE = 0x23;
static const int CS_ILLEGAL_TYPE = 0xffffffff;
static const int CS_CHAR_TYPE = 0x0;
static const int CS_BINARY_TYPE = 0x1;
static const int CS_LONGCHAR_TYPE = 0x2;
static const int CS_LONGBINARY_TYPE = 0x3;
static const int CS_TEXT_TYPE = 0x4;
static const int CS_IMAGE_TYPE = 0x5;
static const int CS_TINYINT_TYPE = 0x6;
static const int CS_SMALLINT_TYPE = 0x7;
static const int CS_INT_TYPE = 0x8;
static const int CS_REAL_TYPE = 0x9;
static const int CS_FLOAT_TYPE = 0xa;
static const int CS_BIT_TYPE = 0xb;
static const int CS_DATETIME_TYPE = 0xc;
static const int CS_DATETIME4_TYPE = 0xd;
static const int CS_MONEY_TYPE = 0xe;
static const int CS_MONEY4_TYPE = 0xf;
static const int CS_NUMERIC_TYPE = 0x10;
static const int CS_DECIMAL_TYPE = 0x11;
static const int CS_VARCHAR_TYPE = 0x12;
static const int CS_VARBINARY_TYPE = 0x13;
static const int CS_LONG_TYPE = 0x14;
static const int CS_SENSITIVITY_TYPE = 0x15;
static const int CS_BOUNDARY_TYPE = 0x16;
static const int CS_VOID_TYPE = 0x17;
static const int CS_USHORT_TYPE = 0x18;
static const int CS_UNICHAR_TYPE = 0x19;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -