<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[GMan's Mods & Stuff — proposed new interface additions]]></title>
	<link rel="self" href="https://gprogs.com/extern.php?action=feed&amp;tid=33&amp;type=atom" />
	<updated>2006-01-20T15:42:08Z</updated>
	<generator>PunBB</generator>
	<id>https://gprogs.com/viewtopic.php?id=33</id>
		<entry>
			<title type="html"><![CDATA[proposed new interface additions]]></title>
			<link rel="alternate" href="https://gprogs.com/viewtopic.php?pid=87#p87" />
			<content type="html"><![CDATA[<p>the following are additions i am proposing to the current interface.&nbsp; questions/comments would be much appreciated.<br /></p><div class="codebox"><pre><code>&#039; additions to the existing ISQLDB type
Type ISQLDB

    &#039; driver supports transactions
    Const FETR_TRANSACTIONS:Int 
    &#039; driver supports transaction save points
    Const FETR_TRANSACTION_SAVEPOINTS:Int 
    &#039; driver supports keeping results on the server
    Const FETR_FETCH_ON_DEMAND:Int 
    &#039; can prepare statements
    Const FETR_PREPARED_STMTS:Int    
    
    &#039; returns True if the implementation supports the passed feature
    Method hasFeature:Int(feature:Int) Abstract 
    
    &#039; same as the MySQL implementation, but with the addition of hasFeature can now be moved here
    Method setPrefetch:Int(bPrefetch:Int=True) Abstract 

    &#039; passed string contains only text
    Const ESCT_STRING:Int 
    &#039; passed string has binary values
    Const ESCT_BINARY_STRING:Int 
    &#039; escape a string to make it compatible with the native engine
    Method escapeString:String(stmt:String,esc_type:Int=ESCT_STRING) Abstract 

    &#039; creates a transaction object to be used with commands
    Method BeginTransaction:ISQLTransaction(Options:String) Abstract 
    &#039; creates a command object for use by the driver
    Method CreateDBCommand:ISQLCommand(Transaction:ISQLTransaction = Null) Abstract 
    
    &#039; returns the version info for the native server
    Method getNativeServerVer:String() Abstract
    &#039; returns the version info for the native client
    Method getNativeClientVer:String() Abstract
    &#039; returns the version info for the driver implementation
    Method getISQLDriverVer:String() Abstract
    &#039; returns &quot;about&quot; type information regarding the driver implementation
    Method getISQLDriverInfo:String() Abstract
EndType

&#039; type enabling transaction support and performing transaction functionality
Type ISQLTransaction
    &#039; commits a transaction
    Method Commit() Abstract
    &#039; rollsback a transaction
    Method RollBack(SavePoint:String) Abstract  &#039; Save Points are better for nesting... and method used by SQL Standards
    &#039; begins a transaction
    Method BeginTransaction(SavePoint:String) Abstract   
EndType

&#039; collection of parameters
Type ISQLParmeterCollection Extends TMap
    &#039; creates a new parameter object, sets its value, adds to collection, and returns it
    Method addParam:ISQLParameter(pname:String,value:String,ptype:Int=TYPE_STRING) Abstract
    &#039; removes a parameter from the collection.  returns true if successful.
    Method removeParam:Int(pname:String)
    &#039; gets the parameter from the collection.
    Method getParam:ISQLParameter(pname:String) Abstract
EndType

&#039; parameter for ISQLCommand
Type ISQLParameter
    
    &#039; based on this type, the underlying implementation will convert the value
    &#039; to a format supported by the SQL database engine
    Const TYPE_STRING:Int=0
    Const TYPE_BINARY:Int=1
    Const TYPE_BYTE:Int=2
    Const TYPE_BOOLEAN:Int=3
    Const TYPE_CURRENCY:Int=4
    Const TYPE_DATE:Int=5
    Const TYPE_TIME:Int=6
    Const TYPE_DATETIME:Int=7
    Const TYPE_SHORT:Int=8
    Const TYPE_INT:Int=9
    Const TYPE_LONG:Int=10
    Const TYPE_FLOAT:Int=11
    Const TYPE_DOUBLE:Int=12
    
    &#039; returns the data type of this parameter
    Method getISQLType:Int() Abstract
    &#039; sets the data type of this parameter.  default is TYPE_STRING.
    Method setISQLType(isqltype:Int=TYPE_STRING)

    &#039; gets the parameter value
    Method getVal:String() Abstract
    &#039; sets the parameter value
    Method setVal(value:String) Abstract
        
    &#039; gets the parameter name
    Method getName:String() Abstract
    &#039; sets the parameter name
    Method setName:String() Abstract
    
    &#039; returns True if the parameter accepts null values
    Method getIsNullable:Int() Abstract
    &#039; sets whether the value can be Null or not
    Method setIsNullable(bIsNullable:Int) Abstract
            
EndType

&#039; This is what you will need to do  prepared Statements
Type ISQLCommand

    &#039; this command will run an SQL statement
    Const SQLQUERYCOMMAND=1
    &#039; this command will run a stored procedure
    Const SQLSTOREDPROCEDURE=2

    &#039; returns the connection object associated with this command
    Method GetConnection:ISQLDB() Abstract
    
    &#039; sets the transaction object for this command
    Method SetTransaction(Transaction : ISQLTransaction) Abstract
    &#039; returns the transaction object for this command
    Method GetTransaction:ISQLTransaction() Abstract
    
    &#039; sets the command that will run
    Method SetCommandText(SQLStatement:String) Abstract
    &#039; returns the command set to run
    Method GetCommandText:String() Abstract
    
    &#039; sets the command type
    Method SetCommandType(SQLCommandType:Int=SQLQUERYCOMMAND) Abstract
    &#039; returns the command type
    Method GetCommandType:Int() Abstract
    
    &#039; executes the statement and returns the result set
    Method Execute:ISQLResultSet() Abstract
    &#039; executes this statement as a scaler and returns either the first row/col 
    &#039; value or the value of the field passed from the first row
    Method ExecuteScaler:String(field_nm:String=Null) Abstract

    &#039; gets the parameters collection
    Method getParameters:ISQLParmeterCollection() Abstract

    &#039; prepares a statement for better performance
    Method Prepare() Abstract
    
EndType</code></pre></div>]]></content>
			<author>
				<name><![CDATA[gman]]></name>
				<uri>https://gprogs.com/profile.php?id=2</uri>
			</author>
			<updated>2006-01-20T15:42:08Z</updated>
			<id>https://gprogs.com/viewtopic.php?pid=87#p87</id>
		</entry>
</feed>
