From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:45:06 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>CTLibDatabaseException</name> <environment>Database</environment> <super>Database.ExternalDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibDatabaseException
CTLibDatabaseException is raised in case of Sybase database errors.
</comment> <class> <name>CTLibInterface</name> <environment>Database</environment> <super>External.ExternalInterface</super> <private>false</private> none encoding getSelectorMap fSqlTypeToConversionMap fetchBufferSize putSelectorMap fSqlTypeFromConversionMap libraryLoaded fSqlTypeToServerTypeConversionMap <imports> Database.CTLibInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles></libraryFiles> <libraryDirectories></libraryDirectories> true full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibInterface defines calling conventions for the Open Client CT-Library version 10.0.x and later. This is the default adopted by the library.
</comment> <class> <name>CTLibColumnDescription</name> <environment>Database</environment> <super>Database.ExternalDatabaseColumnDescription</super> <private>false</private> none fSqlType <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibColumnDescription
CTLibColumnDescription extends ExternalDatabaseColumnDescription with information that is unique to CTLib. Instance Variables: fSqlType <SmallInteger> Type code answered from SQLDescribeCol or SQLColAttributes.
</comment> <class> <name>CTLibNTInterface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibNTInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libcs.dll</item> <item>libct.dll</item> <item>libsybcs.dll</item> <item>libsybct.dll</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibNTInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibNTInterface defines calling conventions for the Windows NT (Intel) Open Client CT-Library version 10.0.x and later
</comment> <class> <name>CTLibAOSFInterface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibAOSFInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libcomn.so</item> <item>libintl.so</item> <item>libtcl.so</item> <item>libct.so</item> <item>libcs.so</item> <item>libsybcomn.so</item> <item>libsybintl.so</item> <item>libsybtcl.so</item> <item>libsybct.so</item> <item>libsybcs.so</item></libraryFiles> <libraryDirectories><item>$(SYBASE)/lib</item></libraryDirectories> true full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibAOSFInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibAOSFInterface defines calling conventions for the Open Client CT-Library version 10.0.x and later on the AOSF platform.
</comment> <class> <name>CTLibLinuxInterface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibLinuxInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libsybase.so</item></libraryFiles> <libraryDirectories><item>$(SYBASE)/lib</item></libraryDirectories> false full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibLinuxInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibLinuxInterface defines calling conventions for the Linux (Intel) Open Client CT-Library version 10.0.x and later.
</comment> <class> <name>CTLibTransaction</name> <environment>Database</environment> <super>Database.ExternalDatabaseTransaction</super> <private>false</private> none <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibTransaction
Class CTLibTransaction is the concrete implementation of the transaction concept using the CTLib CLI. The implementation is trivial since CTLib doesn't support distributed or coordinated transaction.
</comment> <class> <name>CTLibConnection</name> <environment>Database</environment> <super>Database.ExternalDatabaseConnection</super> <private>false</private> none contextHolder connHolder appName hostName interfaceFileName loginTimeoutSeconds clientMsgHandlerCB serverMsgHandlerCB csVersion signalMap <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibConnection
CTLibConnection is the concrete implementation of connection services using the CT-Library. Instance variables: contextHolder <ValueHolder | nil> Holds nil or a CPointer to the context structure used by this connection. connHolder <ValueHolder | nil> Holds nil or a CPointer to the CS_CONNECTION structure used by this connection. appName <String | nil> Holds application defined application name. hostName <String | nil> Holds application define host name. interfaceFileName <String | nil> Holds the full name of the interfaces file. loginTimeoutSeconds <value | nil> Holds the login timeout value in secons to be used when calling ct_connect(). clientMsgHandlerCB <CCallback | nil> The callback function for receiving messages from the client. serverMsgHandlerCB <CCallback | nil> The callback function for receiving messages from the server. csVersion <Integer> Indicates desired Sybase version's behavior. Default is 10.0. Cursors require 15.x. Class instance variables: signalMap <IdentityDictionary> Maps a subset of CTLib error codes to specific signals Class Variables: ErrorQueues <Dictionary> A repository for the errors and messages as they arrive and until the driver wants to include them in a raised exception. RegisteredCTLibConnections <HandleRegistry> A registry of all active CTLib connections.
</comment> <class> <name>CTLibBuffer</name> <environment>Database</environment> <super>Database.ExternalDatabaseBuffer</super> <private>false</private> none indicatorsPointer lengthsPointer dataFmtPointer getSelector putSelector <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibBuffer
CTLibBuffer is a private subclass, and extends ExternalDatabaseBuffer to deal with CTLib. Intimate details are shared with CTLibSession. This implementation assumes in many places that the (inherited) count variable is always 0. Instance variables: indicatorsPointer <CPointer> Pointer to vector of indicators. lengthsPointer <CPointer> Pointer to vector of item lengths. dataFmtPointer <CPointer> Pointer to CS_DATAFMT structure. getSelector <nil | Symbol> Selector to perform to get values out of the buffer. putSelector <nil | Symbol> Selector to perform to put values into the buffer. Class variables: GetSelectorMap <IdentityDictionary> Maps from class name to a data conversion selector.
</comment> <class> <name>CTLibAixInterface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibAixInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libcomn.so.a</item> <item>libintl.so.a</item> <item>libtcl.so.a</item> <item>libct.so.a</item> <item>libcs.so.a</item> <item>libsybcomn.so.a</item> <item>libsybintl.so.a</item> <item>libsybtcl.so.a</item> <item>libsybct.so.a</item> <item>libsybcs.so.a</item></libraryFiles> <libraryDirectories><item>$(SYBASE)/lib</item></libraryDirectories> false full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibAixInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibAixInterface defines calling conventions for the AIX Open Client CT-Library version 10.0.x and later.
</comment> <class> <name>CTLibError</name> <environment>Database</environment> <super>Database.ExternalDatabaseError</super> <private>false</private> none severity msgstate srvname procname line <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibError
Class CTLibError holds error or message information received from Client or Server. For more information about the content of any of the variables, refer to the CTLib documentation. If the msgstate variable isNil, the CTLibError is reporting an error from the Client. If notNil, the CTLibError is reporting a message from the Server. The srvname, procname, & line variables are only defined for the Server messages. The osErrorCode and osErrorString are only be defined for Client messages. Inherited Instance Variables: dbmsErrorCode <SmallInteger> The error or message number. Access via the dbmsErrorCode or msgno messages. dbmsErrorString <String> A printable description of the error or message. Access via the dbmsErrorString or msgtext messages. osErrorCode <SmallInteger | nil> The operating-system-specific error number that describes the cause of the error. if there is no relevant operating-system error this variable will be nil. osErrorString <String | nil> A printable description of osErrorCode or nil. Instance Variables: severity <SmallInteger> The severity of the error or message. msgstate <SmallInteger | nil> The current server error state. srvname <String | nil> The name of the server that generated the message, if known. procname <String | nil> The name of the stored procedure that generated the message, if relevant. line <SmallInteger | nil> The number of the command batch or stored procedure line that generated the message.
</comment> <class> <name>CTLibSolarisInterface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibSolarisInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libcomn.so</item> <item>libintl.so</item> <item>libtcl.so</item> <item>libct.so</item> <item>libcs.so</item> <item>libsybcomn.so</item> <item>libsybintl.so</item> <item>libsybtcl.so</item> <item>libsybct.so</item> <item>libsybcs.so</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibSolarisInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibSolarisInterface defines calling conventions for the Open Client CT-Library version 10.0.x and later on the Solaris platform.
</comment> <class> <name>CTLibSession</name> <environment>Database</environment> <super>Database.ExternalDatabaseSession</super> <private>false</private> none cmdHolder returnStatus textLimit reasonPointer currentRowIndex totalRows rowsInBlock pRowsFetched res_type rowCount useCursor cursorName <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibSession
CTLibSession is the concrete implementation of session services using the CT-Library. Instance Variables: cmdHolder <ValueHolder on: (CPointer | nil)> Holds nil or pointer to the CS_COMMAND structure. returnStatus <SmallInteger | nil> The return status value from executing the stored procedure. This is valid only after processing all of the results from the stored procedure and before starting any new procesing. textLimit <SmallInteger | nil> An application specific value to set a limit on the number of bytes to fetch from a TEXT or IMAGE column. currentRowIndex <SmallInteger | nil> Index of the current row. totalRows <SmallInteger | nil> Total number of fetched rows. rowsInBlock <SmallInteger | nil> Number of rows fetched in current block. pRowsFetched <CPointer | nil> Pointer to a C integer with the number of fetched rows. res_type <SmallInteger | nil> Type of results from ct_results. useCursor <Boolean> Determines whether to use cursors. cursorName <String> Cursor name if a cursor is used. Class variables: RegisteredCTLibSessions <HandleRegistry> A private registry of all connected or paused CTLib sessions. This registry, unlike the registries on CTLibTransaction and CTLibConnection, does not exist to release a control block or to disconnect from the server. A CTLib session which is executing a query holds the responsibility to finish executing the query and processing the results so that another query may be executed. The executor will cause a cancel to occur if the session, when finalized, has an incompleted execution in process.
</comment> <class> <name>CTLibHPUXInterface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibHPUXInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libcomn.sl</item> <item>libinsck.sl</item> <item>libintl.sl</item> <item>libtcl.sl</item> <item>libct.sl</item> <item>libcs.sl</item> <item>libsybcomn.sl</item> <item>libsybinsck.sl</item> <item>libsybintl.sl</item> <item>libsybtcl.sl</item> <item>libsybct.sl</item> <item>libsybcs.sl</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibHPUXInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibHPUXInterface defines calling conventions for the HPUX Open Client CT-Library version 10.0.x and later.
</comment> <class> <name>CTLibWin16Interface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibWin16InterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>wcslib.dll</item> <item>wctlib.dll</item> <item>wcssyblib.dll</item> <item>wctsyblib.dll</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibWin16Interface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibWin16Interface defines calling conventions for the Windows 3.1 platform, Open Client CT-Library version 10.0.x and later.
</comment> <class> <name>UnableToOpenInterfacesFile</name> <environment>Database</environment> <super>Database.CTLibDatabaseException</super> <private>false</private> none <imports></imports> <category>Database-CTLib</category> <attributes> <package>CTLibEXDI</package> </attributes> </class> <comment> Database.UnableToOpenInterfacesFile
UnableToOpenInterfacesFile is used to indicate that the connection cannot open the interfaces file.
</comment> <class> <name>CTLibPowerMacInterface</name> <environment>Database</environment> <super>Database.CTLibInterface</super> <private>false</private> none <imports> Database.CTLibPowerMacInterfaceDictionary.* </imports> <category>Database-External-Libraries</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>libcs</item> <item>libct</item> <item>libsybcs</item> <item>libsybct</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>CTLibEXDI</package> </attributes> </class> <comment> Database.CTLibPowerMacInterface
This class is private to the implementation of External Database Interface services for the CT-Library. CTLibPowerMacInterface defines calling conventions for the PowerMac Open Client CT-Library version 10.0.x and later.
</comment> <name>PutSelectorMap</name> <environment>Database.CTLibBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <name>SQLTypeFromConversionMap</name> <environment>Database.CTLibBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <name>GetSelectorMap</name> <environment>Database.CTLibBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <name>FetchBufferSize</name> <environment>Database.CTLibBuffer</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <name>RegisteredCTLibSessions</name> <environment>Database.CTLibSession</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <name>ErrorQueues</name> <environment>Database.CTLibConnection</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <name>RegisteredCTLibConnections</name> <environment>Database.CTLibConnection</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <name>ServerEncoding</name> <environment>Database.CTLibConnection</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>CTLibEXDI</package> </attributes> <methods> Database.CTLibInterface <category>types</category>
CS_BINARY <C: typedef unsigned char CS_BINARY>
CS_BIT <C: typedef unsigned char CS_BIT>
CS_BOOL <C: typedef long CS_BOOL>
CS_BYTE <C: typedef unsigned char CS_BYTE>
CS_CHAR <C: typedef char CS_CHAR>
CS_CLIENTMSG <C: typedef struct _cs_clientmsg CS_CLIENTMSG>
CS_COMMAND <C: typedef struct _cscommand CS_COMMAND>
CS_CONNECTION <C: typedef struct _csconnection CS_CONNECTION>
CS_CONTEXT <C: typedef struct _cscontext CS_CONTEXT>
CS_CONV_FUNC <C: typedef CS_RETCODE (* CS_CONV_FUNC)(CS_CONTEXT * context, CS_DATAFMT * srcfmt, CS_VOID * src, CS_DATAFMT * destfmt, CS_VOID * dest, CS_INT * destlen)>
CS_DATAFMT <C: typedef struct _cs_datafmt CS_DATAFMT>
CS_DATETIME <C: typedef struct _cs_datetime CS_DATETIME>
CS_DATETIME4 <C: typedef struct _cs_datetime4 CS_DATETIME4>
CS_DECIMAL <C: typedef CS_NUMERIC CS_DECIMAL>
CS_FLOAT <C: typedef double CS_FLOAT>
CS_IMAGE <C: typedef unsigned char CS_IMAGE>
CS_INT <C: typedef long CS_INT>
CS_LOCALE <C: typedef struct _cslocale CS_LOCALE>
CS_LONG <C: typedef long CS_LONG>
CS_LONGBINARY <C: typedef unsigned char CS_LONGBINARY>
CS_LONGCHAR <C: typedef unsigned char CS_LONGCHAR>
CS_MONEY <C: typedef struct _cs_money CS_MONEY>
CS_MONEY4 <C: typedef struct _cs_money4 CS_MONEY4>
CS_MSGNUM <C: typedef long CS_MSGNUM>
CS_NUMERIC <C: typedef struct _cs_numeric CS_NUMERIC>
CS_REAL <C: typedef float CS_REAL>
CS_RETCODE <C: typedef long CS_RETCODE>
CS_SERVERMSG <C: typedef struct _cs_servermsg CS_SERVERMSG>
CS_SMALLINT <C: typedef short CS_SMALLINT>
CS_TEXT <C: typedef unsigned char CS_TEXT>
CS_THRDC_FUNC <C: typedef CS_RETCODE (* CS_THRDC_FUNC)(CS_THRDRES * * resource)>
CS_THRDE_FUNC <C: typedef CS_RETCODE (* CS_THRDE_FUNC)(CS_THRDRES * resource)>
CS_THRDID_FUNC <C: typedef CS_RETCODE (* CS_THRDID_FUNC)(CS_VOID * buffer, CS_INT buflen, CS_INT * outlen)>
CS_THRDM_FUNC <C: typedef CS_RETCODE (* CS_THRDM_FUNC)(CS_THRDRES * resource)>
CS_THRDRES <C: typedef void CS_THRDRES>
CS_THRDW_FUNC <C: typedef CS_RETCODE (* CS_THRDW_FUNC)(CS_THRDRES * resource, CS_INT millisecs)>
CS_THREAD <C: typedef struct _cs_thread CS_THREAD>
CS_TINYINT <C: typedef unsigned char CS_TINYINT>
CS_UINT <C: typedef unsigned long CS_UINT>
CS_USHORT <C: typedef unsigned short CS_USHORT>
CS_VARBINARY <C: typedef struct _cs_varybin CS_VARBINARY>
CS_VARCHAR <C: typedef struct _cs_varychar CS_VARCHAR>
CS_VOID <C: typedef void CS_VOID>
SQLCA <C: typedef struct _sqlca SQLCA>
</methods> <methods> Database.CTLibInterface <category>structs</category>
_cscommand <C: struct _cscommand>
_csconnection <C: struct _csconnection>
_cscontext <C: struct _cscontext>
_cslocale <C: struct _cslocale>
_cs_clientmsg <C: struct _cs_clientmsg { CS_INT severity; CS_MSGNUM msgnumber; CS_CHAR msgstring[1024]; CS_INT msgstringlen, osnumber; CS_CHAR osstring[1024]; CS_INT osstringlen, status; CS_BYTE sqlstate[8]; CS_INT sqlstatelen; }>
_cs_datafmt <C: struct _cs_datafmt { CS_CHAR name[132]; CS_INT namelen, datatype, format, maxlength, scale, precision, status, count, usertype; CS_LOCALE * locale; }>
_cs_datetime <C: struct _cs_datetime { CS_INT dtdays, dttime; }>
_cs_datetime4 <C: struct _cs_datetime4 { CS_USHORT days, minutes; }>
_cs_money <C: struct _cs_money { CS_INT mnyhigh; CS_UINT mnylow; }>
_cs_money4 <C: struct _cs_money4 { CS_INT mny4; }>
_cs_numeric <C: struct _cs_numeric { CS_BYTE precision, scale; CS_BYTE array[33]; }>
_cs_servermsg <C: struct _cs_servermsg { CS_MSGNUM msgnumber; CS_INT state, severity; CS_CHAR text[1024]; CS_INT textlen; CS_CHAR svrname[132]; CS_INT svrnlen; CS_CHAR proc[132]; CS_INT proclen, line, status; CS_BYTE sqlstate[8]; CS_INT sqlstatelen; }>
_cs_thread <C: struct _cs_thread { CS_THRDC_FUNC create_mutex_fn; CS_THRDM_FUNC delete_mutex_fn, take_mutex_fn, release_mutex_fn; CS_THRDC_FUNC create_event_fn; CS_THRDE_FUNC delete_event_fn, signal_event_fn, reset_event_fn; CS_THRDW_FUNC waitfor_event_fn; CS_THRDID_FUNC thread_id_fn; }>
_cs_varybin <C: struct _cs_varybin { CS_SMALLINT len; CS_BYTE array[256]; }>
_cs_varychar <C: struct _cs_varychar { CS_SMALLINT len; CS_CHAR str[256]; }>
_sqlca <C: struct _sqlca { char sqlcaid[8]; long sqlcabc, sqlcode; struct { long sqlerrml; char sqlerrmc[256]; } sqlerrm; char sqlerrp[8]; long sqlerrd[6]; char sqlwarn[8]; char sqlext[8]; }>
</methods> <methods> Database.CTLibInterface <category>types-extra</category>
clientMsgHandlerType <C: typedef CS_RETCODE ( __stdcall * clientMsgHandlerType) ( CS_CONTEXT * context, CS_CONNECTION * connection, CS_CLIENTMSG * msg )>
PTR <C: typedef void * PTR>
serverMsgHandlerType <C: typedef CS_RETCODE ( __stdcall * serverMsgHandlerType) ( CS_CONTEXT * context, CS_CONNECTION * connection, CS_SERVERMSG * msg )>
</methods> <methods> Database.CTLibInterface <category>defines</category>
CS_ABSOLUTE <C: #define CS_ABSOLUTE (CS_INT)3004 >
CS_ALLOC <C: #define CS_ALLOC (CS_INT)710 >
CS_APPNAME <C: #define CS_APPNAME (CS_INT)9102 >
CS_BINARY_TYPE <C: #define CS_BINARY_TYPE (CS_INT)1 >
CS_BIT_TYPE <C: #define CS_BIT_TYPE (CS_INT)11 >
CS_CANBENULL <C: #define CS_CANBENULL (CS_INT)32 >
CS_CANCELED <C: #define CS_CANCELED (CS_RETCODE)(CS_EXTERNAL_ERR-2) >
CS_CANCEL_ALL <C: #define CS_CANCEL_ALL (CS_INT)6001 >
CS_CANCEL_ATTN <C: #define CS_CANCEL_ATTN (CS_INT)6002 >
CS_CANCEL_CURRENT <C: #define CS_CANCEL_CURRENT (CS_INT)6000 >
CS_CHAR_TYPE <C: #define CS_CHAR_TYPE (CS_INT)0 >
CS_CLIENTMSG_CB <C: #define CS_CLIENTMSG_CB (CS_INT)3 >
CS_CMD_DONE <C: #define CS_CMD_DONE (CS_INT)4046 >
CS_CMD_FAIL <C: #define CS_CMD_FAIL (CS_INT)4048 >
CS_CMD_SUCCEED <C: #define CS_CMD_SUCCEED (CS_INT)4047 >
CS_COMPUTEFMT_RESULT <C: #define CS_COMPUTEFMT_RESULT (CS_INT)4050 >
CS_COMPUTE_RESULT <C: #define CS_COMPUTE_RESULT (CS_INT)4045 >
CS_CURSOR_AFTER_LAST <C: #define CS_CURSOR_AFTER_LAST (CS_INT)(CS_RETCODE)(CS_EXTERNAL_ERR - 19) >
CS_CURSOR_BEFORE_FIRST <C: #define CS_CURSOR_BEFORE_FIRST (CS_INT)(CS_RETCODE)(CS_EXTERNAL_ERR - 18) >
CS_CURSOR_CLOSE <C: #define CS_CURSOR_CLOSE (CS_INT)706 >
CS_CURSOR_DEALLOC <C: #define CS_CURSOR_DEALLOC (CS_INT)707 >
CS_CURSOR_DECLARE <C: #define CS_CURSOR_DECLARE (CS_INT)700 >
CS_CURSOR_DELETE <C: #define CS_CURSOR_DELETE (CS_INT)705 >
CS_CURSOR_OPEN <C: #define CS_CURSOR_OPEN (CS_INT)701 >
CS_CURSOR_OPTION <C: #define CS_CURSOR_OPTION (CS_INT)725 >
CS_CURSOR_RESULT <C: #define CS_CURSOR_RESULT (CS_INT)4041 >
CS_CURSOR_ROWS <C: #define CS_CURSOR_ROWS (CS_INT)703 >
CS_CURSOR_UPDATE <C: #define CS_CURSOR_UPDATE (CS_INT)704 >
CS_CURSTAT_CLOSED <C: #define CS_CURSTAT_CLOSED (CS_INT)0x0004 >
CS_CURSTAT_DECLARED <C: #define CS_CURSTAT_DECLARED (CS_INT)0x0001 >
CS_CURSTAT_IMPLICIT <C: #define CS_CURSTAT_IMPLICIT (CS_INT)0x0100 >
CS_CURSTAT_INSENSITIVE <C: #define CS_CURSTAT_INSENSITIVE (CS_INT)0x0400 >
CS_CURSTAT_KEYSETDRIVEN <C: #define CS_CURSTAT_KEYSETDRIVEN (CS_INT)0x1000 >
CS_CURSTAT_NONE <C: #define CS_CURSTAT_NONE (CS_INT)0x0000 >
CS_CURSTAT_OPEN <C: #define CS_CURSTAT_OPEN (CS_INT)0x0002 >
CS_CURSTAT_RDONLY <C: #define CS_CURSTAT_RDONLY (CS_INT)0x0008 >
CS_CURSTAT_SCROLLABLE <C: #define CS_CURSTAT_SCROLLABLE (CS_INT)0x0080 >
CS_CURSTAT_SEMISENSITIVE <C: #define CS_CURSTAT_SEMISENSITIVE (CS_INT)0x0800 >
CS_CURSTAT_SENSITIVE <C: #define CS_CURSTAT_SENSITIVE (CS_INT)0x0200 >
CS_CURSTAT_UPDATABLE <C: #define CS_CURSTAT_UPDATABLE (CS_INT)0x0010 >
CS_CUR_NAME <C: #define CS_CUR_NAME (CS_INT)9128 >
CS_CUR_STATUS <C: #define CS_CUR_STATUS (CS_INT)9126 >
CS_DATETIME4_TYPE <C: #define CS_DATETIME4_TYPE (CS_INT)13 >
CS_DATETIME_TYPE <C: #define CS_DATETIME_TYPE (CS_INT)12 >
CS_DEALLOC <C: #define CS_DEALLOC (CS_INT)711 >
CS_DECIMAL_TYPE <C: #define CS_DECIMAL_TYPE (CS_INT)17 >
CS_DESCRIBE_RESULT <C: #define CS_DESCRIBE_RESULT (CS_INT)4051 >
CS_DYNAMIC <C: #define CS_DYNAMIC (CS_INT)0x0004 >
CS_END_RESULTS <C: #define CS_END_RESULTS (CS_RETCODE)(CS_EXTERNAL_ERR-5) >
CS_EXTERNAL_ERR <C: #define CS_EXTERNAL_ERR (CS_RETCODE)(-200) >
CS_FAIL <C: #define CS_FAIL (CS_RETCODE)0 >
CS_FALSE <C: #define CS_FALSE (CS_INT)0 >
CS_FIRST <C: #define CS_FIRST (CS_INT)3000 >
CS_FLOAT_TYPE <C: #define CS_FLOAT_TYPE (CS_INT)10 >
CS_FMT_UNUSED <C: #define CS_FMT_UNUSED (CS_INT)0x00 >
CS_FORCE_CLOSE <C: #define CS_FORCE_CLOSE (CS_INT)301 >
CS_FORCE_EXIT <C: #define CS_FORCE_EXIT (CS_INT)300 >
CS_FOR_UPDATE <C: #define CS_FOR_UPDATE (CS_INT)0x0001 >
CS_GET <C: #define CS_GET (CS_INT)33 >
CS_HOSTNAME <C: #define CS_HOSTNAME (CS_INT)9103 >
CS_IFILE <C: #define CS_IFILE (CS_INT)9115 >
CS_IMAGE_TYPE <C: #define CS_IMAGE_TYPE (CS_INT)5 >
CS_IMPLICIT_CURSOR <C: #define CS_IMPLICIT_CURSOR (CS_INT)0x0040 >
CS_INT_TYPE <C: #define CS_INT_TYPE (CS_INT)8 >
CS_LANG_CMD <C: #define CS_LANG_CMD (CS_INT)148 >
CS_LAST <C: #define CS_LAST (CS_INT)3003 >
CS_LOGIN_TIMEOUT <C: #define CS_LOGIN_TIMEOUT (CS_INT)9116 >
CS_LONGCHAR_TYPE <C: #define CS_LONGCHAR_TYPE (CS_INT)2 >
CS_MAX_NAME <C: #define CS_MAX_NAME (CS_INT)255 >
CS_MONEY4_TYPE <C: #define CS_MONEY4_TYPE (CS_INT)15 >
CS_MONEY_TYPE <C: #define CS_MONEY_TYPE (CS_INT)14 >
CS_MSG_RESULT <C: #define CS_MSG_RESULT (CS_INT)4044 >
CS_NEXT <C: #define CS_NEXT (CS_INT)3001 >
CS_NOSCROLL_INSENSITIVE <C: #define CS_NOSCROLL_INSENSITIVE (CS_INT)0x1000 >
CS_NULLTERM <C: #define CS_NULLTERM (CS_INT)(-9) >
CS_NUMDATA <C: #define CS_NUMDATA (CS_INT)803 >
CS_NUMERIC_TYPE <C: #define CS_NUMERIC_TYPE (CS_INT)16 >
CS_OPT_TEXTSIZE <C: #define CS_OPT_TEXTSIZE (CS_INT)5002 >
CS_PARAM_RESULT <C: #define CS_PARAM_RESULT (CS_INT)4042 >
CS_PASSWORD <C: #define CS_PASSWORD (CS_INT)9101 >
CS_PREV <C: #define CS_PREV (CS_INT)3002 >
CS_READ_ONLY <C: #define CS_READ_ONLY (CS_INT)0x0002 >
CS_REAL_TYPE <C: #define CS_REAL_TYPE (CS_INT)9 >
CS_RELATIVE <C: #define CS_RELATIVE (CS_INT)3005 >
CS_ROWFMT_RESULT <C: #define CS_ROWFMT_RESULT (CS_INT)4049 >
CS_ROW_COUNT <C: #define CS_ROW_COUNT (CS_INT)800 >
CS_ROW_FAIL <C: #define CS_ROW_FAIL (CS_RETCODE)(CS_EXTERNAL_ERR-3) >
CS_ROW_RESULT <C: #define CS_ROW_RESULT (CS_INT)4040 >
CS_SCROLL_CURSOR <C: #define CS_SCROLL_CURSOR (CS_INT)0x0800 >
CS_SCROLL_CURSOR_ENDS <C: #define CS_SCROLL_CURSOR_ENDS (CS_INT)(CS_RETCODE)(CS_EXTERNAL_ERR - 17) >
CS_SCROLL_INSENSITIVE <C: #define CS_SCROLL_INSENSITIVE (CS_INT)0x0100 >
CS_SCROLL_KEYSETDRIVEN <C: #define CS_SCROLL_KEYSETDRIVEN (CS_INT)0x0400 >
CS_SCROLL_SEMISENSITIVE <C: #define CS_SCROLL_SEMISENSITIVE (CS_INT)0x0200 >
CS_SCROLL_SENSITIVE <C: #define CS_SCROLL_SENSITIVE (CS_INT)0x0080 >
CS_SERVERMSG_CB <C: #define CS_SERVERMSG_CB (CS_INT)2 >
CS_SET <C: #define CS_SET (CS_INT)34 >
CS_SMALLINT_TYPE <C: #define CS_SMALLINT_TYPE (CS_INT)7 >
CS_STATUS_RESULT <C: #define CS_STATUS_RESULT (CS_INT)4043 >
CS_SUCCEED <C: #define CS_SUCCEED (CS_RETCODE)1 >
CS_TEXTLIMIT <C: #define CS_TEXTLIMIT (CS_INT)9112 >
CS_TEXT_TYPE <C: #define CS_TEXT_TYPE (CS_INT)4 >
CS_TINYINT_TYPE <C: #define CS_TINYINT_TYPE (CS_INT)6 >
CS_TRUE <C: #define CS_TRUE (CS_INT)1 >
CS_UNUSED <C: #define CS_UNUSED (CS_INT)(-99999) >
CS_USERNAME <C: #define CS_USERNAME (CS_INT)9100 >
CS_VARBINARY_TYPE <C: #define CS_VARBINARY_TYPE (CS_INT)19 >
CS_VARCHAR_TYPE <C: #define CS_VARCHAR_TYPE (CS_INT)18 >
CS_VERSION <C: #define CS_VERSION (CS_INT)9114 >
CS_VERSION_100 <C: #define CS_VERSION_100 (CS_INT)112 >
CS_VERSION_110 <C: #define CS_VERSION_110 (CS_INT)1100 >
CS_VERSION_125 <C: #define CS_VERSION_125 (CS_INT)12500 >
CS_VERSION_150 <C: #define CS_VERSION_150 (CS_INT)15000 >
</methods> <methods> Database.CTLibInterface <category>accessing</category>
copyToHeapSelector ^#copyToHeap
csVersion ^self CS_VERSION_100
encoding encoding == nil ifTrue: [encoding := self getEncoding]. ^encoding
getEncoding ^#default
mallocSelector ^#malloc:
</methods> <methods> Database.CTLibInterface <category>private-library loading</category>
loadLibraries | aHandle libFiles libraryFiles | self class libraryLoaded ifTrue: [ ^self ]. libraryFiles := self libraryFiles. libFiles := libraryFiles copy. libraryFiles removeAll. libFiles do: [:aLibrary | aHandle := self primLoadLibrary: aLibrary name. aHandle isError ifFalse: [ libraryFiles add: aLibrary. self class libraryLoaded ifFalse: [ self class libraryLoaded: true. ]. ]. ]. libraryFiles isEmpty ifTrue: [ libraryFiles addAll: libFiles ]
primLoadLibrary: libraryName "Answer a handle returned by the platform-specific library loading services. If the library could not be loaded a SystemError is returned. The SystemError contains further information about the cause of the failure." <primitive: 330 errorCode: errorCode> ^errorCode
</methods> <methods> Database.CTLibInterface class <category>fileIn/Out</category>
binaryInitializationMessagesFor: sourceMode "Answer a list of message sends used to initialize the receiver." | list | list := super binaryInitializationMessagesFor: sourceMode. list add: ( MessageSend receiver: self selector: #deferredInitialize). ^list
</methods> <methods> Database.CTLibInterface class <category>private-accessing</category>
fetchBufferSize ^fetchBufferSize
fSqlTypeFromConversionMap ^fSqlTypeFromConversionMap
fSqlTypeToConversionMap ^fSqlTypeToConversionMap
fSqlTypeToServerTypeConversionMap ^fSqlTypeToServerTypeConversionMap
getSelectorMap ^getSelectorMap
putSelectorMap ^putSelectorMap
</methods> <methods> Database.CTLibInterface class <category>class initialization</category>
deferredInitialize "Used to initialize the class after file-in or BOSS-in." | ctlibBufferClass | self libraryLoaded: false. self initializeMaps. (ctlibBufferClass := self environment at: #CTLibBuffer ifAbsent: [ nil ]) notNil ifTrue: [ ctlibBufferClass install ]
initializeDefineCaches "This should only be done if the DLLCC development environment is present in the image." self fillDefineCaches. self fillDefineCaches "Do twice in case there are longer reference chains."
initializeMaps | xif | xif := self new. "Create the association tables for row buffer and bound parameter encoding... The getSelectorMap needs to have a message name understood by CTLibBuffer for each conversion. The putSelectorMap needs to have a message name understood by CTLibBuffer for each conversion. The fSqlTypeToConversionMap associates CTLibBuffer conversion names with the supported fSqlTypes. Note, several SQL types may map to the same conversion name. The fSqlTypeToServerTypeConversionMap associates the supported fSqlTypes with the Sybase server data types. The fetchBufferSize is the size of a buffer to be allocated to fetch data." getSelectorMap := IdentityDictionary new. putSelectorMap := IdentityDictionary new. fSqlTypeToConversionMap := IdentityDictionary new. fSqlTypeToServerTypeConversionMap := IdentityDictionary new. fSqlTypeFromConversionMap := IdentityDictionary new. fetchBufferSize := IdentityDictionary new. "Conversion from buffer for Integer." getSelectorMap add: ( #Integer -> #getIntegerAt: ). putSelectorMap add: ( #Integer -> #at:putInteger: ). fSqlTypeToConversionMap add: ( xif CS_TINYINT_TYPE -> #Integer ). fSqlTypeToConversionMap add: ( xif CS_SMALLINT_TYPE -> #Integer ). fSqlTypeToConversionMap add: ( xif CS_INT_TYPE -> #Integer ). fSqlTypeToServerTypeConversionMap add: ( xif CS_TINYINT_TYPE -> #tinyint ). fSqlTypeToServerTypeConversionMap add: ( xif CS_SMALLINT_TYPE -> #smallint ). fSqlTypeToServerTypeConversionMap add: ( xif CS_INT_TYPE -> #int ). fSqlTypeFromConversionMap add: ( #Integer -> xif CS_INT_TYPE ). fetchBufferSize add: ( #Integer -> [ :ignoredValue | 4 ] ). "Conversion to/from buffer for FixedPoint." getSelectorMap add: ( #FixedPoint -> #getFixedPointAt: ). putSelectorMap add: ( #FixedPoint -> #at:putFixedPoint: ). fSqlTypeToConversionMap add: ( xif CS_DECIMAL_TYPE -> #FixedPoint ). fSqlTypeToConversionMap add: ( xif CS_NUMERIC_TYPE -> #FixedPoint ). fSqlTypeToConversionMap add: ( xif CS_MONEY4_TYPE -> #FixedPoint ). fSqlTypeToConversionMap add: ( xif CS_MONEY_TYPE -> #FixedPoint ). fSqlTypeToServerTypeConversionMap add: ( xif CS_DECIMAL_TYPE -> #decimal ). fSqlTypeToServerTypeConversionMap add: ( xif CS_NUMERIC_TYPE -> #numeric ). fSqlTypeToServerTypeConversionMap add: ( xif CS_MONEY4_TYPE -> #smallmoney ). fSqlTypeToServerTypeConversionMap add: ( xif CS_MONEY_TYPE -> #money ). fSqlTypeFromConversionMap add: ( #FixedPoint -> xif CS_CHAR_TYPE ). fetchBufferSize add: ( #FixedPoint -> [ :ignoredValue | 38 ] ). "Conversion to/from buffer for Double." getSelectorMap add: ( #Double -> #getDoubleAt: ). putSelectorMap add: ( #Double -> #at:putDouble: ). fSqlTypeToConversionMap add: ( xif CS_FLOAT_TYPE -> #Double ). fSqlTypeFromConversionMap add: ( #Double -> xif CS_FLOAT_TYPE ). fetchBufferSize add: ( #Double -> [ :ignored | 8 ] ). "Conversion from buffer for Float." getSelectorMap add: ( #Float -> #getFloatAt: ). putSelectorMap add: ( #Float -> #at:putFloat: ). fSqlTypeToConversionMap add: ( xif CS_REAL_TYPE -> #Float ). fSqlTypeToServerTypeConversionMap add: ( xif CS_FLOAT_TYPE -> #float ). fSqlTypeFromConversionMap add: ( #Float -> xif CS_REAL_TYPE ). fetchBufferSize add: ( #Float -> [ :ignored | 4 ] ). "Conversion to/from buffer for Timestamp." getSelectorMap add: ( #Timestamp -> #getTimestampAt: ). putSelectorMap add: ( #Timestamp -> #at:putTimestamp: ). fSqlTypeToConversionMap add: ( xif CS_DATETIME4_TYPE -> #Timestamp ). fSqlTypeToConversionMap add: ( xif CS_DATETIME_TYPE -> #Timestamp ). fSqlTypeToServerTypeConversionMap add: ( xif CS_DATETIME4_TYPE -> #smalldatetime ). fSqlTypeToServerTypeConversionMap add: ( xif CS_DATETIME_TYPE -> #datetime ). fSqlTypeFromConversionMap add: ( #Timestamp -> xif CS_DATETIME_TYPE ). fetchBufferSize add: ( #Timestamp -> [ :ignoredValue | 8 ] ). "Conversion from buffer for String. In order to improve the chance that the buffer will hold alternate values without requiring the application to prepare the SQL again, the number of characters (and bytes to allocate) is guaranteed to be at least 256 In between that range, the size is rounded up to the next largest power of 2." getSelectorMap add: ( #String -> #getStringAt: ). putSelectorMap add: ( #String -> #at:putString: ). fSqlTypeToConversionMap add: ( xif CS_CHAR_TYPE -> #String ). fSqlTypeToConversionMap add: ( xif CS_VARCHAR_TYPE -> #String ). "not used" fSqlTypeToConversionMap add: ( xif CS_LONGCHAR_TYPE -> #String ). "not used" fSqlTypeToConversionMap add: ( xif CS_TEXT_TYPE -> #String ). fSqlTypeToServerTypeConversionMap add: ( xif CS_CHAR_TYPE -> #char ). fSqlTypeToServerTypeConversionMap add: ( xif CS_VARCHAR_TYPE -> #varchar ). "not used" fSqlTypeToServerTypeConversionMap add: ( xif CS_TEXT_TYPE -> #text ). fSqlTypeFromConversionMap add: ( #String -> xif CS_CHAR_TYPE ). fetchBufferSize add: ( #String -> [ :size | size + 1 ] ). "Leave room for a null." "Conversion from buffer for ByteArray. In order to improve the chance that the buffer will hold alternate values without requiring the application to prepare the SQL again, the number of characters (and bytes to allocate) is guaranteed to be at least 256. In between that range, the size is rounded up to the next largest power of 2." getSelectorMap add: ( #ByteArray -> #getByteArrayAt: ). putSelectorMap add: ( #ByteArray -> #at:putByteArray: ). fSqlTypeToConversionMap add: ( xif CS_BINARY_TYPE -> #ByteArray ). fSqlTypeToConversionMap add: ( xif CS_VARBINARY_TYPE -> #ByteArray ). fSqlTypeToConversionMap add: ( xif CS_IMAGE_TYPE -> #ByteArray ). fSqlTypeToServerTypeConversionMap add: ( xif CS_BINARY_TYPE -> #binary ). fSqlTypeToServerTypeConversionMap add: ( xif CS_VARBINARY_TYPE -> #varbinary ). fSqlTypeToServerTypeConversionMap add: ( xif CS_IMAGE_TYPE -> #image ). fSqlTypeFromConversionMap add: ( #ByteArray -> xif CS_BINARY_TYPE ). fetchBufferSize add: ( #ByteArray -> [ :size | size + 1 ] ). "Leave room for a null." "Conversion from buffer for Boolean." getSelectorMap add: ( #Boolean -> #getBooleanAt: ). putSelectorMap add: ( #Boolean -> #at:putBoolean: ). fSqlTypeToConversionMap add: ( xif CS_BIT_TYPE -> #Boolean ). fSqlTypeToServerTypeConversionMap add: ( xif CS_BIT_TYPE -> #bit ). fSqlTypeFromConversionMap add: ( #Boolean -> xif CS_BIT_TYPE ). fetchBufferSize add: ( #Boolean -> [ :ignoredValue | 1 ] )
</methods> <methods> Database.CTLibInterface class <category>parcel load/unload/save</category>
obsolete super obsolete. #{UISettings} isDefined ifTrue: [UISettings removePreferenceSection: #addSybaseSectionTo:development:runtime:]
postLoadFrom: aParcel "A Parcel's post-load method must be a class method taking one argument, the Parcel being loaded. Fill-out this template, accept and then select 'be post-load method' from the selector menu. Note that you can give the method whatever selector you want. You don't have to stay with postLoadFrom:. Note that all loaded classes are sent the message postLoad: after loading. The default implementation, ClassDescription>postLoad: runs the class's initialize method if it has one. One may override this method to add additional loading behavior. See also ClassDescription>preSave: which is intended to be used along with ClassDescription>postLoad: for managing class loading. The post-load method can then ignore class initialization and can instead concentrate on tasks such as opening windows, etc." self deferredInitialize. self allSubclassesDo: [:interfaceClass | interfaceClass deferredInitialize]. #{UISettings} isDefined ifTrue: [UISettings addPreferenceSection: #addSybaseSectionTo:development:runtime:]
</methods> <methods> Database.CTLibInterface class <category>accessing</category>
libraryLoaded ^libraryLoaded
libraryLoaded: aBoolean libraryLoaded := aBoolean.
</methods> <methods> Database.CTLibColumnDescription <category>private-accessing</category>
fSqlType: aSmallInteger "Set the receiver's CTLib SQL type." fSqlType := aSmallInteger
</methods> <methods> Database.CTLibColumnDescription <category>accessing</category>
fSqlType "Return the receiver's CTLib SQL type" ^fSqlType
</methods> <methods> Database.CTLibAOSFInterface <category>types</category>
CS_BINARY <C: typedef unsigned char CS_BINARY>
CS_BIT <C: typedef unsigned char CS_BIT>
CS_BOOL <C: typedef long CS_BOOL>
CS_BYTE <C: typedef unsigned char CS_BYTE>
CS_CHAR <C: typedef char CS_CHAR>
CS_CLIENTMSG <C: typedef struct _cs_clientmsg CS_CLIENTMSG>
CS_COMMAND <C: typedef struct _cscommand CS_COMMAND>
CS_CONNECTION <C: typedef struct _csconnection CS_CONNECTION>
CS_CONTEXT <C: typedef struct _cscontext CS_CONTEXT>
CS_CONV_FUNC <C: typedef CS_RETCODE (* CS_CONV_FUNC)(CS_CONTEXT * context, CS_DATAFMT * srcfmt, CS_VOID * src, CS_DATAFMT * destfmt, CS_VOID * dest, CS_INT * destlen)>
CS_DATAFMT <C: typedef struct _cs_datafmt CS_DATAFMT>
CS_DATETIME <C: typedef struct _cs_datetime CS_DATETIME>
CS_DATETIME4 <C: typedef struct _cs_datetime4 CS_DATETIME4>
CS_DECIMAL <C: typedef CS_NUMERIC CS_DECIMAL>
CS_FLOAT <C: typedef double CS_FLOAT>
CS_IMAGE <C: typedef unsigned char CS_IMAGE>
CS_INT <C: typedef int CS_INT>
CS_LOCALE <C: typedef struct _cslocale CS_LOCALE>
CS_LONG <C: typedef long CS_LONG>
CS_LONGBINARY <C: typedef unsigned char CS_LONGBINARY>
CS_LONGCHAR <C: typedef unsigned char CS_LONGCHAR>
CS_MONEY <C: typedef struct _cs_money CS_MONEY>
CS_MONEY4 <C: typedef struct _cs_money4 CS_MONEY4>
CS_MSGNUM <C: typedef long CS_MSGNUM>
CS_NUMERIC <C: typedef struct _cs_numeric CS_NUMERIC>
CS_REAL <C: typedef float CS_REAL>
CS_RETCODE <C: typedef long CS_RETCODE>
CS_SERVERMSG <C: typedef struct _cs_servermsg CS_SERVERMSG>
CS_SMALLINT <C: typedef short CS_SMALLINT>
CS_TEXT <C: typedef unsigned char CS_TEXT>
CS_THRDC_FUNC <C: typedef CS_RETCODE (* CS_THRDC_FUNC)(CS_THRDRES * * resource)>
CS_THRDE_FUNC <C: typedef CS_RETCODE (* CS_THRDE_FUNC)(CS_THRDRES * resource)>
CS_THRDID_FUNC <C: typedef CS_RETCODE (* CS_THRDID_FUNC)(CS_VOID * buffer, CS_INT buflen, CS_INT * outlen)>
CS_THRDM_FUNC <C: typedef CS_RETCODE (* CS_THRDM_FUNC)(CS_THRDRES * resource)>
CS_THRDRES <C: typedef void CS_THRDRES>
CS_THRDW_FUNC <C: typedef CS_RETCODE (* CS_THRDW_FUNC)(CS_THRDRES * resource, CS_INT millisecs)>
CS_THREAD <C: typedef struct _cs_thread CS_THREAD>
CS_TINYINT <C: typedef unsigned char CS_TINYINT>
CS_UINT <C: typedef unsigned long CS_UINT>
CS_USHORT <C: typedef unsigned short CS_USHORT>
CS_VARBINARY <C: typedef struct _cs_varybin CS_VARBINARY>
CS_VARCHAR <C: typedef struct _cs_varychar CS_VARCHAR>
CS_VOID <C: typedef void CS_VOID>
SQLCA <C: typedef struct _sqlca SQLCA>
</methods> <methods> Database.CTLibAOSFInterface <category>structs</category>
_cscommand <C: struct _cscommand>
_csconnection <C: struct _csconnection>
_cscontext <C: struct _cscontext>
_cslocale <C: struct _cslocale>
_cs_clientmsg <C: struct _cs_clientmsg { CS_INT severity; CS_MSGNUM msgnumber; CS_CHAR msgstring[1024]; CS_INT msgstringlen, osnumber; CS_CHAR osstring[1024]; CS_INT osstringlen, status; CS_BYTE sqlstate[8]; CS_INT sqlstatelen; }>
_cs_datafmt <C: struct _cs_datafmt { CS_CHAR name[132]; CS_INT namelen, datatype, format, maxlength, scale, precision, status, count, usertype; CS_LOCALE * locale; }>
_cs_datetime <C: struct _cs_datetime { CS_INT dtdays, dttime; }>
_cs_datetime4 <C: struct _cs_datetime4 { CS_USHORT days, minutes; }>
_cs_money <C: struct _cs_money { CS_INT mnyhigh; CS_UINT mnylow; }>
_cs_money4 <C: struct _cs_money4 { CS_INT mny4; }>
_cs_numeric <C: struct _cs_numeric { CS_BYTE precision, scale; CS_BYTE array[33]; }>
_cs_servermsg <C: struct _cs_servermsg { CS_MSGNUM msgnumber; CS_INT state, severity; CS_CHAR text[1024]; CS_INT textlen; CS_CHAR svrname[132]; CS_INT svrnlen; CS_CHAR proc[132]; CS_INT proclen, line, status; CS_BYTE sqlstate[8]; CS_INT sqlstatelen; }>
_cs_thread <C: struct _cs_thread { CS_THRDC_FUNC create_mutex_fn; CS_THRDM_FUNC delete_mutex_fn, take_mutex_fn, release_mutex_fn; CS_THRDC_FUNC create_event_fn; CS_THRDE_FUNC delete_event_fn, signal_event_fn, reset_event_fn; CS_THRDW_FUNC waitfor_event_fn; CS_THRDID_FUNC thread_id_fn; }>
_cs_varybin <C: struct _cs_varybin { CS_SMALLINT len; CS_BYTE array[256]; }>
_cs_varychar <C: struct _cs_varychar { CS_SMALLINT len; CS_CHAR str[256]; }>
_sqlca <C: struct _sqlca { char sqlcaid[8]; long sqlcabc, sqlcode; struct { long sqlerrml; char sqlerrmc[256]; } sqlerrm; char sqlerrp[8]; long sqlerrd[6]; char sqlwarn[8]; char sqlext[8]; }>
</methods> <methods> Database.CTLibAOSFInterface <category>types-extra</category>
clientMsgHandlerType <C: typedef CS_RETCODE ( __stdcall * clientMsgHandlerType) ( CS_CONTEXT * context, CS_CONNECTION * connection, CS_CLIENTMSG * msg )>
PTR <C: typedef void * PTR>
serverMsgHandlerType <C: typedef CS_RETCODE ( __stdcall * serverMsgHandlerType) ( CS_CONTEXT * context, CS_CONNECTION * connection, CS_SERVERMSG * msg )>
</methods> <methods> Database.CTLibAOSFInterface <category>defines</category>
CS_APPNAME <C: #define CS_APPNAME (CS_INT)9102 >
CS_BINARY_TYPE <C: #define CS_BINARY_TYPE (CS_INT)1 >
CS_BIT_TYPE <C: #define CS_BIT_TYPE (CS_INT)11 >
CS_CANBENULL <C: #define CS_CANBENULL (CS_INT)32 >
CS_CANCELED <C: #define CS_CANCELED (CS_RETCODE)(CS_EXTERNAL_ERR-2) >
CS_CANCEL_ALL <C: #define CS_CANCEL_ALL (CS_INT)6001 >
CS_CANCEL_ATTN <C: #define CS_CANCEL_ATTN (CS_INT)6002 >
CS_CANCEL_CURRENT <C: #define CS_CANCEL_CURRENT (CS_INT)6000 >
CS_CHAR_TYPE <C: #define CS_CHAR_TYPE (CS_INT)0 >
CS_CLIENTMSG_CB <C: #define CS_CLIENTMSG_CB (CS_INT)3 >
CS_CMD_DONE <C: #define CS_CMD_DONE (CS_INT)4046 >
CS_CMD_FAIL <C: #define CS_CMD_FAIL (CS_INT)4048 >
CS_CMD_SUCCEED <C: #define CS_CMD_SUCCEED (CS_INT)4047 >
CS_COMPUTEFMT_RESULT <C: #define CS_COMPUTEFMT_RESULT (CS_INT)4050 >
CS_COMPUTE_RESULT <C: #define CS_COMPUTE_RESULT (CS_INT)4045 >
CS_DATETIME4_TYPE <C: #define CS_DATETIME4_TYPE (CS_INT)13 >
CS_DATETIME_TYPE <C: #define CS_DATETIME_TYPE (CS_INT)12 >
CS_DECIMAL_TYPE <C: #define CS_DECIMAL_TYPE (CS_INT)17 >
CS_DESCRIBE_RESULT <C: #define CS_DESCRIBE_RESULT (CS_INT)4051 >
CS_EXTERNAL_ERR <C: #define CS_EXTERNAL_ERR (CS_RETCODE)(-200) >
CS_FAIL <C: #define CS_FAIL (CS_RETCODE)0 >
CS_FLOAT_TYPE <C: #define CS_FLOAT_TYPE (CS_INT)10 >
CS_FMT_UNUSED <C: #define CS_FMT_UNUSED (CS_INT)0x00 >
CS_FORCE_CLOSE <C: #define CS_FORCE_CLOSE (CS_INT)301 >
CS_FORCE_EXIT <C: #define CS_FORCE_EXIT (CS_INT)300 >
CS_HOSTNAME <C: #define CS_HOSTNAME (CS_INT)9103 >
CS_IFILE <C: #define CS_IFILE (CS_INT)9115 >
CS_IMAGE_TYPE <C: #define CS_IMAGE_TYPE (CS_INT)5 >
CS_INT_TYPE <C: #define CS_INT_TYPE (CS_INT)8 >
CS_LANG_CMD <C: #define CS_LANG_CMD (CS_INT)148 >
CS_LOGIN_TIMEOUT <C: #define CS_LOGIN_TIMEOUT (CS_INT)9116 >
CS_LONGCHAR_TYPE <C: #define CS_LONGCHAR_TYPE (CS_INT)2 >
CS_MONEY4_TYPE <C: #define CS_MONEY4_TYPE (CS_INT)15 >
CS_MONEY_TYPE <C: #define CS_MONEY_TYPE (CS_INT)14 >
CS_MSG_RESULT <C: #define CS_MSG_RESULT (CS_INT)4044 >
CS_NUMDATA <C: #define CS_NUMDATA (CS_INT)803 >
CS_NUMERIC_TYPE <C: #define CS_NUMERIC_TYPE (CS_INT)16 >
CS_OPT_TEXTSIZE <C: #define CS_OPT_TEXTSIZE (CS_INT)5002 >
CS_PARAM_RESULT <C: #define CS_PARAM_RESULT (CS_INT)4042 >
CS_PASSWORD <C: #define CS_PASSWORD (CS_INT)9101 >
CS_REAL_TYPE <C: #define CS_REAL_TYPE (CS_INT)9 >
CS_ROWFMT_RESULT <C: #define CS_ROWFMT_RESULT (CS_INT)4049 >
CS_ROW_COUNT <C: #define CS_ROW_COUNT (CS_INT)800 >
CS_ROW_FAIL <C: #define CS_ROW_FAIL (CS_RETCODE)(CS_EXTERNAL_ERR-3) >
CS_ROW_RESULT <C: #define CS_ROW_RESULT (CS_INT)4040 >
CS_SERVERMSG_CB <C: #define CS_SERVERMSG_CB (CS_INT)2 >
CS_SET <C: #define CS_SET (CS_INT)34 >
CS_SMALLINT_TYPE <C: #define CS_SMALLINT_TYPE (CS_INT)7 >
CS_STATUS_RESULT <C: #define CS_STATUS_RESULT (CS_INT)4043 >
CS_SUCCEED <C: #define CS_SUCCEED (CS_RETCODE)1 >
CS_TEXTLIMIT <C: #define CS_TEXTLIMIT (CS_INT)9112 >
CS_TEXT_TYPE <C: #define CS_TEXT_TYPE (CS_INT)4 >
CS_TINYINT_TYPE <C: #define CS_TINYINT_TYPE (CS_INT)6 >
CS_UNUSED <C: #define CS_UNUSED (CS_INT)(-99999) >
CS_USERNAME <C: #define CS_USERNAME (CS_INT)9100 >
CS_VARBINARY_TYPE <C: #define CS_VARBINARY_TYPE (CS_INT)19 >
CS_VARCHAR_TYPE <C: #define CS_VARCHAR_TYPE (CS_INT)18 >
CS_VERSION <C: #define CS_VERSION (CS_INT)9114 >
CS_VERSION_100 <C: #define CS_VERSION_100 (CS_INT)112 >
</methods> <methods> Database.CTLibLinuxInterface class <category>installation notes</category>
toInstall "To compile libsybase.so, change to the $SYBASE/lib directory and execute: #> ld -o libsybase.so -Bdynamic -G --whole-archive \ libct.a libcomn.a /lib/libc-2.0.7.so libintl.a \ libtcl.a libinsck.a libcs.a " ^self error: (#commentOnly << #sybaseDB >> 'Comment only')
</methods> <methods> Database.CTLibTransaction <category>private-library calls</category>
acquireExternal ^self
beginExternal ^self
commitExternal ^self
dismissExternal ^self
rollbackExternal ^self
</methods> <methods> Database.CTLibTransaction <category>private-finalization</category>
executor ^self shouldNotImplement
finalizeExternal ^self shouldNotImplement
key ^self shouldNotImplement
</methods> <methods> Database.CTLibTransaction class <category>accessing</category>
connectionClass "Answer the class to use for connection objects associated with receiver." ^CTLibConnection
</methods> <methods> Database.CTLibTransaction class <category>private-registry</category>
registry: aCollection ^self shouldNotImplement
</methods> <methods> Database.CTLibConnection <category>private-library calls</category>
acquireExternal: aPassword "Acquire the external resources involved with a connection" | uid pwd env env1 errs rc xif pEnv | self initializeExternal. self setInterfaceFileExternal. self setLoginTimeoutExternal. uid := self username. [ uid isString ] whileFalse: [ uid := self class requiredUsernameSignal raiseRequest ]. pwd := aPassword. [ pwd isString ] whileFalse: [ pwd := self class requiredPasswordSignal raiseRequest ]. (env := self environment) isNil ifTrue: [ env := self class defaultEnvironment ]. [ env isString ] whileFalse: [ env := self class requiredEnvironmentSignal raiseRequest ]. env := self class mapLogical: env. xif := self class xif. "set properties for connecting" self setPropsExternal: xif CS_USERNAME string: uid. self setPropsExternal: xif CS_PASSWORD string: pwd. self setPropsExternal: xif CS_HOSTNAME string: hostName. self setPropsExternal: xif CS_APPNAME string: appName. [ "Begin unwind protection (level 1)" [ "Begin unwind protection (level 2)" env1 := env asByteArrayEncoding: xif encoding. pEnv := env1 perform: xif copyToHeapSelector. rc := xif ct_connect: self conn with: pEnv with: env1 size. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_connect( conn='; nextPutAll: (self conn referentAddress printStringRadix: 16); nextPutAll: ', srv_name=', env; nextPutAll: ', snamelen='; print: env1 size; nextPutAll: ' )'. self class trace: self emitTrace ] "End unwind protection (level 1)" ] ensure: [ pEnv notNil ifTrue: [ pEnv freePointer ]. ( rc isNil or: [ rc == xif CS_SUCCEED ] ) ifFalse: [ errs := self class errorsOnQueue: self conn referentAddress. self class unableToConnectToSQLserverSignal raiseWith: errs errorString: errs first dbmsErrorString] ] "End unwind protection (level 2)" ] ifCurtailed: [ self dismissExternal ]
beginExternal "Mark the beginning of receivers portion of a transaction." "We need to make sure that the currently active session disconnects so that we can acquire the right to process the BEGIN TRANSACTION statement." super beginExternal. self participantsDo: [ :each | each disconnect ]. (self getSession) prepare: 'BEGIN TRANSACTION '; execute; answer; disconnect
commitExternal "Commit all changes made by receiver conn." "We need to make sure that the currently active session disconnects so that we can acquire the right to process the COMMIT TRANSACTION statement." super commitExternal ifFalse: [ ^self ]. self participantsDo: [ :each | each disconnect ]. (self getSession) prepare: 'COMMIT TRANSACTION'; execute; answer; disconnect
dismissConnExternal "Release the CTLib connection-related resources." | rc xif | ( self conn isNil or: [ self conn referentAddress isNil ] ) ifTrue: [ ^self conn: nil ]. "close the connection, drop the structure" xif := self class xif. rc := xif ct_close: self conn with: xif CS_FORCE_CLOSE. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_close( conn='; nextPutAll: (self conn referentAddress printStringRadix: 16); nextPutAll: ', opt=CS_FORCE_CLOSE )'. self class trace: self emitTrace ]. rc := xif ct_con_drop: self conn. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_con_drop( conn='; nextPutAll: (self conn referentAddress printStringRadix: 16); nextPutAll: ' )'. self class trace: self emitTrace ]. self class dismissQueue: self conn referentAddress. self conn: nil
dismissContextExternal "Release the CTLib context-related resources." | rc xif | ( self context isNil or: [ self context referentAddress isNil ] ) ifTrue: [ ^self context: nil ]. xif := self class xif. rc := xif ct_exit: self context with: xif CS_FORCE_EXIT. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_exit( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ' option=CS_FORCE_EXIT )'. self class trace: self emitTrace ]. rc := xif cs_ctx_drop: self context. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = cs_ctx_drop( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ' )'. self class trace: self emitTrace ]. self context: nil
dismissExternal "Release the external resources." "All activity within this method must function with only the instance variables defined in the executor object." self dismissConnExternal. self dismissContextExternal
initializeExternal "Allocate/initialize CTLib context, set callbacks, allocate CTLib connection." "Note: performance can be slightly improved by moving context and callbacks initialization to the class initialization. Doesn't look like a big gain." | rc xif pPointer | xif := self class xif. xif loadLibraries. self contextHolder: nil asValue. self connHolder: nil asValue. [ "Begin unwind protection" pPointer := xif PTR perform: xif mallocSelector with: 1. pPointer contents: nil. "allocate and initialize CTLib context" rc := xif cs_ctx_alloc: self csVersion with: pPointer. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_ctx_alloc( csVersion='; print: xif csVersion; nextPutAll: ', pPointer='; nextPutAll: (pPointer referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'context='; nextPutAll: (pPointer contents referentAddress printStringRadix: 16). self class trace: self emitTrace ]. self context: pPointer contents. rc := xif ct_init: self context with: self csVersion. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_init( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ', version='; print: xif csVersion; nextPutAll: ')'. self class trace: self emitTrace ]. "set callbacks for error processing" self setClientMsgHandlerCB. self setServerMsgHandlerCB. "allocate CTLib connection" pPointer contents: nil. rc := xif ct_con_alloc: self context with: pPointer. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_con_alloc( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ', pPointer='; nextPutAll: (pPointer referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'conn='; nextPutAll: (pPointer contents referentAddress printStringRadix: 16). self class trace: self emitTrace ]. self conn: pPointer contents. self class acquireQueue: self conn referentAddress. "End unwind protection." ] ensure: [ pPointer notNil ifTrue: [ pPointer freePointer ]. ( rc isNil or: [ rc ~= xif CS_SUCCEED ] ) ifTrue: [ self dismissExternal. "Usually this error occurs when either the Object Engine has not been linked with the CT-Library libraries (Unix), or the DLLs for those libraries cannot be found in the search path (Windows, OS/2, et al)." self class externalDatabaseLibraryInaccessibleSignal raise ] ]
installExternal "Perform return from snapshot processing for this conn." super installExternal. self conn: nil
rollbackExternal "Rollback all changes made by receiver's conn." "We need to make sure that the currently active session disconnects so that we can acquire the right to process the ROLLBACK TRANSACTION statement." super rollbackExternal ifFalse: [ ^self ]. self participantsDo: [ :each | each disconnect ]. (self getSession) prepare: 'ROLLBACK TRANSACTION'; execute; answer; disconnect
setClientMsgHandlerCB "define and set a callback for messages coming from the client" | rc xif | xif := self class xif. "define the callback" clientMsgHandlerCB := CCallback do: [ :context :conn :msg | "ignore warnings" (msg memberAt: #msgnumber) > 0 ifTrue: [ self class queue: conn newError: ( CTLibError new severity: (msg memberAt: #severity); dbmsErrorCode: (msg memberAt: #msgnumber); dbmsErrorString: ((msg memberAt: #msgstring) copyCStringFromHeap: xif encoding); osErrorCode: (msg memberAt: #osnumber); osErrorString: ((msg memberAt: #osstring) copyCStringFromHeap: xif encoding)) ]. xif CS_SUCCEED "return CS_SUCCEED" ] ofType: xif clientMsgHandlerType. "set the callback" rc := xif ct_callback: self context with: nil with: xif CS_SET with: xif CS_CLIENTMSG_CB with: clientMsgHandlerCB. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_callback( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ', NULL, CS_SET, CS_CLIENTMSG_CB, ..)'. self class trace: self emitTrace ]
setInterfaceFileExternal "Specify the path of the interfaces file that will be searched during subsequent calls to ct_connect()." | rc xif errs fileName pFileName | interfaceFileName isNil ifTrue: [ ^self ]. xif := self class xif. fileName := interfaceFileName asByteArrayEncoding: xif encoding. [ "Begin unwind protection (level 1)" [ "Begin unwind protection (level 2)" pFileName := fileName perform: xif copyToHeapSelector. rc := xif ct_config: self context with: xif CS_SET with: xif CS_IFILE with: pFileName with: fileName size with: nil. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_config( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ', action=CS_SET, property=CS_IFILE, fileName='; nextPutAll: interfaceFileName; nextPutAll: ', buflen='; print: fileName size; nextPutAll: ', outlen=NULL'. self class trace: self emitTrace ]. "End unwind protection (level 1)" ] ensure: [ pFileName notNil ifTrue: [ pFileName freePointer ]. ( rc isNil or: [ rc == xif CS_SUCCEED ] ) ifFalse: [ errs := self class errorsOnQueue: self conn referentAddress. self class externalDatabaseErrorSignal raiseWith: errs errorString: errs first dbmsErrorString ] ] "End unwind protection (level 2)" ] ifCurtailed: [ self dismissExternal ]
setLoginTimeoutExternal "Set the length of time in seconds that CT-Library will wait for a login response after calling ct_connect()." | rc errs xif pSeconds | loginTimeoutSeconds isNil ifTrue: [ ^self ]. xif := self class xif. [ "Begin unwind protection (level 1)" [ "Begin unwind protection (level 2)" pSeconds := xif CS_INT perform: xif mallocSelector with: 1. pSeconds contents: loginTimeoutSeconds. rc := xif ct_config: self context with: xif CS_SET with: xif CS_LOGIN_TIMEOUT with: pSeconds with: xif CS_UNUSED with: nil. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_config( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ', action=CS_SET, property=CS_LOGIN_TIMEOUT, seconds='; print: loginTimeoutSeconds; nextPutAll: ', buflen=CS_UNUSED, outlen=NULL'. self class trace: self emitTrace ]. "End unwind protection (level 1)" ] ensure: [ pSeconds notNil ifTrue: [ pSeconds freePointer ]. ( rc isNil or: [ rc == xif CS_SUCCEED ] ) ifFalse: [ errs := self class errorsOnQueue: self conn referentAddress. self class externalDatabaseErrorSignal raiseWith: errs errorString: errs first dbmsErrorString ] ] "End unwind protection (level 2)" ] ifCurtailed: [ self dismissExternal ]
setPropsExternal: property string: value "set a specified property for the connection structure" | rc xif value1 pValue errs | value isNil ifTrue: [ ^self ]. xif := self class xif. value1 := value asByteArrayEncoding: xif encoding. [ "Begin unwind protection (level 1)" [ "Begin unwind protection (level 2)" pValue := value1 perform: xif copyToHeapSelector. rc := xif ct_con_props: self conn with: xif CS_SET with: property with: pValue with: value1 size with: nil. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_con_props( conn='; nextPutAll: (self conn referentAddress printStringRadix: 16); nextPutAll: ', action=CS_SET, property='; print: property; nextPutAll: ', value='; nextPutAll: value; nextPutAll: ', length='; print: value1 size; nextPutAll: ', outlen=NULL)'. self class trace: self emitTrace ]. "End unwind protection (level 1)" ] ensure: [ pValue notNil ifTrue: [ pValue freePointer ]. ( rc isNil or: [ rc == xif CS_SUCCEED ] ) ifFalse: [ errs := self class errorsOnQueue: self conn referentAddress. self class externalDatabaseErrorSignal raiseWith: errs errorString: errs first dbmsErrorString ] ] "End unwind protection (level 2)" ] ifCurtailed: [ self dismissExternal ]
setServerMsgHandlerCB "define and set a callback for messages coming from the server" | rc xif | xif := self class xif. "define the callback" serverMsgHandlerCB := CCallback do: [ :context :conn :msg | "ignore warnings" (msg memberAt: #severity) > 10 ifTrue: [ self class queue: conn newError: ( CTLibError new dbmsErrorCode: (msg memberAt: #msgnumber); msgstate: (msg memberAt: #state); severity: (msg memberAt: #severity); dbmsErrorString: ((msg memberAt: #text) copyCStringFromHeap: xif encoding); srvname: ((msg memberAt: #svrname) copyCStringFromHeap: xif encoding); procname: ((msg memberAt: #proc) copyCStringFromHeap: xif encoding); line: (msg memberAt: #line) ) ]. xif CS_SUCCEED "return CS_SUCCEED" ] ofType: xif serverMsgHandlerType. "set the callback" rc := xif ct_callback: self context with: nil with: xif CS_SET with: xif CS_SERVERMSG_CB with: serverMsgHandlerCB. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_callback( context='; nextPutAll: (self context referentAddress printStringRadix: 16); nextPutAll: ', NULL, CS_SET, CS_SERVERMSG_CB, ..)'. self class trace: self emitTrace ]
</methods> <methods> Database.CTLibConnection <category>printing</category>
printOn: aStream super printOn: aStream. self conn notNil ifTrue: [ aStream nextPutAll: '( conn='; nextPutAll: ( self conn referentAddress printStringRadix: 16); nextPutAll: ' )' ]
</methods> <methods> Database.CTLibConnection <category>private-accessing</category>
conn "return pointer to CS_CONNECTION structure." ^self connHolder value
conn: aCPointer self connHolder value: aCPointer
connHolder "return connHolder" ^connHolder
connHolder: aValueHolder connHolder := aValueHolder
context "return pointer to CS_CONTEXT structure." ^self contextHolder value
context: aCPointer "Set the context pointer to the specified value." self contextHolder value: aCPointer
contextHolder ^contextHolder
contextHolder: aValueHolder contextHolder := aValueHolder
isolationLevel: newIsolationLevel "Set the current isolation level." newIsolationLevel == #RR ifFalse: [ExternalDatabaseConnection unsupportedIsolationLevelSignal raise]. isolationLevel := newIsolationLevel
</methods> <methods> Database.CTLibConnection <category>accessing</category>
appName "Answer the application-supplied name for itself." ^appName
appName: aString "Set the name of the application to use when communicating with Sybase. This is an optional parameter." appName := aString
csVersion csVersion isNil ifTrue: [ self csVersion: self class xif csVersion ]. ^csVersion
csVersion: anObject csVersion := anObject
hostName "Answer the application-supplied name for the client machine." ^hostName
hostName: aString "Set the name of the client machine to use when communicating with Sybase. This is an optional parameter." hostName := aString
setBehaviorToVersion125 self csVersion: self class xif CS_VERSION_125
setBehaviorToVersion15 self csVersion: self class xif CS_VERSION_150
</methods> <methods> Database.CTLibConnection <category>private-finalization</category>
executor | ex | ex := super executor. "Copy the CTLib specific fields." ex contextHolder: self contextHolder. ex connHolder: self connHolder. ^ex
finalizeExternal self context isNil ifTrue: [ ^self ]. self dismissExternal. super finalizeExternal
key "Key value to use when inserting receiver into a handle registry. This value needs to be unique within the registry." ^self connHolder
</methods> <methods> Database.CTLibConnection <category>control</category>
setInterfaceFile: fileName "Specify the name of the interfaces file that will be during subsequent calls to ct_connect()." interfaceFileName := fileName
setLoginTimeout: seconds "Set the length of time in seconds that CT-Library will wait for a login response after calling ct_connect()." loginTimeoutSeconds := seconds
setTextLimit: textLimit "Set the text limit and execute an empty query so that the values are propagated to the server." | pTextLimit rc err xif | xif := self class xif. [ "Begin unwind protection (level 1)" [ "Begin unwind protection (level 2)" pTextLimit := xif CS_INT perform: xif mallocSelector with: 1. pTextLimit contents: textLimit. rc := xif ct_con_props: self conn with: xif CS_SET with: xif CS_TEXTLIMIT with: pTextLimit with: xif CS_UNUSED with: nil. ( traceLevel >= 3 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_con_props( conn = '; nextPutAll: (self conn referentAddress printStringRadix: 16); nextPutAll: ', CS_SET, CS_TEXTLIMIT, '; nextPutAll: 'param='; nextPutAll: (pTextLimit referentAddress printStringRadix: 16); nextPutAll: ', CS_UNUSED, NULL )'. self class trace: self emitTrace ]. rc == xif CS_SUCCEED ifTrue: [ rc := xif ct_options: self conn with: xif CS_SET with: xif CS_OPT_TEXTSIZE with: pTextLimit with: xif CS_UNUSED with: nil. ( traceLevel >= 3 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_options( conn = '; nextPutAll: (self conn referentAddress printStringRadix: 16); nextPutAll: ', CS_SET, CS_OPT_TEXTSIZE, '; nextPutAll: 'param='; nextPutAll: (pTextLimit referentAddress printStringRadix: 16); nextPutAll: ', CS_UNUSED, NULL )'. self class trace: self emitTrace ] ] "End unwind protection (level 1)" ] ensure: [ pTextLimit == nil ifFalse: [ pTextLimit freePointer ]. ( rc isNil or: [ rc ~= xif CS_SUCCEED ] ) ifTrue: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class externalDatabaseErrorSignal raiseWith: err errorString: err first dbmsErrorString ] ] "End unwind protection (level 2)" ] ifCurtailed: [ self dismissExternal ]
</methods> <methods> Database.CTLibConnection <category>initialize-release</category>
initialize "Establish initial value for instance variables." super initialize. self csVersion: self class xif csVersion
</methods> <methods> Database.CTLibConnection class <category>private-error collecting</category>
acquireQueue: key "Create and answer a new queue associated with key." ^ErrorQueues at: key ifAbsent: [ ErrorQueues at: key put: OrderedCollection new ]
dismissQueue: key ErrorQueues removeKey: key ifAbsent: []
errorsOnQueue: key "Answer the collection (of CTLibError) for key." | queue | (queue := ErrorQueues at: key ifAbsent: [nil]) isNil ifTrue: [ ^nil ]. ErrorQueues at: key put: OrderedCollection new. ^queue
queue: conn newError: aCTLibError "Stick aCTLibError at the end of the queue of errors and messages waiting for the connection." | key queue | "The key is the address of the conn if one exists." key := conn notNil ifTrue: [ conn referentAddress ] ifFalse: [ 0 ]. "Get the queue. If one doesn't exist yet, use the 0 (connection not known yet) entry." queue := ErrorQueues at: key ifAbsent: [ self acquireQueue: 0 ]. queue add: aCTLibError. ( TraceLevel >= 2 ) ifTrue: [ self trace: aCTLibError printString ]
</methods> <methods> Database.CTLibConnection class <category>accessing</category>
bufferClass "Answer the buffer class for sessions" ^CTLibBuffer
columnDescriptionClass "Answer the class to use for column description objects associated with receiver." ^CTLibColumnDescription
connectionClass "Answer the class to use for connection objects associated with receiver." ^self
errorClass "Answer the class to use for error objects associated with receiver." ^CTLibError
kind "Answer a symbol representing the type of DMBS the receiver provides services for." ^#'SYBASE-CTLib'
serverEncoding "Answer what is believed to be the server's encoding. Answer #default if the server is the same as us." ^ServerEncoding
serverEncoding: encoding "Set what is believed to be the server's encoding." ServerEncoding := encoding
sessionClass "Answer the class to use for session objects associated with receiver." ^CTLibSession
transactionClass "Answer the class to use for transaction objects associated with receiver." ^CTLibTransaction
version ^(#CTLibversion << #sybaseDB >> 'Database Connect for CTLib - Release 5i.2') asString
</methods> <methods> Database.CTLibConnection class <category>private-accessing</category>
interfaceClass "Answer the correct interface class" | interfaceClassName | interfaceClassName := xifMap at: self platformType ifAbsent: [nil]. ^interfaceClassName notNil ifTrue: [ self environment at: interfaceClassName ifAbsent: [nil] ] ifFalse: [nil]
signalMap "Answer the signal map dictionary" ^signalMap
xif "Answer the ExternalInterface subclass instance in use." xif isNil ifTrue: [ self initializeCTLibInterface ]. ^xif
</methods> <methods> Database.CTLibConnection class <category>activation</category>
pause "Direct the suspension of all activity for the CTLib driver." ^self quiesce
resume "Direct the resumption of all suspended activity for the CTLib driver." self activate
</methods> <methods> Database.CTLibConnection class <category>private-registry</category>
registry "Answer with the registry." ^RegisteredCTLibConnections
registry: aCollection "Record aCollection as the registry." RegisteredCTLibConnections := aCollection
</methods> <methods> Database.CTLibConnection class <category>class initialization</category>
initialize "Make sure that the class variables are properly initialized." "CTLibConnection initialize" self serverEncoding: #default. self xif: nil. self initializeInterfaceMapping. ErrorQueues := Dictionary new. self initRegistry. signalMap := IdentityDictionary new. signalMap at: 208 put: #invalidTableNameSignal. signalMap at: 2601 put: #indexConflictSignal. signalMap at: 3701 put: #invalidTableNameSignal. self initializeExceptionClasses
initializeCTLibInterface "Reset CTLibInterface with the right interface class based on our platform." "This is a support method for the lazy initialization mechanism." | xifClass | xifClass := self interfaceClass. self xif: ( xifClass notNil ifTrue: [xifClass new] ifFalse: [nil] ). self xif isNil ifTrue: [ ^Dialog warn: (#incorrectDriverInstallation << #sybaseDB >> 'The CTLib Driver is not correctly installed.<n>Use the ExternalDatabaseInstallation tool to reinstall.') expandMacros ]
initializeExceptionClasses "Initialize related exception classes." UnableToOpenInterfacesFile notifierString: (#unableToOpenInterfacesFile << #sybaseDB >> 'Connection Exception--unable to open interfaces file'); nameClass: self message: #unableToOpenInterfacesFileSignal.
initializeInterfaceMapping xifMap := IdentityDictionary new. xifMap at: #aix_unix put: #CTLibAixInterface. xifMap at: #hp_unix put: #CTLibHPUXInterface. xifMap at: #sun5_unix put: #CTLibSolarisInterface. xifMap at: #sun4_unix put: #CTLibInterface. xifMap at: #linux_i386_unix put: #CTLibLinuxInterface. xifMap at: #alpha_unix put: #CTLibAOSFInterface. xifMap at: #win32s put: #CTLibWin16Interface. xifMap at: #nt put: #CTLibNTInterface. xifMap at: #win95 put: #CTLibNTInterface. xifMap at: #powermac put: #CTLibPowerMacInterface. xifMap at: #unknown put: #CTLibInterface.
</methods> <methods> Database.CTLibConnection class <category>signal constants</category>
unableToOpenInterfacesFileSignal "Answer the signal used to indicate that the connection cannot open the interfaces file." ^UnableToOpenInterfacesFile
</methods> <methods> Database.CTLibConnection class <category>private-activation</category>
install "This method can be inherrited, and will simply pass the install directive down the chain for those subclasses that need it." self subclasses do: [:each | each install]. "Execute initialization code just once, here." self == CTLibConnection ifTrue: [TraceLevel >= 1 ifTrue: [self trace: nil]. self xif: nil. ErrorQueues := Dictionary new. self returnFromSnapshot]
</methods> <methods> Database.CTLibConnection class <category>threading</category>
isThreaded ^false
</methods> <methods> Database.CTLibBuffer <category>private-data conversion</category>
at: index putBoolean: aBoolean "Set the buffer to hold an CTLib encoded bit." lengthsPointer at: (index-1) put: 1. aBoolean ifTrue: [ bufferPointer at: (index-1) put: 1 ] ifFalse: [ bufferPointer at: (index-1) put: 0 ]. ^aBoolean
at: index putByteArray: aByteArray "Put aByteArray into the buffer." | bytes | (bytes := aByteArray size) > elementSize ifTrue: [ self class connectionClass unableToBindSignal raise ]. bufferPointer copyAt: ((index-1) * elementSize) from: aByteArray size: bytes startingAt: 1. lengthsPointer at: (index-1) put: bytes. ^aByteArray
at: index putDouble: aDouble "Put aDouble into the buffer" | conversionBuffer | conversionBuffer := UninterpretedBytes new: 8. conversionBuffer doubleAt: 1 put: aDouble. bufferPointer copyAt: ((index-1) * elementSize) from: conversionBuffer size: 8 startingAt: 1. lengthsPointer at: (index-1) put: 8. ^aDouble
at: index putFixedPoint: aFixedPoint "Put aFixedPoint into the buffer." | strm str bytes | "Print an CTLib-compatible version of aFixedPoint on strm. This involves dropping the trailing f of Smalltalk literal syntax. FixedPoint's never use exponent notation on output so no need to worry about the exponentCharacter being embedded." strm := (String defaultPlatformClass new: 40) writeStream. aFixedPoint printOn: strm. strm skip: -1. str := strm contents. "Stick the result into the buffer." bufferPointer copyAt: ((index-1) * elementSize) from: str size: (bytes := str size) startingAt: 1. lengthsPointer at: (index-1) put: bytes. ^aFixedPoint
at: index putFloat: aFloat "Put aFloat into the buffer" | conversionBuffer | conversionBuffer := UninterpretedBytes new: 4. conversionBuffer floatAt: 1 put: aFloat. bufferPointer copyAt: ((index-1) * elementSize) from: conversionBuffer size: 4 startingAt: 1. lengthsPointer at: (index-1) put: 4. ^aFloat
at: index putInteger: anInteger "Put anInteger into the buffer" | conversionBuffer | conversionBuffer := UninterpretedBytes new: 4. conversionBuffer longAt: 1 put: anInteger. bufferPointer copyAt: ((index-1) * elementSize) from: conversionBuffer size: 4 startingAt: 1. lengthsPointer at: (index-1) put: 4. ^anInteger
at: index putString: aString "Put aString into the buffer." | str bytes | aString size > elementSize ifTrue: [ self class connectionClass unableToBindSignal raise ]. str := String defaultPlatformClass fromString: aString. bufferPointer copyAt: ((index-1) * elementSize) from: str size: (bytes := str size) startingAt: 1. lengthsPointer at: (index-1) put: bytes. ^aString
at: index putTimestamp: aTimestamp "Put aTimestamp into the buffer" "For performance reasons, the implementation of this method embeds knowledge of the structure of the CTLib typedef cs_datetime." "Date: CTLib is 1/1/1900 based, Smalltalk is 1/1/1901 based" "Time: CTLib is 1/300's of a second based, Smalltalk is seconds based" | conversionBuffer | conversionBuffer := UninterpretedBytes new: 8. conversionBuffer longAt: 1 put: (aTimestamp asDate asDays + 365). conversionBuffer unsignedShortAt: 5 put: ( (aTimestamp asTime asSeconds * 300) ). bufferPointer copyAt: ((index-1) * elementSize) from: conversionBuffer size: 8 startingAt: 1. lengthsPointer at: (index-1) put: 8. ^aTimestamp
getBooleanAt: index "Answer a Boolean as described in the first byte pointed to by the buffer." ^(bufferPointer at: ((index-1) * elementSize) ) ~= 0
getByteArrayAt: index "Answer a ByteArray populated from the buffer." | bytes ba | bytes := lengthsPointer at: (index-1). ba := ByteArray new: bytes. bufferPointer copyAt: ((index-1) * elementSize) to: ba size: bytes startingAt: 1. ^ba
getDoubleAt: index "Answer a Double populated from the buffer" "Assume: bufferPointer points to at least 8 bytes in the heap." | conversionBuffer | conversionBuffer := UninterpretedBytes new: 8. bufferPointer copyAt: ((index-1) * elementSize) to: conversionBuffer size: 8 startingAt: 1. ^conversionBuffer doubleAt: 1
getFixedPointAt: index "Answer a FixedPoint number populated from the buffer" | bytes str | bytes := lengthsPointer at: (index-1). str := String new: bytes. bufferPointer copyAt: ((index-1) * elementSize) to: str size: bytes startingAt: 1. ^FixedPoint readFrom: str readStream
getFloatAt: index "Answer a Float populated from the buffer" "Assume: bufferPointer points to at least 4 bytes in the heap." | conversionBuffer | conversionBuffer := UninterpretedBytes new: 4. bufferPointer copyAt: ((index-1) * elementSize) to: conversionBuffer size: 4 startingAt: 1. ^conversionBuffer floatAt: 1
getIntegerAt: index "Answer an Integer populated from the buffer." "Assume: bufferPointer points to at least 4 bytes in the heap." | conversionBuffer | conversionBuffer := UninterpretedBytes new: 4. bufferPointer copyAt: ((index-1) * elementSize) to: conversionBuffer size: 4 startingAt: 1. ^conversionBuffer longAt: 1
getStringAt: index "Answer a String populated from the buffer" | bytes str | bytes := lengthsPointer at: (index-1). str := String defaultPlatformClass new: bytes. bufferPointer copyAt: ((index-1) * elementSize) to: str size: bytes startingAt: 1. ^str
getTimestampAt: index "Answer a Timestamp populated from the buffer" "For performance reasons, the implementation of this method embeds knowledge of the structure of the CTLib typedef cs_datetime." "Date: CTLib is 1/1/1900 based, Smalltalk is 1/1/1901 based" "Time: CTLib is 1/300's of a second based, Smalltalk is seconds based" | conversionBuffer date time ts | conversionBuffer := UninterpretedBytes new: 8. bufferPointer copyAt: ((index-1) * elementSize) to: conversionBuffer size: 8 startingAt: 1. date := Date fromDays: (conversionBuffer longAt: 1) - 365. time := Time fromSeconds: (conversionBuffer longAt: 5) // 300. (ts := Timestamp new) fromDate: date andTime: time. ^ts
</methods> <methods> Database.CTLibBuffer <category>accessing</category>
at: anIndex "Answer the object in the buffer at anIndex." ^(indicatorsPointer at: (anIndex - 1)) == -1 ifTrue: [ ^nil ] ifFalse: [ self perform: getSelector with: anIndex ]
at: anIndex put: anObject "Store anObject into the buffer at anIndex." anObject isNil ifTrue: [ lengthsPointer contents: -1 "NULL_DATA" ] ifFalse: [ self perform: putSelector with: anIndex with: anObject ]. ^anObject
dataFmtPointer "Answer the receiver's pointer to the dataFmt structure." ^dataFmtPointer
fSqlType "Answer the CTLib data type for the data in this buffer." ^SQLTypeFromConversionMap at: databaseType
indicatorsPointer "Answer the receiver's pointer to the indicators." ^indicatorsPointer
lengthsPointer "Answer the receiver's pointer to the lengths." ^lengthsPointer
</methods> <methods> Database.CTLibBuffer <category>private</category>
getSelector ^getSelector
pointerType "Answer the pointer type to use for buffer allocation." | refType | refType := CIntegerType char. ^CArrayType defaultPointer referentType: refType; numElements: self elementSize.
putSelector ^putSelector
</methods> <methods> Database.CTLibBuffer <category>initialize-release</category>
elementSize: es count: aCount databaseType: dbType "Initialize an instance of receiver which is set up to hold values as described." super elementSize: es count: (aCount max: 1) databaseType: dbType. getSelector := GetSelectorMap at: databaseType ifAbsent: [nil]. putSelector := PutSelectorMap at: databaseType ifAbsent: [nil]
</methods> <methods> Database.CTLibBuffer <category>allocation</category>
free "Free resources held by the receiver." lengthsPointer notNil ifTrue: [ lengthsPointer freePointer. lengthsPointer := nil ]. indicatorsPointer notNil ifTrue: [ indicatorsPointer freePointer. indicatorsPointer := nil ]. dataFmtPointer notNil ifTrue: [ dataFmtPointer freePointer. dataFmtPointer := nil ]. super free
mallocUsing: mallocSelector "Allocate a physical buffer for the receiver. Use mallocSelector to perform the allocation." "Assume: the get and put methods will coerce the bufferPointer correctly." "Assert: mallocSelector is either #malloc: or #malloc16:" |success| success := false. [ "Begin unwind protection." super mallocUsingSelector: mallocSelector. lengthsPointer := self class connectionClass xif CS_INT perform: mallocSelector with: count. indicatorsPointer := self class connectionClass xif CS_SMALLINT perform: mallocSelector with: count. dataFmtPointer := self class connectionClass xif CS_DATAFMT perform: mallocSelector with: 1. success := true. "End unwind protection." ] ifCurtailed: [ self free ]. ^success
</methods> <methods> Database.CTLibBuffer class <category>accessing</category>
connectionClass "Answer the class to use for connection objects associated with receiver." ^CTLibConnection
</methods> <methods> Database.CTLibBuffer class <category>instance creation</category>
elementSize: es count: aCount databaseType: dbType "Create an instance of receiver which is set up to hold values as described." ^self new elementSize: es count: aCount databaseType: dbType
</methods> <methods> Database.CTLibBuffer class <category>class initialization</category>
initialize self install
</methods> <methods> Database.CTLibBuffer class <category>private-activation</category>
install | ifcClass | (ifcClass := self connectionClass interfaceClass) notNil ifTrue: [ GetSelectorMap := ifcClass getSelectorMap. PutSelectorMap := ifcClass putSelectorMap. SQLTypeFromConversionMap := ifcClass fSqlTypeFromConversionMap. FetchBufferSize := ifcClass fetchBufferSize ]
</methods> <methods> Database.CTLibBuffer class <category>fileIn/Out</category>
prerequisitesForLoading "CTLibBuffer requires CTLibConnection to have initialized its interface mapping before it initializes." ^super prerequisitesForLoading addLast: CTLibConnection; yourself
</methods> <methods> Database.CTLibAixInterface <category>types</category>
CS_BOOL <C: typedef int CS_BOOL>
CS_INT <C: typedef int CS_INT>
CS_RETCODE <C: typedef int CS_RETCODE>
CS_UINT <C: typedef unsigned int CS_UINT>
</methods> <methods> Database.CTLibError <category>private-accessing</category>
csLayer "Corresponds to the CS_LAYER(msgno) C-macro for the client messages" "#define CS_LAYER(L) (CS_MSGNUM)(((L )>>24)&255" ^(self msgno bitShift: -24) bitAnd: 255
csNumber "Corresponds to the CS_NUMBER(msgno) C-macro for the client messages" "#define CS_NUMBER(N) (CS_MSGNUM)((N )&255)" ^self msgno bitAnd: 255
csOrigin "Corresponds to the CS_ORIGIN(msgno) C-macro for the client messages" "#define CS_ORIGIN(O) (CS_MSGNUM)(((O )>>16)&255)" ^(self msgno bitShift: -16) bitAnd: 255
csSeverity "Corresponds to the CS_SEVERITY(msgno) C-macro for the client messages" "#define CS_SEVERITY(S) (CS_MSGNUM)(((S )>>8)&255)" ^(self msgno bitShift: -8) bitAnd: 255
line: aSmallInteger line := aSmallInteger
msgno: aSmallInteger dbmsErrorCode := aSmallInteger
msgstate: aSmallInteger msgstate := aSmallInteger
msgtext: aString dbmsErrorString := aString
procname: aString procname := aString
severity: aSmallInteger severity := aSmallInteger
srvname: aString srvname := aString
</methods> <methods> Database.CTLibError <category>accessing</category>
line "Answer the number of the command batch or stored procedure line that generated the message. Line numbers start at 1. The line number pertains to the nesting level at which the message was generated. This is only defined for CTLibError instances generated in response to server messages." ^line
msgno "Answer the current message's number. These numbers are documented in the SQL Server Reference Supplement." "This message is an alias for dbmsErroCode. Since the CTLibError object will hold either, but not both an error or a message, it saves allocating another variable." ^dbmsErrorCode
msgstate "Answer the current message's error state number. These numbers provide Sybase Technical Support with information about the context of the error." ^msgstate
msgtext "Answer the msgstring (client) or text (server) of the current message." "This message is an alias for dbmsErrorString. Since the CTLibError object will hold either, but not both, an error or a message, it saves allocating another variable." ^dbmsErrorString
procname "Answer the name of the stored procedure that generated the message. If the message was not generated by a stored procedure, the string will be empty. This is only defined for CTLibError instances generated in response to server messages." ^procname
severity "The current message's information class or error severity." "Note: there are two severities for the client messages: severity as a member of the cs_clientmsg structure and as the macro CS_SEVERITY(msgno); This severity corresponds to the first one." ^severity
srvname "Answer the name of the server that generated the message. If the server has no name, the string will be empty. This is only defined for CTLibError instances generated in response to server messages." ^srvname
</methods> <methods> Database.CTLibError <category>printing</category>
printOn: aStream super printOn: aStream. self msgstate notNil ifTrue: [ aStream nextPutAll: '( ** Server **'; crtab; tab; nextPutAll: 'Msgnumber: '; print: self msgno; crtab; tab; nextPutAll: 'Msgstate: '; print: self msgstate; crtab; tab; nextPutAll: 'Severity: '; print: self severity; crtab; tab; nextPutAll: 'Msgtext: '; nextPutAll: self msgtext; tab; tab; nextPutAll: 'Srvname: '; nextPutAll: self srvname; crtab; tab; nextPutAll: 'Procname: '; nextPutAll: self procname; crtab; tab; nextPutAll: 'Line: '; print: line; nextPutAll: ' )'; crtab ] ifFalse: [ aStream nextPutAll: '( ** Client ** '; crtab; tab; nextPutAll: 'CS_LAYER='; print: self csLayer; nextPutAll: ', CS_ORIGIN='; print: self csOrigin; nextPutAll: ', CS_SEVERITY='; print: self csSeverity; nextPutAll: ', CS_NUMBER='; print: self csNumber; crtab; tab; nextPutAll: 'Msgnumber: '; print: self msgno; crtab; tab; nextPutAll: 'Severity: '; print: self severity; crtab; tab; nextPutAll: 'Msgtext: '; nextPutAll: self msgtext; crtab; tab; nextPutAll: 'OS error: '; print: self osErrorCode; crtab; tab; nextPutAll: 'OS string: '; nextPutAll: self osErrorString; nextPutAll: ' )'; crtab ]
</methods> <methods> Database.CTLibSession <category>private-ObjectLens</category>
afterOrdinaryAnswerStreamFromCommand "Check to be sure that all results have been handled" | haveResults | self state == #validResults ifFalse: [ ^self ]. haveResults := true. [ haveResults ] whileTrue: [ [ haveResults := self moreResultsExternal ] ensure: [ self state: #prepared ] ]
bindInput: object template: template to: bindStream "Recursively flatten a template onto a bindStream" | class | ( object == nil ) ifTrue: [ ^self bindNil: template to: bindStream ]. ( template isInteger ) ifTrue: [ ^bindStream nextPut: object ]. class := template class. ( class == Object ) ifTrue: [ ^self ]. ( class == Float or: [ class == Double or: [ class == FixedPoint or: [ class == Timestamp or: [ object == true or: [ object == false or: [ (object isKindOf: CharacterArray) or: [ object isKindOf: ByteArray ] ] ] ] ] ] ] ) ifTrue: [ ^bindStream nextPut: object ]. "turn symbols into strings" (object isKindOf: ByteSymbol) ifTrue: [ ^bindStream nextPut: object asString ]. ( ( template isKindOf: Array ) or: [ template isKindOf: OrderedCollection ] ) ifTrue: [ 1 to: (object size) do: [ : index | self bindInput: (object at: index) template: (template at: index) to: bindStream ] ] ifFalse: [ "All others are treated as instances" 1 to: (object class instSize) do: [ : index | self bindInput: (object instVarAt: index) template: (template instVarAt: index) to: bindStream ] ].
bindNil: template to: bindStream "Recursively bind nil against a template." | class | template isNil ifTrue: [ ^bindStream nextPut: nil ]. template isInteger ifTrue: [ ^bindStream nextPut: nil ]. class := template class. class == Object ifTrue: [ ^self ]. ( class == Float or: [ class == Double or: [ class == FixedPoint or: [ class == Timestamp or: [ template == true or: [ template == false or: [ class == ByteFieldDescriptor or: [ (template isKindOf: CharacterArray) or: [ template isKindOf: ByteArray ] ] ] ] ] ] ] ]) ifTrue: [ ^bindStream nextPut: nil ]. "Recursively bind nil for Arrays, OrderedCollections, and other instances." ( ( template isKindOf: Array ) or: [ template isKindOf: OrderedCollection ] ) ifTrue: [ 1 to: (template size) do: [ :index | self bindNil: (template at: index) to: bindStream ] ] ifFalse: [ 1 to: (template class instSize) do: [ :index | self bindNil: (template instVarAt: index) to: bindStream ] ]
doCommand: command "Check to see if we can execute now. If so, invoke the super implementation to execute now. If not, complain." | executionStates | executionStates := #( #executing #ready #validResults #fetchingData ). "We can execute if we're already executing or if no other session for my connection is." (executionStates includes: self state) ifFalse: [ | conflict | "We don't already have the right to execute, ask permission." conflict := (connection participants detect: [ :s | s == 0 ifTrue: [ false ] ifFalse: [ executionStates includes: s state ] ] ifNone: [ nil ]). conflict isNil ifFalse: [ ^self class connectionClass tooManyActiveSessionsSignal raise ] ]. ^super doCommand: command
flattenResultTemplate: template onto: descStream "Recursively flatten an ObjectLens result template." | class desc | class := template class. "Instances of object in the template denote slots to ignore." ( class == Object ) ifTrue: [ ^self ]. ( template isInteger ) ifTrue: [ (desc := CTLibColumnDescription new) type: #Integer; maxColumnConstraint: 4. ^descStream nextPut: desc ]. class == Float ifTrue: [ (desc := CTLibColumnDescription new) type: #Float; maxColumnConstraint: 4. ^descStream nextPut: desc ]. class == Double ifTrue: [ (desc := CTLibColumnDescription new) type: #Double; maxColumnConstraint: 8. ^descStream nextPut: desc ]. class == FixedPoint ifTrue: [ (desc := CTLibColumnDescription new) type: #FixedPoint; maxColumnConstraint: 32. ^descStream nextPut: desc ]. (template == true or: [ template == false]) ifTrue: [ (desc := CTLibColumnDescription new) type: #Boolean; maxColumnConstraint: 1. ^descStream nextPut: desc ]. ( class == Timestamp ) ifTrue: [ (desc := CTLibColumnDescription new) type: #Timestamp; maxColumnConstraint: 8. ^descStream nextPut: desc ]. ( class == ByteFieldDescriptor ) ifTrue: [ | temp | (desc := CTLibColumnDescription new) maxColumnConstraint: template MaxColumnConstraint. temp := template Template. desc type: ( ( temp isString or: [ temp class == ByteSymbol ] ) ifTrue: [ #String ] ifFalse: [ #ByteArray ] ). ^descStream nextPut: desc ]. ( template isString ) ifTrue: [ (desc := CTLibColumnDescription new) type: #String; maxColumnConstraint: self textLimit. ^descStream nextPut: desc ]. "Decompose Arrays and Collections." ( ( template isKindOf: Array ) or: [ template isKindOf: OrderedCollection ] ) ifTrue: [ 1 to: template size do: [ :index | self flattenResultTemplate: (template at: index) onto: descStream ]. ^self ]. "All others are treated as instances of some entity" 1 to: template class instSize do: [ :index | self flattenResultTemplate: (template instVarAt: index) onto: descStream ].
nextViaTemplate: template "Answer the object formed by recursively reifying the template from fetched data." | class object | template == nil ifTrue: [ ^nil ]. ( template isInteger ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object isNil ifTrue: [ nil ] ifFalse: [ object asInteger ] ]. class := template class. ( class == Object ) ifTrue: [ ^nil ]. ( class == Float ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object isNil ifTrue: [ nil ] ifFalse: [ object asFloat ] ]. ( class == Double ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object isNil ifTrue: [ nil ] ifFalse: [ object asDouble ] ]. ( class == Timestamp or: [template == true or: [template == false or: [class == FixedPoint]]]) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object ]. ( class == ByteFieldDescriptor or: [ class == String ] ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object ]. ( template isKindOf: Collection ) ifTrue: [ ( template isKindOf: Array ) ifTrue: [ ^self nextViaArrayTemplate: template ] ifFalse: [ ^self nextViaCollectionTemplate: template ] ]. ^self nextViaEntityTemplate: template
</methods> <methods> Database.CTLibSession <category>private-accessing</category>
cmd ^cmdHolder value
cmd: aCPointerOrNil cmdHolder value: aCPointerOrNil
cmdHolder ^cmdHolder
cmdHolder: aValueHolder cmdHolder := aValueHolder
conn ^connection conn
currentRowIndex ^currentRowIndex
currentRowIndex: anInteger currentRowIndex := anInteger
fetchAbsoluteMode ^self class xif CS_ABSOLUTE
fetchNextMode ^self class xif CS_NEXT
fetchPriorMode ^self class xif CS_PREV
fetchRelativeMode ^self class xif CS_RELATIVE
ffetchPriorMode ^self class xif CS_PREV
returnStatus: anInteger returnStatus := anInteger
rowsInBlock "Answer number of rows fetched in current block." ^rowsInBlock
rowsInBlock: aSmallInteger "Record number of rows fetched in current block." rowsInBlock := aSmallInteger
</methods> <methods> Database.CTLibSession <category>private-execution</category>
acquireExternal "Acquire external resources." | xif pCmd rc errs | xif := self class xif. [ "Begin unwind protection" pCmd := xif PTR perform: xif mallocSelector with: 1. pCmd contents: nil. rc := xif ct_cmd_alloc: self conn with: pCmd. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_cmd_alloc( conn = '; nextPutAll: (self conn referentAddress printStringRadix: 16); nextPutAll: ', pCmd = '; nextPutAll: (pCmd referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'cmd='; nextPutAll: (pCmd contents referentAddress printStringRadix: 16). self class trace: self emitTrace ]. self cmd: pCmd contents. textLimit isNil ifTrue: [ textLimit := 32768 "default" ]. "End unwind protection" ] ensure: [ pCmd notNil ifTrue: [ pCmd freePointer ]. ( rc isNil or: [ rc == xif CS_FAIL ] ) ifTrue: [ self cmd: nil. errs := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass externalDatabaseErrorSignal raiseWith: errs errorString: errs first dbmsErrorString ] ]
cancelExternal "Cancel a command or results of a command" | xif rc | "Remove any prior return information." self releaseBuffersAndAdaptors. self returnStatus: nil. self cmd isNil ifTrue: [ ^self ]. xif := self class xif. rc := xif ct_cancel: nil with: self cmd with: xif CS_CANCEL_ALL. ( traceLevel >= 2 ) ifTrue: [ self traceStream print: rc; nextPutAll: ' = ct_cancel( nil, cmd='. self traceStream nextPutAll: (self cmd referentAddress printStringRadix: 16). self traceStream nextPutAll: ', type=CS_CANCEL_ALL )'. self class trace: self emitTrace ]. res_type := 0. (rc == xif CS_SUCCEED) ifFalse: [ self class connectionClass errorsOnQueue: self conn referentAddress ]. "Close cursor." (self useCursor and: [ self isCursorOpen ]) ifTrue: [ self closeCursorExternal ].
dismissExternal "Release the external resources." | xif rc | pRowsFetched == nil ifFalse: [ pRowsFetched freePointer. pRowsFetched := nil ]. self cmd isNil ifTrue: [ ^self ]. self cancelExternal. xif := self class xif. rc := xif ct_cmd_drop: self cmd. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: '= ct_cmd_drop( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ' )'. self class trace: self emitTrace ]. self cmd: nil. rc == xif CS_SUCCEED ifFalse: [ self class connectionClass errorsOnQueue: self conn referentAddress]
executeExternal "Execute the prepared SQL text." "Since the Sybase CT-Library does not support the notion of preparing SQL, the actual prepare is done here together with the execute." | rc err xif | xif := self class xif. "Send the assembled query batch to the server and start it executing." rc := xif ct_send: self cmd. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_send( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ' )'. self class trace: self emitTrace ]. (rc == xif CS_FAIL) ifTrue: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]
getResultsExternal "Get next set of results for an SQL statement and raise exceptions for any errors." | xif rc errs pRes signal | self aboutToAnswer. xif := self class xif. [ "Begin unwind protection." pRes := xif CS_INT perform: xif mallocSelector with: 1. rc := xif ct_results: self cmd with: pRes. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_results( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', pRes='; nextPutAll: (pRes referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'pRes contents= '; print: (pRes contents). self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifTrue: [ res_type := pRes contents ] ifFalse: [ res_type := 0 ]. "End unwind protection." ] ensure: [ pRes == nil ifFalse: [ pRes freePointer ] ]. (rc == xif CS_CANCELED) ifTrue: [ self releaseBuffersAndAdaptors ]. "results have been cancelled" ( rc == xif CS_FAIL or: [ rc == xif CS_SUCCEED and: [res_type == xif CS_CMD_FAIL] ] ) ifFalse: [ ^rc ]. "Report the error detected." errs := self class connectionClass errorsOnQueue: self conn referentAddress. ( errs isNil or: [ errs isEmpty ] ) ifTrue: [ signal := connection class unableToExecuteSQLSignal ] ifFalse: [ | error connClass | error := errs first. signal := (connClass := connection class) perform: (connClass signalMap at: error dbmsErrorCode ifAbsent: [ #unableToExecuteSQLSignal ]). ]. signal raiseWith: errs errorString: errs first dbmsErrorString. ^rc
getResultsInfoExternal: infoType "get information about the results, typically get number of columns or a number of affected rows" | xif rc pResInfo resInfo errs | xif := self class xif. [ "Begin unwind protection." pResInfo := xif CS_INT perform: xif mallocSelector with: 1. rc := xif ct_res_info: self cmd with: infoType with: pResInfo with: xif CS_UNUSED with: nil. resInfo := pResInfo contents. ( traceLevel >= 3 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_res_info( cmd = '; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', infoType='; print: infoType; nextPutAll: ', pResInfo='; nextPutAll: (pResInfo referentAddress printStringRadix: 16); nextPutAll: ', buflen=CS_UNUSED, outlen=NULL'; nextPutAll: ' )'; crtab; nextPutAll: 'result= '; print: resInfo. self class trace: self emitTrace ]. "End unwind protection." ] ensure: [ pResInfo == nil ifFalse: [ pResInfo freePointer ] ]. (rc == xif CS_SUCCEED) ifFalse: [ "Report the error detected." errs := self class connectionClass errorsOnQueue: self conn referentAddress. ^self class connectionClass externalDatabaseErrorSignal raiseWith: errs errorString: errs first dbmsErrorString. ]. ^resInfo
moreResultsExternal "Call getResultsExternal in a loop, ignoring those results which are not in interesting to us. Return true if we have results pending. Return false in case when have no results pending or in case of errors." | xif err rc | xif := self class xif. rowCount := 0. [ "repeat block" rc := self getResultsExternal. rc == xif CS_END_RESULTS ifTrue: "-205" [self cancelExternal. err := self class connectionClass errorsOnQueue: self conn referentAddress. (err size > 0) ifTrue: [^self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString]]. (rc == xif CS_SUCCEED) ifFalse: [^false]. "Get number of affected rows if it's available and cach it" ( res_type == xif CS_CMD_SUCCEED or: [ res_type == xif CS_CMD_DONE or: [ res_type == xif CS_CMD_FAIL ] ] ) ifTrue: [ rowCount := (self getResultsInfoExternal: xif CS_ROW_COUNT) ]. "Check the result type" "server encountered an error, no results available" (res_type == xif CS_CMD_FAIL) ifTrue: [self cancelExternal. err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString. ^false ]. "success of a statement that returns no data when not using a cursor)." (self useCursor not and: [res_type == xif CS_CMD_SUCCEED]) ifTrue: [ ^true ]. "fetchable results" ( res_type == xif CS_ROW_RESULT or: [ res_type == xif CS_COMPUTE_RESULT or: [ res_type == xif CS_CURSOR_RESULT or: [ res_type == xif CS_PARAM_RESULT ] ] ]) ifTrue: [ ^true ]. "status results for a stored procedure: retrive and store it" (res_type == xif CS_STATUS_RESULT) ifTrue: [ self getReturnStatusExternal ]. "other information available: for now, just ignore it" ( res_type == xif CS_ROWFMT_RESULT or: [ res_type == xif CS_COMPUTEFMT_RESULT or: [ res_type == xif CS_MSG_RESULT or: [ res_type == xif CS_DESCRIBE_RESULT ] ] ] ) ifTrue: [ ( traceLevel >= 2 ) ifTrue: [ (self traceStream) nextPutAll: 'Ignoring some informational results...'. self class trace: self emitTrace ] ]. ] repeat
readyExternal "For now, we are not using asynchrnous query execution." ^true
resultsExternal ^self moreResultsExternal
setTextLimitExternal "Set the text limit and execute an empty query so that the values are propagated to the server." connection setTextLimit: self textLimit. "Execute an empty query to force the setting to the server." self prepare: '/* SET TEXTLIMIT */'; execute; answer; answer
</methods> <methods> Database.CTLibSession <category>private-binding</category>
bindExternal "Sybase doesn't really have a prepare concept, so the query assembled here isn't sent to the server until we actually execute." | xif expandedQuery expandedQuery1 pExpandedQuery rc err | self useCursor ifTrue: [ ^self createCursorExternal ]. xif := self class xif. "Remove any prior return information." self returnStatus: nil. "Rebuild a query from the query fragments, expanding bind parameters in-line." queryFragments size == 1 ifTrue: [ expandedQuery := queryFragments at: 1 ] ifFalse: [ | queryStream | queryStream := WriteStream on: (String new: query size). queryStream nextPutAll: (queryFragments at: 1). 2 to: queryFragments size by: 2 do: [ :index | | bindOp value | bindOp := queryFragments at: index. (value := self inBindInputAt: bindOp) isNil ifTrue: [ queryStream nextPutAll: 'NULL' ] ifFalse: [ value printOnForCTLib: queryStream ]. queryStream nextPutAll: (queryFragments at: index + 1) ]. expandedQuery := queryStream contents ]. "Give the expanded query text to the CT-Library." [ "Begin unwind protection" expandedQuery1 := expandedQuery asByteArrayEncoding: xif encoding. pExpandedQuery := expandedQuery1 perform: xif copyToHeapSelector. rc := xif ct_command: self cmd with: xif CS_LANG_CMD with: pExpandedQuery with: expandedQuery1 size with: xif CS_UNUSED. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_command( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', query='; nextPutAll: expandedQuery; nextPutAll: ', buflen='; print: expandedQuery1 size; nextPutAll: ', option=CS_UNUSED)'. self class trace: self emitTrace ]. "End unwind protection" ] ensure: [ pExpandedQuery notNil ifTrue: [ pExpandedQuery freePointer ] ]. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]
bindExternal: aValue at: position "CTLib does not implement real binding." ^self shouldNotImplement
prepareExternal "The CT-Library does not really have a prepare concept." "The query text is not given to the CT-Library until ready to execute so that host variable references may be substituted into the query text."
</methods> <methods> Database.CTLibSession <category>private-finalization</category>
executor | ex | ex := super executor. ex cmdHolder: self cmdHolder. ex useCursor: self useCursor. ex scrollable: self scrollable. ^ex
finalizeExternal (self cmd isNil or: [self cmd referentAddress isNil]) ifTrue: [ ^self ]. ( traceLevel >= 1 ) ifTrue: [ self class trace: nil ]. super finalizeExternal
key "The cmdHolder is unique to the session and is constant across pause/resume." ^cmdHolder
</methods> <methods> Database.CTLibSession <category>accessing</category>
cursorName "Answer the cursor name associated with receiver." ^cursorName
cursorName: aString "Set the cursor name associated with receiver." cursorName := aString
getCursorName "Answer the cursor name associated with receiver." | xif rc curName pCursorName err | xif := self class xif. ["Begin unwind protection." pCursorName := xif CS_TEXT perform: xif mallocSelector with: xif CS_MAX_NAME. rc := xif ct_cmd_props: self cmd with: xif CS_GET with: xif CS_CUR_NAME with: pCursorName with: xif CS_MAX_NAME with: nil. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_cmd_props( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', action=CS_GET)'; nextPutAll: ', property=CS_CUR_NAME)'; nextPutAll: ', query='; nextPutAll: (pCursorName referentAddress printStringRadix: 16); nextPutAll: ', buflen=CS_MAX_NAME)'; nextPutAll: ', outlen=nil)'. self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]. curName := pCursorName copyCStringFromHeap. "End unwind protection" ] ensure: [ pCursorName notNil ifTrue: [ pCursorName freePointer ] ]. ^curName
getCursorStatus "Answer the cursor name associated with receiver." | xif rc curStatus pCursorStatus err | xif := self class xif. ["Begin unwind protection." pCursorStatus := xif CS_INT perform: xif mallocSelector with: 1. rc := xif ct_cmd_props: self cmd with: xif CS_GET with: xif CS_CUR_STATUS with: pCursorStatus with: xif CS_UNUSED with: nil. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_cmd_props( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', action=CS_GET)'; nextPutAll: ', property=CS_CUR_STATUS)'; nextPutAll: ', query='; nextPutAll: (pCursorStatus referentAddress printStringRadix: 16); nextPutAll: ', buflen=CS_MAX_NAME)'; nextPutAll: ', outlen=nil)'. self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]. curStatus := pCursorStatus contents. "End unwind protection" ] ensure: [ pCursorStatus notNil ifTrue: [ pCursorStatus freePointer ] ]. ^curStatus
isCursorOpen "Answer whether the cursor associated with the session is open." | xif updatableFlag | xif := self class xif. updatableFlag := xif CS_CURSTAT_OPEN. ^(self getCursorStatus bitAnd: updatableFlag) = updatableFlag
isCursorScrollable "Answer whether the cursor associated with the session is scrollable." | xif updatableFlag | xif := self class xif. updatableFlag := xif CS_CURSTAT_SCROLLABLE. ^(self getCursorStatus bitAnd: updatableFlag) = updatableFlag
isCursorUpdatable "Answer whether the cursor associated with the session is updatable." | xif updatableFlag | xif := self class xif. updatableFlag := xif CS_CURSTAT_UPDATABLE. ^(self getCursorStatus bitAnd: updatableFlag) = updatableFlag
returnStatus "Answer the status of the stored procedure. This will answer nil unless the command just executed was a stored procedure." ^returnStatus
scrollable: aBoolean "Determines whether the cursor is scrollable or not." aBoolean ifTrue: [ self hasScrollableCursorSupport ifTrue: [ self useCursor: true. scrollable := true. ] ifFalse: [ self connection class unsupportedCursorTypeSignal raiseRequest. scrollable := false. ]. ] ifFalse: [ self useCursor: true. scrollable := false. ].
textLimit "Answer the current setting of the text limit. A nil value indicates that the default limit should be used." ^textLimit
textLimit: anInteger "Set both CS_TEXTLIMIT for client and CS_OPT_TEXTSIZE for server. They define the largest text/image size to be returned on the connection. This method prepares and executes a query against the session." textLimit := anInteger. self setTextLimitExternal
useCursor ^useCursor
useCursor: anObject useCursor := anObject
</methods> <methods> Database.CTLibSession <category>private-answer set</category>
aboutToAnswer "Do last-minute work before fetching data from an answer set" totalRows := 0. rowsInBlock := self blockFactor. currentRowIndex := self blockFactor
advanceExternal "Advance to the next row in the block buffer. If the buffer is exhausted, refill it and continue." | xif | xif := self class xif. currentRowIndex := currentRowIndex + 1. (currentRowIndex > rowsInBlock) ifTrue: [ self scrollable ifTrue: [ self getBlockOfRowsExternal: xif CS_NEXT offset: xif CS_UNUSED ] ifFalse: [ self getBlockOfRowsExternal ]. (rowsInBlock <= 0) ifTrue: [ ^nil "No more rows will be found" ]. currentRowIndex := 1 ]. ^self
advanceExternal: fetchOrientation offset: fetchOffset "Advance to the next row in the block buffer. If the buffer is exhausted, refill it and continue." self scrollable ifFalse: [ self connection class unsupportedCursorTypeSignal raiseRequest. ^nil ]. fetchOrientation == self fetchNextMode ifTrue: [ self currentRowIndex: (self currentRowIndex + 1). ] ifFalse: [ fetchOrientation == self fetchPriorMode ifTrue: [ self currentRowIndex: (self currentRowIndex - 1). ] ifFalse: [ fetchOrientation == self fetchAbsoluteMode ifTrue: [ self currentRowIndex: (self blockFactor + 2). self rowsInBlock: (self blockFactor + 1). ] ifFalse: [ fetchOrientation == self fetchRelativeMode ifTrue: [ self currentRowIndex: (self currentRowIndex + fetchOffset). ]. ]. ]. ]. ((self currentRowIndex > self rowsInBlock) or: [ self currentRowIndex <= 0 ]) ifTrue: [ self getBlockOfRowsExternal: fetchOrientation offset: fetchOffset. self rowsInBlock <= 0 ifTrue: [ ^nil "No more rows will be found" ]. fetchOrientation == self fetchPriorMode ifTrue: [ self currentRowIndex: self rowsInBlock. ] ifFalse: [ self currentRowIndex: 1. ]. ]. ^self
allocateRowBufferExternal: aColumn "Allocate an CTLibBuffer to receive data for aColumn. Answer the buffer." | xif colDescr buffer rc err | xif := self class xif. colDescr := columnDescriptions at: aColumn. [ "Begin unwind protection." "Get a buffer, allocate space for it, and initialize" buffer := self class bufferClass elementSize: ( (xif class fetchBufferSize at: colDescr type) value: colDescr maxColumnConstraint ) count: self blockFactor databaseType: colDescr type. (buffer mallocUsing: xif mallocSelector) ifFalse: [ ^self class connectionClass unableToBindSignal raise ]. buffer dataFmtPointer memberAt: #datatype put: (xif class fSqlTypeFromConversionMap at: colDescr type). buffer dataFmtPointer memberAt: #format put: (xif CS_FMT_UNUSED). buffer dataFmtPointer memberAt: #maxlength put: ( (xif class fetchBufferSize at: colDescr type) value: colDescr maxColumnConstraint ). " clear scale and precision (malloc doesn't guarantee they are zero, which Sybase needs)" ((colDescr fSqlType == xif CS_MONEY_TYPE) or: [ colDescr fSqlType == xif CS_MONEY4_TYPE ]) ifTrue: [ buffer dataFmtPointer memberAt: #scale put: 4. buffer dataFmtPointer memberAt: #precision put: buffer elementSize ] ifFalse:[ buffer dataFmtPointer memberAt: #scale put: 0. buffer dataFmtPointer memberAt: #precision put: 0 ]. buffer dataFmtPointer memberAt: #count put: self blockFactor. buffer dataFmtPointer memberAt: #locale put: nil. rc := xif ct_bind: self cmd with: aColumn with: buffer dataFmtPointer with: buffer pointer with: buffer lengthsPointer with: buffer indicatorsPointer. ( traceLevel >= 3) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_bind( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', aColumn ='; print: aColumn; nextPutAll: ', dataFmtPointer ='; nextPutAll: (buffer dataFmtPointer referentAddress printStringRadix: 16); nextPutAll: ', buffer ='; nextPutAll: (buffer pointer referentAddress printStringRadix: 16); nextPutAll: ', lengthsPointer ='; nextPutAll: (buffer lengthsPointer referentAddress printStringRadix: 16); nextPutAll: ', indicatorsPointer ='; nextPutAll: (buffer indicatorsPointer referentAddress printStringRadix: 16); nextPutAll: ' )'; cr. self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ buffer free. err := self class connectionClass errorsOnQueue: self conn referentAddress. ^self class connectionClass unableToBindSignal raiseWith: err errorString: err first dbmsErrorString ]. "End unwind protection." ] ifCurtailed: [ buffer isNil ifFalse: [ buffer free. buffer := nil ] ]. ^buffer
cancelAnswerSetExternal "Cancel current answer set from the server." | xif stateTemp rc err | stateTemp := self state. ( stateTemp == #new or: [ stateTemp == #paused or: [ self cmd isNil ] ] ) ifTrue: [ ^self ]. xif := self class xif. "Interrupt the processing of only the current query." rc := xif ct_cancel: nil with: self cmd with: xif CS_CANCEL_CURRENT. ( traceLevel >= 2 ) ifTrue: [ self traceStream print: rc; nextPutAll: ' = ct_cancel( nil, cmd='. self traceStream nextPutAll: (self cmd referentAddress printStringRadix: 16). self traceStream nextPutAll: ', type=CS_CANCEL_CURRENT )'. self class trace: self emitTrace ]. res_type := 0. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass externalDatabaseErrorSignal raiseWith: err errorString: err first dbmsErrorString ]. (self useCursor and: [ self isCursorOpen ]) ifTrue: [ self closeCursorExternal ].
describeAnswerColumns "Fill in the columnDescriptions array." | xif descrs columnDescriptionClass rc colDesc pDataFmt | xif := self class xif. self numColumns: (self getResultsInfoExternal: xif CS_NUMDATA). descrs := Array new: self numColumns. columnDescriptionClass := self connection class columnDescriptionClass. [ "Begin unwind protection." pDataFmt := xif CS_DATAFMT perform: xif mallocSelector with: 1. 1 to: self numColumns do: [ :aColumn | rc := xif ct_describe: self cmd with: aColumn with: pDataFmt. ( traceLevel >= 3) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_describe( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', aColumn ='; print: aColumn; nextPutAll: ', pDataFmt ='; nextPutAll: (pDataFmt referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'name = '; nextPutAll: (pDataFmt memberAt: #name) copyCStringFromHeap; nextPutAll: ', namelen = '; print: (pDataFmt memberAt: #namelen); nextPutAll: ', datatype = '; print: (pDataFmt memberAt: #datatype); nextPutAll: ', maxlength = '; print: (pDataFmt memberAt: #maxlength); nextPutAll: ', scale = '; print: (pDataFmt memberAt: #scale); nextPutAll: ', precision ='; print: (pDataFmt memberAt: #precision); nextPutAll: ', status ='; print: (pDataFmt memberAt: #status). self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ | errs | errs := self class connectionClass errorsOnQueue: self conn referentAddress. ^self class connectionClass unableToDescribeSignal raiseWith: errs errorString: errs first dbmsErrorString ]. (colDesc := columnDescriptionClass new) index: aColumn; name: ( (pDataFmt memberAt: #namelen) == 0 ifTrue: [ '' ] ifFalse: [(pDataFmt memberAt: #name) copyCStringFromHeap] ); fSqlType: (pDataFmt memberAt: #datatype); type: (xif class fSqlTypeToConversionMap at: colDesc fSqlType); maxColumnConstraint: (pDataFmt memberAt: #maxlength); scale: (pDataFmt memberAt: #scale); precision: (pDataFmt memberAt: #precision); nullable: ( ((pDataFmt memberAt: #status) bitAnd: xif CS_CANBENULL) ~= 0 ). descrs at: aColumn put: colDesc ] "End unwind protection." ] ensure: [ pDataFmt notNil ifTrue: [ pDataFmt freePointer ] ]. self columnDescriptions: descrs
getBlockOfRowsExternal "Fetch the next block of rows into the memory allocated for this purpose." | xif rc err | xif := self class xif. ( pRowsFetched isNil ) ifTrue: [ pRowsFetched := xif CS_INT perform: xif mallocSelector with: 1 ]. pRowsFetched contents: 0. rc := xif ct_fetch: self cmd with: xif CS_UNUSED with: xif CS_UNUSED with: xif CS_UNUSED with: pRowsFetched. ( traceLevel >= 3 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_fetch( cmd = '; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', type=CS_UNUSED, offset=CS_UNUSED, option=CS_UNUSED, ptr_rows_read='; nextPutAll: (pRowsFetched referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'rows_read='; print: pRowsFetched contents. self class trace: self emitTrace ]. rowsInBlock := pRowsFetched contents. ( (rc == xif CS_ROW_FAIL) or: [rc == xif CS_FAIL] ) ifTrue: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToFetchDataSignal raiseWith: err errorString: err first dbmsErrorString. ^self ]. totalRows := totalRows + rowsInBlock
getBlockOfRowsExternal: fetchOrientation offset: fetchOffset "Fetch the next block of rows into the memory allocated for this purpose." | xif rc err newFetchMode newOffset | fetchOrientation == self fetchPriorMode ifTrue: [ newFetchMode := self fetchRelativeMode. newOffset := self currentRowIndex- self blockFactor. ] ifFalse: [ fetchOrientation == self fetchRelativeMode ifTrue: [ newFetchMode := fetchOrientation. self currentRowIndex: (self currentRowIndex - fetchOffset). newOffset := fetchOffset + self currentRowIndex - 1. ] ifFalse: [ newFetchMode := fetchOrientation. newOffset := fetchOffset. ]. ]. xif := self class xif. ( pRowsFetched isNil ) ifTrue: [ pRowsFetched := xif CS_INT perform: xif mallocSelector with: 1 ]. pRowsFetched contents: 0. rc := xif ct_scroll_fetch: self cmd with: newFetchMode with: newOffset with: xif CS_TRUE with: pRowsFetched. ( traceLevel >= 3 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_scroll_fetch( cmd = '; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', type = '; print: newFetchMode; nextPutAll: ', offset = '; print: newOffset; nextPutAll: ', option=CS_TRUE, ptr_rows_read='; nextPutAll: (pRowsFetched referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'rows_read='; print: pRowsFetched contents. self class trace: self emitTrace ]. rowsInBlock := pRowsFetched contents. ( (rc == xif CS_ROW_FAIL) or: [rc == xif CS_FAIL] ) ifTrue: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToFetchDataSignal raiseWith: err errorString: err first dbmsErrorString. ^self ]. ( (rc == xif CS_CURSOR_BEFORE_FIRST) or: [rc == xif CS_CURSOR_AFTER_LAST] ) ifTrue: [ rc := xif ct_scroll_fetch: self cmd with: xif CS_UNUSED with: xif CS_UNUSED with: xif CS_FALSE with: pRowsFetched. ( traceLevel >= 3 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_scroll_fetch( cmd = '; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', type = '; print: fetchOrientation; nextPutAll: ', offset = '; print: fetchOffset; nextPutAll: ', option=CS_TRUE, ptr_rows_read='; nextPutAll: (pRowsFetched referentAddress printStringRadix: 16); nextPutAll: ' )'; crtab; nextPutAll: 'rows_read='; print: pRowsFetched contents. self class trace: self emitTrace ]. ( rc == xif CS_SCROLL_CURSOR_ENDS ) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToFetchDataSignal raiseWith: err errorString: err first dbmsErrorString. ^self ]. ].
getColumnDescriptionExternal: aColumn "Folded into describeAnswerColumns for efficiency." ^self shouldNotImplement
getFieldExternal: aColumn "Answer the data for the aColumn-th column in the current row." | buffer rowIndex | buffer := (self rowBuffers) at: aColumn. rowIndex := (currentRowIndex - 1) \\ self blockFactor. ^buffer at: (rowIndex + 1)
getReturnStatusExternal "Get return status after a stored procedure is been executed. Fetch it in the same manner as we fetch regular rows." | xif err buf descrs colDesc | xif := self class xif. "allocate buffer to fetch the return status" self numColumns: 1. descrs := Array new: 1. (colDesc := self connection class columnDescriptionClass new) index: 1; name: ''; fSqlType: xif CS_INT_TYPE; type: #Integer; maxColumnConstraint: 4; scale: 0; precision: 0; nullable: false. descrs at: 1 put: colDesc. self columnDescriptions: descrs. buf := self allocateRowBufferExternal: 1. " begin ensure block to free buffer properly " [ self getBlockOfRowsExternal. self returnStatus: (buf at: 1). "Clear columnDescriptions for next read" self columnDescriptions: nil. self numColumns: nil. "need one extra read as required by CT-Lib" self getBlockOfRowsExternal. ( traceLevel >= 2 ) ifTrue: [ (self traceStream) nextPutAll: 'returnStatus = '; print: self returnStatus. self class trace: self emitTrace ]. "Check if stored procedure executed successfully." self returnStatus < 0 ifTrue: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]] ensure:[ buf isNil ifFalse: [ buf free]].
hasAnswerSetExternal "If the query resulted in an answer set, answer true; else answer false." | xif | xif := self class xif. ( res_type == xif CS_ROW_RESULT or: [ res_type == xif CS_CURSOR_RESULT or: [ res_type == xif CS_COMPUTE_RESULT or: [ res_type == xif CS_PARAM_RESULT ] ] ]) ifTrue: [ ^true ]. ^false
nextRowExternal "Answer the next row from the answer stream" ( self advanceExternal == nil ) ifTrue: [ "We've exhausted the answer set. No DBMS cancel is necessary." self state: #validResults. ^nil ]. "If we have a resultTemplate, use it to provide the answer." ( resultTemplate == nil ) ifFalse: [ bufferIndex := 1. ^self nextViaTemplate: resultTemplate ]. allocateForEachRow ifTrue: [ currentRow := currentRow copy ]. 1 to: (self columnDescriptions size) do: [ :index | (rowAdaptors at: index) value: currentRow value: (self getFieldExternal: index) ]. ^currentRow
releaseBuffers "Release buffers and their associated resources." | rbs | (rbs := self rowBuffers) notNil ifTrue: [1 to: rbs size do: [:i | (rbs at: i) notNil ifTrue: [(rbs at: i) free]. rbs at: i put: nil]]. "added for checking" super releaseBuffers
</methods> <methods> Database.CTLibSession <category>data processing</category>
rowCount "Answer the count of rows that Sybase claims was affected by this query." ^rowCount
</methods> <methods> Database.CTLibSession <category>private-cursor</category>
closeCursorExternal "Sybase doesn't really have a prepare concept, so the query assembled here isn't sent to the server until we actually execute." | xif rc err | xif := self class xif. "Give the expanded query text to the CT-Library." rc := xif ct_cursor: self cmd with: xif CS_CURSOR_CLOSE with: nil with: xif CS_UNUSED with: nil with: xif CS_UNUSED with: xif CS_DEALLOC. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_cursor( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', type=CS_CURSOR_CLOSE)'; nextPutAll: ', name=NULL'; nextPutAll: ', namelen=CS_UNUSED'; nextPutAll: ', query=NULL'; nextPutAll: ', buflen=CS_UNUSED'; nextPutAll: ', option=CS_DEALLOC)'. self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]. self executeExternal. self resultsExternal
createCursorExternal "Sybase doesn't really have a prepare concept, so the query assembled here isn't sent to the server until we actually execute." | xif expandedQuery expandedQuery1 pExpandedQuery rc err curName cursorType | xif := self class xif. "Remove any prior return information." self returnStatus: nil. "Rebuild a query from the query fragments, expanding bind parameters in-line." queryFragments size == 1 ifTrue: [ expandedQuery := queryFragments at: 1 ] ifFalse: [ | queryStream | queryStream := WriteStream on: (String new: query size). queryStream nextPutAll: (queryFragments at: 1). 2 to: queryFragments size by: 2 do: [ :index | | bindOp value | bindOp := queryFragments at: index. (value := self inBindInputAt: bindOp) isNil ifTrue: [ queryStream nextPutAll: 'NULL' ] ifFalse: [ value printOnForCTLib: queryStream ]. queryStream nextPutAll: (queryFragments at: index + 1) ]. expandedQuery := queryStream contents ]. self scrollable ifTrue: [ cursorType := xif CS_SCROLL_CURSOR ] ifFalse: [ cursorType := xif CS_FOR_UPDATE ]. (curName := self cursorName) isNil ifTrue: [ curName := 'Cursor', (self cmd referentAddress printStringRadix: 16). self cursorName: curName. ]. "Give the expanded query text to the CT-Library." [ "Begin unwind protection" expandedQuery1 := expandedQuery asByteArrayEncoding: xif encoding. pExpandedQuery := expandedQuery1 perform: xif copyToHeapSelector. rc := xif ct_cursor: self cmd with: xif CS_CURSOR_DECLARE with: curName with: curName size with: pExpandedQuery with: expandedQuery1 size with: cursorType. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_cursor( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', type=CS_CURSOR_DECLARE)'; nextPutAll: ', name='; nextPutAll: cursorName; nextPutAll: ', namelen='; print: cursorName size; nextPutAll: ', query='; nextPutAll: expandedQuery; nextPutAll: ', buflen='; print: expandedQuery1 size; nextPutAll: ', option=)'; print: cursorType; nextPutAll: ' )'; cr. self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]. rc := xif ct_cursor: self cmd with: xif CS_CURSOR_ROWS with: nil with: xif CS_UNUSED with: nil with: xif CS_UNUSED with: self blockFactor. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_cursor( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', type=CS_CURSOR_ROWS)'; nextPutAll: ', name=NULL'; nextPutAll: ', namelen=CS_UNUSED'; nextPutAll: ', query=NULL'; nextPutAll: ', buflen=CS_UNUSED'; nextPutAll: ', option=)'; print: self blockFactor; nextPutAll: ' )'; cr. self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]. rc := xif ct_cursor: self cmd with: xif CS_CURSOR_OPEN with: nil with: xif CS_UNUSED with: nil with: xif CS_UNUSED with: xif CS_UNUSED. ( traceLevel >= 1 ) ifTrue: [ (self traceStream) print: rc; nextPutAll: ' = ct_cursor( cmd='; nextPutAll: (self cmd referentAddress printStringRadix: 16); nextPutAll: ', type=CS_CURSOR_OPEN)'; nextPutAll: ', name=NULL'; nextPutAll: ', namelen=CS_UNUSED'; nextPutAll: ', query=NULL'; nextPutAll: ', buflen=CS_UNUSED'; nextPutAll: ', option=CS_UNUSED)'. self class trace: self emitTrace ]. (rc == xif CS_SUCCEED) ifFalse: [ err := self class connectionClass errorsOnQueue: self conn referentAddress. self class connectionClass unableToExecuteSQLSignal raiseWith: err errorString: err first dbmsErrorString ]. "End unwind protection" ] ensure: [ pExpandedQuery notNil ifTrue: [ pExpandedQuery freePointer ] ].
</methods> <methods> Database.CTLibSession <category>private-testing</category>
hasScrollableCursorSupport "Answer true is the loaded OCI has scrollable cursor support." | xifClass testMethod aHandle resultHandle | xifClass := self class xif class. testMethod := CTLibInterface compiledMethodAt:#ct_scroll_fetch:with:with:with:with:. resultHandle := xifClass instanceBehavior libraryFiles detect: [:aLibrary | aHandle := testMethod class mapAddressFor: testMethod library: aLibrary. aHandle notNil] ifNone: [ aHandle := testMethod class mapStaticFor: testMethod ]. resultHandle isNil ifTrue: [ ^false ] ifFalse: [ ^true ]
</methods> <methods> Database.CTLibSession <category>initialize-release</category>
initialize super initialize. cmdHolder := nil asValue. self useCursor: false
</methods> <methods> Database.CTLibSession class <category>accessing</category>
bufferClass "Answer the class to use for bindInput/Output objects associated with receiver." ^CTLibBuffer
connectionClass "Answer the class to use for connection objects associated with receiver." ^CTLibConnection
</methods> <methods> Database.CTLibSession class <category>class initialization</category>
initialize "CTLibSession initialize" self initRegistry
</methods> <methods> Database.CTLibSession class <category>private-registry</category>
registry "Answer with the registry." ^RegisteredCTLibSessions
registry: aCollection "Record aCollection as the registry." RegisteredCTLibSessions := aCollection
</methods> <methods> Database.CTLibWin16Interface <category>types</category>
CS_CHAR <C: typedef void * CS_CHAR>
CS_CLIENTMSG <C: typedef void * CS_CLIENTMSG>
CS_COMMAND <C: typedef void * CS_COMMAND>
CS_CONNECTION <C: typedef void * CS_CONNECTION>
CS_CONTEXT <C: typedef void * CS_CONTEXT>
CS_CONV_FUNC <C: typedef CS_RETCODE ( _pascal _far * CS_CONV_FUNC)(CS_CONTEXT _far * context, CS_DATAFMT _far * srcfmt, CS_VOID _far * src, CS_DATAFMT _far * destfmt, CS_VOID _far * dest, CS_INT _far * destlen)>
CS_DATAFMT <C: typedef void * CS_DATAFMT>
CS_INT <C: typedef void * CS_INT>
CS_LOCALE <C: typedef void * CS_LOCALE>
CS_RETCODE <C: typedef void * CS_RETCODE>
CS_SERVERMSG <C: typedef void * CS_SERVERMSG>
CS_SMALLINT <C: typedef void * CS_SMALLINT>
CS_THRDC_FUNC <C: typedef CS_RETCODE ( _pascal _far * CS_THRDC_FUNC)(CS_THRDRES _far * _far * resource)>
CS_THRDE_FUNC <C: typedef CS_RETCODE ( _pascal _far * CS_THRDE_FUNC)(CS_THRDRES _far * resource)>
CS_THRDID_FUNC <C: typedef CS_RETCODE ( _pascal _far * CS_THRDID_FUNC)(CS_VOID _far * buffer, CS_INT buflen, CS_INT _far * outlen)>
CS_THRDM_FUNC <C: typedef CS_RETCODE ( _pascal _far * CS_THRDM_FUNC)(CS_THRDRES _far * resource)>
CS_THRDRES <C: typedef void * CS_THRDRES>
CS_THRDW_FUNC <C: typedef CS_RETCODE ( _pascal _far * CS_THRDW_FUNC)(CS_THRDRES _far * resource, CS_INT millisecs)>
CS_VOID <C: typedef void * CS_VOID>
</methods> <methods> Database.CTLibWin16Interface <category>types-extra</category>
clientMsgHandlerType <C: typedef int (_pascal _far * clientMsgHandlerType) ( CS_CONTEXT _far * context, CS_CONNECTION _far * connection, CS_CLIENTMSG _far * msg )>
PTR <C: typedef void _far * PTR>
serverMsgHandlerType <C: typedef int (_pascal _far * serverMsgHandlerType) ( CS_CONTEXT _far * context, CS_CONNECTION _far * connection, CS_SERVERMSG _far * msg )>
</methods> <methods> Database.CTLibWin16Interface <category>structs</category>
_cs_datafmt <C: struct _cs_datafmt { CS_CHAR name[132]; CS_INT namelen, datatype, format, maxlength, scale, precision, status, count, usertype; CS_LOCALE _far * locale; }>
</methods> <methods> Database.CTLibWin16Interface <category>accessing</category>
copyToHeapSelector ^#copyToHeap16
mallocSelector ^#malloc16:
</methods> <methods> Core.String <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." self printOn: aStream
</methods> <methods> Core.Character <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." aStream nextPut: self
</methods> <methods> Core.FixedPoint <category>private-ctlib</category>
printOnForCTLib: aStream "Print a CTLib-compatible version of the receiver on aStream. This involves dropping the trailing s from the literal syntax." aStream print: self. aStream skip: -1 "FixedPoint's never use exponent notation on output so no need to worry about the exponentCharacter being embedded."
</methods> <methods> Core.ByteArray <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." aStream nextPutAll: '0x'. 1 to: self size do: [ :index | | byte | byte := self at: index. byte < 16 ifTrue: [ aStream nextPut: $0 ]. byte printOn: aStream base: 16 ]
</methods> <methods> Core.SequenceableCollection <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." "Date and Time is represented as a sequenceable collection of size 2 with the date first and the time second." | date time | (self size == 2 and: [ (date := self at: 1) class == Date and: [(time := self at: 2) class == Time ] ]) ifTrue: [ (Timestamp fromDate: date andTime: time) printOnForCTLib: aStream ] ifFalse: [ self shouldNotImplement ]
</methods> <methods> Core.Double <category>private-ctlib</category>
printOnForCTLib: aStream "Print a CTLib-compatible version of the receiver on aStream. This involves converting the expondent character to 'e', or dropping it if it appears at the end of the string." | printString expCharIndex | printString := self printString. expCharIndex := printString indexOf: (self class exponentCharacter). aStream next: (expCharIndex - 1) putAll: printString startingAt: 1. expCharIndex == printString size ifFalse: [ aStream nextPut: $e. aStream next: (printString size - expCharIndex) putAll: printString startingAt: (expCharIndex + 1) ].
</methods> <methods> Core.Timestamp <category>private-ctlib</category>
printOnForCTLib: aStream "Format a representation of the receiver acceptable for input to CTLib." aStream nextPutAll: 'convert(datetime, '''. self asDate printOn: aStream format: #(2 1 3 $ 2 1). aStream space. hour > 12 ifTrue: [ hour - 12 printOn: aStream ] ifFalse: [ hour < 1 ifTrue: [ 12 printOn: aStream ] ifFalse: [ hour printOn: aStream ] ]. aStream nextPutAll: ( minute < 10 ifTrue: [ ':0' ] ifFalse: [ ':' ] ). minute printOn: aStream. aStream nextPutAll: ( second < 10 ifTrue: [ ':0' ] ifFalse: [ ':' ] ). second printOn: aStream. aStream nextPut: $.. millisecond < 10 ifTrue: [ aStream nextPut: $0. ]. millisecond < 100 ifTrue: [ aStream nextPut: $0 ]. millisecond printOn: aStream. aStream nextPutAll: ( hour < 12 ifTrue: [ ' AM' ] ifFalse: [ ' PM' ] ). aStream nextPutAll: ''', 109)'.
</methods> <methods> Core.Magnitude <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." self printOn: aStream
</methods> <methods> Core.Boolean <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." (self ifTrue: [ 1 ] ifFalse: [ 0 ]) printOn: aStream
</methods> <methods> Core.Time <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." aStream nextPutAll: 'convert(datetime, '''. hours printOn: aStream. aStream nextPutAll: ( minutes < 10 ifTrue: [ ':0' ] ifFalse: [ ':' ] ). minutes printOn: aStream. aStream nextPutAll: ( seconds < 10 ifTrue: [ ':0' ] ifFalse: [ ':' ] ). seconds printOn: aStream. aStream nextPutAll: ''', 108)'.
</methods> <methods> Core.GapString <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." self compress. string printOnForCTLib: aStream
</methods> <methods> UI.UISettings class <category>user preferences</category>
addSybaseSectionTo: aDictionary development: devSpecs runtime: runtimeSpecs "Add the Sybase set of preferences and settings slices to the arguments." aDictionary at: #sybaseSetupAccept put: [self sybaseSetupAccept]; at: #sybaseSetupReset put: [self sybaseSetupReset]. self ensure: aDictionary hasModelFor: #sybaseEncoding editing: #sybaseEncodingEditing default: CTLibConnection serverEncoding. devSpecs addLast: 'Sybase'->#(#sybaseSetupSpec #sybaseSetupHelp)
</methods> <methods> UI.UISettings class <category>resources</category>
availableEncodingList ^#(#ISO8859_1 #HP_Roman8)
availableEncodings | mb menu allValues index | allValues := #(#default) asOrderedCollection. mb := MenuBuilder new. mb addLabel: (#Default << #sybaseDB >> 'Default') value: #default. mb line. self availableEncodingList do: [:enc | allValues add: enc. mb addLabel: enc asString value: enc]. menu := mb menu. index := allValues indexOf: CTLibConnection serverEncoding. index = 0 ifFalse: [menu selectionMemory: (menu menuItemAt: index)]. ^menu
</methods> <methods> UI.UISettings class <category>accessing preferences</category>
sybaseSetupAccept | newValue | newValue := self preferenceFor: #sybaseEncodingEditing. (self preferenceModelFor: #sybaseEncoding) value: newValue. CTLibConnection serverEncoding: newValue
sybaseSetupReset (self preferenceModelFor: #sybaseEncodingEditing) value: (self preferenceFor: #sybaseEncoding).
</methods> <methods> UI.UISettings <category>help</category>
sybaseSetupHelp ^'Sybase Setup This setting is only needed for Sybase client library 4.x, which is used on Windows and HP. For other operating systems, set this to ''Default''.'
</methods> <methods> Core.Text <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." self string printOnForCTLib: aStream
</methods> <methods> Core.Date <category>private-ctlib</category>
printOnForCTLib: aStream "Print a reprentation of the receiver acceptable to CTLib." aStream nextPutAll: 'convert(datetime, '''. self printOn: aStream format: #(2 1 3 $ 2 1). aStream nextPutAll: ''', 107)'.
</methods> <methods> Core.ByteSymbol <category>private-ctlib</category>
printOnForCTLib: aStream "Format a respresentation of the receiver acceptable for input to CTLib." | x | aStream nextPut: $'. 1 to: self size do: [:i | aStream nextPut: (x := self at: i). x == $' ifTrue: [aStream nextPut: x]]. "embedded quotes get doubled" aStream nextPut: $'
</methods> <methods> Tools.VisualWorksSettings class <category>settings-database</category>
sybase1Encoding <setting: #(sybase sybaseEncoding)> ^((EnumerationSetting choices: #(#default #ISO8859_1 #HP_Roman8) labels: (Array with: #Default << #sybaseDB >> 'Default' with: 'ISO8859-1' with: 'HP Roman8')) onUISetting: #sybaseEncoding) label: #Encoding << #sybaseDB >> 'Encoding'; default: #default; helpText: #SybaseHelpText << #sybaseDB >> 'This setting is only needed for Sybase client library 4.x, which is used on Windows and HP. For other operating systems, set this to ''Default''.'
</methods> <methods> Tools.VisualWorksSettings class <category>pages</category>
sybasePage <settingsPage: #(tools sybase)> ^ModularSettingsPage new label: #Sybase << #sybaseDB >> 'Sybase'; icon: (ListIconLibrary visualFor: #database); settings: (self settingsWithPrefix: #(sybase))
</methods> <methods> UI.UISettings class <category>interface specs</category>
sybaseSetupSpec "UIPainter new openOnClass: self andSelector: #sybaseSetupSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{UserMessage} #key: #UnlabeledCanvas #catalogID: #sybaseDB #defaultString: 'Unlabeled Canvas' ) #bounds: #(#Rectangle 222 338 508 540 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#Point 39 29 ) #label: #(#{UserMessage} #key: #SybaseServerEncoding #catalogID: #sybaseDB #defaultString: 'Sybase Server Encoding' ) ) #(#MenuButtonSpec #layout: #(#Rectangle 20 108 200 135 ) #name: #SybaseEncoding #model: #sybaseEncodingEditing #callbacksSpec: #(#UIEventCallbackSubSpec #valueChangeSelector: #disturb ) #menu: #availableEncodings ) #(#ActionButtonSpec #layout: #(#Point 185 240 ) #model: #helpAction #label: #(#{UserMessage} #key: #Help #catalogID: #sybaseDB #defaultString: 'Help' ) #isDefault: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#Point 101 240 ) #name: #resetButton #flags: 40 #model: #sybaseSetupReset #callbacksSpec: #(#UIEventCallbackSubSpec #valueChangeSelector: #undisturb ) #label: #(#{UserMessage} #key: #Reset #catalogID: #sybaseDB #defaultString: 'Reset' ) #defaultable: true ) #(#ActionButtonSpec #layout: #(#Point 10 240 ) #name: #acceptButton #flags: 40 #model: #sybaseSetupAccept #callbacksSpec: #(#UIEventCallbackSubSpec #valueChangeSelector: #undisturb ) #label: #(#{UserMessage} #key: #Accept #catalogID: #sybaseDB #defaultString: 'Accept' ) #isDefault: true #defaultable: true ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 83 0 -10 1 153 0 ) #label: #(#{UserMessage} #key: #Encoding #catalogID: #sybaseDB #defaultString: 'Encoding' )) ) ) )
</methods> <methods> Database.CTLibInterface <category>procedures</category>
cs_ctx_alloc: version with: outptr <C: CS_RETCODE cs_ctx_alloc(CS_INT version, CS_CONTEXT * * outptr)> ^self externalAccessFailed
cs_ctx_drop: context <C: CS_RETCODE cs_ctx_drop(CS_CONTEXT * context)> ^self externalAccessFailed
ct_bind: cmd with: item with: datafmt with: buf with: outputlen with: indicator <C: CS_RETCODE ct_bind(CS_COMMAND * cmd, CS_INT item, CS_DATAFMT * datafmt, CS_VOID * buf, CS_INT * outputlen, CS_SMALLINT * indicator)> ^self externalAccessFailed
ct_callback: context with: connection with: action with: type with: func <C: CS_RETCODE ct_callback(CS_CONTEXT * context, CS_CONNECTION * connection, CS_INT action, CS_INT type, CS_VOID * func)> ^self externalAccessFailed
ct_cancel: connection with: cmd with: type <C: CS_RETCODE ct_cancel(CS_CONNECTION * connection, CS_COMMAND * cmd, CS_INT type)> ^self externalAccessFailed
ct_close: connection with: option <C: CS_RETCODE ct_close(CS_CONNECTION * connection, CS_INT option)> ^self externalAccessFailed
ct_cmd_alloc: connection with: cmdptr <C: CS_RETCODE ct_cmd_alloc(CS_CONNECTION * connection, CS_COMMAND * * cmdptr)> ^self externalAccessFailed
ct_cmd_drop: cmd <C: CS_RETCODE ct_cmd_drop(CS_COMMAND * cmd)> ^self externalAccessFailed
ct_cmd_props: cmd with: action with: property with: buffer with: buflen with: outlen <C: CS_RETCODE ct_cmd_props(CS_COMMAND *cmd, CS_INT action, CS_INT property, CS_VOID *buffer, CS_INT buflen, CS_INT *outlen)> ^self externalAccessFailed
ct_command: cmd with: type with: buf with: buflen with: option <C: CS_RETCODE ct_command(CS_COMMAND * cmd, CS_INT type, CS_CHAR * buf, CS_INT buflen, CS_INT option)> ^self externalAccessFailed
ct_config: context with: action with: property with: buf with: buflen with: outlen <C: CS_RETCODE ct_config(CS_CONTEXT * context, CS_INT action, CS_INT property, CS_VOID * buf, CS_INT buflen, CS_INT * outlen)> ^self externalAccessFailed
ct_connect: connection with: server_name with: snamelen <C: CS_RETCODE ct_connect(CS_CONNECTION * connection, CS_CHAR * server_name, CS_INT snamelen)> ^self externalAccessFailed
ct_con_alloc: context with: connection <C: CS_RETCODE ct_con_alloc(CS_CONTEXT * context, CS_CONNECTION * * connection)> ^self externalAccessFailed
ct_con_drop: connection <C: CS_RETCODE ct_con_drop(CS_CONNECTION * connection)> ^self externalAccessFailed
ct_con_props: connection with: action with: property with: buf with: buflen with: outlen <C: CS_RETCODE ct_con_props(CS_CONNECTION * connection, CS_INT action, CS_INT property, CS_VOID * buf, CS_INT buflen, CS_INT * outlen)> ^self externalAccessFailed
ct_cursor: cmd with: type with: name with: namelen with: text with: textlen with: option <C: CS_RETCODE ct_cursor(CS_COMMAND * cmd, CS_INT type, CS_CHAR * name, CS_INT namelen, CS_CHAR * text, CS_INT textlen, CS_INT option)> ^self externalAccessFailed
ct_describe: cmd with: item with: datafmt <C: CS_RETCODE ct_describe(CS_COMMAND * cmd, CS_INT item, CS_DATAFMT * datafmt)> ^self externalAccessFailed
ct_exit: context with: option <C: CS_RETCODE ct_exit(CS_CONTEXT * context, CS_INT option)> ^self externalAccessFailed
ct_fetch: cmd with: type with: offset with: option with: count <C: CS_RETCODE ct_fetch(CS_COMMAND * cmd, CS_INT type, CS_INT offset, CS_INT option, CS_INT * count)> ^self externalAccessFailed
ct_init: context with: version <C: CS_RETCODE ct_init(CS_CONTEXT * context, CS_INT version)> ^self externalAccessFailed
ct_options: connection with: action with: option with: param with: paramlen with: outlen <C: CS_RETCODE ct_options(CS_CONNECTION * connection, CS_INT action, CS_INT option, CS_VOID * param, CS_INT paramlen, CS_INT * outlen)> ^self externalAccessFailed
ct_results: cmd with: result_type <C: CS_RETCODE ct_results(CS_COMMAND * cmd, CS_INT * result_type)> ^self externalAccessFailed
ct_res_info: cmd with: operation with: buf with: buflen with: outlen <C: CS_RETCODE ct_res_info(CS_COMMAND * cmd, CS_INT operation, CS_VOID * buf, CS_INT buflen, CS_INT * outlen)> ^self externalAccessFailed
ct_scroll_fetch: cmd with: type with: offset with: option with: count <C: CS_RETCODE ct_scroll_fetch(CS_COMMAND * cmd, CS_INT type, CS_INT offset, CS_INT option, CS_INT * count)> ^self externalAccessFailed
ct_send: cmd <C: CS_RETCODE ct_send(CS_COMMAND * cmd)> ^self externalAccessFailed
</methods> <methods> Database.CTLibAOSFInterface <category>procedures</category>
cs_ctx_alloc: version with: outptr <C: CS_RETCODE cs_ctx_alloc(CS_INT version, CS_CONTEXT * * outptr)> ^self externalAccessFailed
cs_ctx_drop: context <C: CS_RETCODE cs_ctx_drop(CS_CONTEXT * context)> ^self externalAccessFailed
ct_bind: cmd with: item with: datafmt with: buf with: outputlen with: indicator <C: CS_RETCODE ct_bind(CS_COMMAND * cmd, CS_INT item, CS_DATAFMT * datafmt, CS_VOID * buf, CS_INT * outputlen, CS_SMALLINT * indicator)> ^self externalAccessFailed
ct_callback: context with: connection with: action with: type with: func <C: CS_RETCODE ct_callback(CS_CONTEXT * context, CS_CONNECTION * connection, CS_INT action, CS_INT type, CS_VOID * func)> ^self externalAccessFailed
ct_cancel: connection with: cmd with: type <C: CS_RETCODE ct_cancel(CS_CONNECTION * connection, CS_COMMAND * cmd, CS_INT type)> ^self externalAccessFailed
ct_close: connection with: option <C: CS_RETCODE ct_close(CS_CONNECTION * connection, CS_INT option)> ^self externalAccessFailed
ct_cmd_alloc: connection with: cmdptr <C: CS_RETCODE ct_cmd_alloc(CS_CONNECTION * connection, CS_COMMAND * * cmdptr)> ^self externalAccessFailed
ct_cmd_drop: cmd <C: CS_RETCODE ct_cmd_drop(CS_COMMAND * cmd)> ^self externalAccessFailed
ct_command: cmd with: type with: buf with: buflen with: option <C: CS_RETCODE ct_command(CS_COMMAND * cmd, CS_INT type, CS_CHAR * buf, CS_INT buflen, CS_INT option)> ^self externalAccessFailed
ct_config: context with: action with: property with: buf with: buflen with: outlen <C: CS_RETCODE ct_config(CS_CONTEXT * context, CS_INT action, CS_INT property, CS_VOID * buf, CS_INT buflen, CS_INT * outlen)> ^self externalAccessFailed
ct_connect: connection with: server_name with: snamelen <C: CS_RETCODE ct_connect(CS_CONNECTION * connection, CS_CHAR * server_name, CS_INT snamelen)> ^self externalAccessFailed
ct_con_alloc: context with: connection <C: CS_RETCODE ct_con_alloc(CS_CONTEXT * context, CS_CONNECTION * * connection)> ^self externalAccessFailed
ct_con_drop: connection <C: CS_RETCODE ct_con_drop(CS_CONNECTION * connection)> ^self externalAccessFailed
ct_con_props: connection with: action with: property with: buf with: buflen with: outlen <C: CS_RETCODE ct_con_props(CS_CONNECTION * connection, CS_INT action, CS_INT property, CS_VOID * buf, CS_INT buflen, CS_INT * outlen)> ^self externalAccessFailed
ct_describe: cmd with: item with: datafmt <C: CS_RETCODE ct_describe(CS_COMMAND * cmd, CS_INT item, CS_DATAFMT * datafmt)> ^self externalAccessFailed
ct_exit: context with: option <C: CS_RETCODE ct_exit(CS_CONTEXT * context, CS_INT option)> ^self externalAccessFailed
ct_fetch: cmd with: type with: offset with: option with: count <C: CS_RETCODE ct_fetch(CS_COMMAND * cmd, CS_INT type, CS_INT offset, CS_INT option, CS_INT * count)> ^self externalAccessFailed
ct_init: context with: version <C: CS_RETCODE ct_init(CS_CONTEXT * context, CS_INT version)> ^self externalAccessFailed
ct_options: connection with: action with: option with: param with: paramlen with: outlen <C: CS_RETCODE ct_options(CS_CONNECTION * connection, CS_INT action, CS_INT option, CS_VOID * param, CS_INT paramlen, CS_INT * outlen)> ^self externalAccessFailed
ct_results: cmd with: result_type <C: CS_RETCODE ct_results(CS_COMMAND * cmd, CS_INT * result_type)> ^self externalAccessFailed
ct_res_info: cmd with: operation with: buf with: buflen with: outlen <C: CS_RETCODE ct_res_info(CS_COMMAND * cmd, CS_INT operation, CS_VOID * buf, CS_INT buflen, CS_INT * outlen)> ^self externalAccessFailed
ct_send: cmd <C: CS_RETCODE ct_send(CS_COMMAND * cmd)> ^self externalAccessFailed
</methods> <methods> Database.CTLibWin16Interface <category>procedures</category>
cs_ctx_alloc: version with: outptr <C: CS_RETCODE _far _pascal cs_ctx_alloc(CS_INT version, CS_CONTEXT _far * _far * outptr)> ^self externalAccessFailed
cs_ctx_drop: context <C: CS_RETCODE _far _pascal cs_ctx_drop(CS_CONTEXT _far * context)> ^self externalAccessFailed
ct_bind: cmd with: item with: datafmt with: buf with: outputlen with: indicator <C: CS_RETCODE _far _pascal ct_bind(CS_COMMAND _far * cmd, CS_INT item, CS_DATAFMT _far * datafmt, CS_VOID _far * buf, CS_INT _far * outputlen, CS_SMALLINT _far * indicator)> ^self externalAccessFailed
ct_callback: context with: connection with: action with: type with: func <C: CS_RETCODE _far _pascal ct_callback(CS_CONTEXT _far * context, CS_CONNECTION _far * connection, CS_INT action, CS_INT type, CS_VOID _far * func)> ^self externalAccessFailed
ct_cancel: connection with: cmd with: type <C: CS_RETCODE _far _pascal ct_cancel(CS_CONNECTION _far * connection, CS_COMMAND _far * cmd, CS_INT type)> ^self externalAccessFailed
ct_close: connection with: option <C: CS_RETCODE _far _pascal ct_close(CS_CONNECTION _far * connection, CS_INT option)> ^self externalAccessFailed
ct_cmd_alloc: connection with: cmdptr <C: CS_RETCODE _far _pascal ct_cmd_alloc(CS_CONNECTION _far * connection, CS_COMMAND _far * _far * cmdptr)> ^self externalAccessFailed
ct_cmd_drop: cmd <C: CS_RETCODE _far _pascal ct_cmd_drop(CS_COMMAND _far * cmd)> ^self externalAccessFailed
ct_command: cmd with: type with: buf with: buflen with: option <C: CS_RETCODE _far _pascal ct_command(CS_COMMAND _far * cmd, CS_INT type, CS_CHAR _far * buf, CS_INT buflen, CS_INT option)> ^self externalAccessFailed
ct_config: context with: action with: property with: buf with: buflen with: outlen <C: CS_RETCODE _far _pascal ct_config(CS_CONTEXT _far * context, CS_INT action, CS_INT property, CS_VOID _far * buf, CS_INT buflen, CS_INT _far * outlen)> ^self externalAccessFailed
ct_connect: connection with: server_name with: snamelen <C: CS_RETCODE _far _pascal ct_connect(CS_CONNECTION _far * connection, CS_CHAR _far * server_name, CS_INT snamelen)> ^self externalAccessFailed
ct_con_alloc: context with: connection <C: CS_RETCODE _far _pascal ct_con_alloc(CS_CONTEXT _far * context, CS_CONNECTION _far * _far * connection)> ^self externalAccessFailed
ct_con_drop: connection <C: CS_RETCODE _far _pascal ct_con_drop(CS_CONNECTION _far * connection)> ^self externalAccessFailed
ct_con_props: connection with: action with: property with: buf with: buflen with: outlen <C: CS_RETCODE _far _pascal ct_con_props(CS_CONNECTION _far * connection, CS_INT action, CS_INT property, CS_VOID _far * buf, CS_INT buflen, CS_INT _far * outlen)> ^self externalAccessFailed
ct_describe: cmd with: item with: datafmt <C: CS_RETCODE _far _pascal ct_describe(CS_COMMAND _far * cmd, CS_INT item, CS_DATAFMT _far * datafmt)> ^self externalAccessFailed
ct_exit: context with: option <C: CS_RETCODE _far _pascal ct_exit(CS_CONTEXT _far * context, CS_INT option)> ^self externalAccessFailed
ct_fetch: cmd with: type with: offset with: option with: count <C: CS_RETCODE _far _pascal ct_fetch(CS_COMMAND _far * cmd, CS_INT type, CS_INT offset, CS_INT option, CS_INT _far * count)> ^self externalAccessFailed
ct_init: context with: version <C: CS_RETCODE _far _pascal ct_init(CS_CONTEXT _far * context, CS_INT version)> ^self externalAccessFailed
ct_options: connection with: action with: option with: param with: paramlen with: outlen <C: CS_RETCODE _far _pascal ct_options(CS_CONNECTION _far * connection, CS_INT action, CS_INT option, CS_VOID _far * param, CS_INT paramlen, CS_INT _far * outlen)> ^self externalAccessFailed
ct_results: cmd with: result_type <C: CS_RETCODE _far _pascal ct_results(CS_COMMAND _far * cmd, CS_INT _far * result_type)> ^self externalAccessFailed
ct_res_info: cmd with: operation with: buf with: buflen with: outlen <C: CS_RETCODE _far _pascal ct_res_info(CS_COMMAND _far * cmd, CS_INT operation, CS_VOID _far * buf, CS_INT buflen, CS_INT _far * outlen)> ^self externalAccessFailed
ct_send: cmd <C: CS_RETCODE _far _pascal ct_send(CS_COMMAND _far * cmd)> ^self externalAccessFailed
</methods> <initialize> Database.CTLibConnection </initialize> <initialize> Database.CTLibBuffer </initialize> <initialize> Database.CTLibSession </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>ExternalDatabaseException</name> <environment>Database</environment> <super>Core.Error</super> <private>false</private> none <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>SequenceableCollection</name> <environment>Core</environment> <super>Core.Collection</super> <private>false</private> none <imports></imports> <category>Collections-Abstract</category> <attributes> <package>Collections-Abstract</package> </attributes> </class> <class> <name>String</name> <environment>Core</environment> <super>Core.CharacterArray</super> <private>false</private> none <imports></imports> <category>Collections-Text</category> <attributes> <package>Collections-Text</package> </attributes> </class> <class> <name>Magnitude</name> <environment>Core</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Magnitude-General</category> <attributes> <package>Magnitude-General</package> </attributes> </class> <class> <name>ExternalDatabaseTransaction</name> <environment>Database</environment> <super>Database.ExternalDatabaseFramework</super> <private>false</private> none memberCountHolder remainingCountHolder <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>ExternalDatabaseConnection</name> <environment>Database</environment> <super>Database.ExternalDatabaseFramework</super> <private>false</private> none transaction username password environment transactionCoordinator cachedSession isolationLevel environmentMap xif xifMap dependents <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>Date</name> <environment>Core</environment> <super>Core.Magnitude</super> <private>false</private> none day year <imports></imports> <category>Magnitude-General</category> <attributes> <package>Magnitude-General</package> </attributes> </class> <class> <name>Character</name> <environment>Core</environment> <super>Core.Magnitude</super> <private>false</private> immediate <imports></imports> <category>Magnitude-General</category> <attributes> <package>Magnitude-General</package> </attributes> </class> <class> <name>ByteSymbol</name> <environment>Core</environment> <super>Core.Symbol</super> <private>false</private> bytes <imports></imports> <category>Collections-String Support</category> <attributes> <package>Collections-String Support</package> </attributes> </class> <class> <name>ExternalInterface</name> <environment>External</environment> <super>Core.Object</super> <private>false</private> none includeFiles includeDirectories libraryFiles libraryDirectories virtual optimizationLevel <imports> private Kernel.OpcodePool.* </imports> <category>External-Interface</category> <attributes> <package>External-Interface</package> </attributes> </class> <class> <name>UISettings</name> <environment>UI</environment> <super>UI.ApplicationModel</super> <private>false</private> none list disturbed subBuilder <imports></imports> <category>Interface-Support</category> <attributes> <package>Interface-Support</package> </attributes> </class> <class> <name>Timestamp</name> <environment>Core</environment> <super>Core.Magnitude</super> <private>false</private> none year month day hour minute second millisecond <imports></imports> <category>UIBasics-Support</category> <attributes> <package>UIBasics-Support</package> </attributes> </class> <class> <name>GapString</name> <environment>Core</environment> <super>Core.String</super> <private>false</private> none string gapStart gapSize <imports></imports> <category>Collections-String Support</category> <attributes> <package>Collections-String Support</package> </attributes> </class> <class> <name>Boolean</name> <environment>Core</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>ExternalDatabaseColumnDescription</name> <environment>Database</environment> <super>Core.Object</super> <private>false</private> none name index type length precision scale nullable <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>Time</name> <environment>Core</environment> <super>Core.Magnitude</super> <private>false</private> none hours minutes seconds <imports></imports> <category>Magnitude-General</category> <attributes> <package>Magnitude-General</package> </attributes> </class> <class> <name>Double</name> <environment>Core</environment> <super>Core.LimitedPrecisionReal</super> <private>false</private> bytes <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class> <class> <name>ByteArray</name> <environment>Core</environment> <super>Core.IntegerArray</super> <private>false</private> bytes <imports></imports> <category>Collections-Arrayed</category> <attributes> <package>Collections-Arrayed</package> </attributes> </class> <class> <name>ExternalDatabaseBuffer</name> <environment>Database</environment> <super>Core.Object</super> <private>false</private> none databaseType encoding elementSize count bufferPointer <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>ExternalDatabaseSession</name> <environment>Database</environment> <super>Database.ExternalDatabaseFramework</super> <private>false</private> none connection query queryFragments bindInput bindTemplate bindOutput useNamedOutputBinding bindValues resultTemplate allocateForEachRow blockFactor numColumns columnDescriptions rowAdaptors rowBuffersHolder bufferIndex answerStream currentRow scrollable <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>Text</name> <environment>Core</environment> <super>Core.CharacterArray</super> <private>false</private> none string runs <imports> private Graphics.TextConstants.* </imports> <category>Collections-Text</category> <attributes> <package>Collections-Text</package> </attributes> </class> <class> <name>ExternalDatabaseError</name> <environment>Database</environment> <super>Core.Object</super> <private>false</private> none dbmsErrorCode dbmsErrorString osErrorCode osErrorString <imports></imports> <category>Database-Interface</category> <attributes> <package>Database</package> </attributes> </class> <class> <name>FixedPoint</name> <environment>Core</environment> <super>Core.Number</super> <private>false</private> none numerator denominator scale <imports></imports> <category>Magnitude-Numbers</category> <attributes> <package>Magnitude-Numbers</package> </attributes> </class>