Pub.ISQLDB: | Globals | Functions | Types | Modinfo | Source |
Global _isqldbdriver:ISQLDB | |
Description | Private variable storing a global reference to the current ISQLDB driver. |
Function GetISQLDBDriver:ISQLDB() | |
Returns | An instance of ISQLDB or Null if none set. |
Description | Gets the current database driver. |
Function SetISQLDBDriver:ISQLDB(driver:ISQLDB=Null) | |
Returns | An instance of ISQLDB or Null if none set. |
Description | Sets the current database driver. |
Type IOnEndResultEventHandler Abstract | |
Description | Set an instance of this on an implementation to know when a result has been completely processed. |
Information | Every implementation should have this ability but for some implementations it may not fire at the same time the ISQLResult is actually returned. This is due to some impelentations having the ability to keep data on the actual server until that row is requested. |
Type IOnResultEventHandler Abstract | |
Description | For implementations that can keep data on the server and fetch incrementally, an instance of this can be set and it will fire for each row read. |
Type ISQLDB Abstract | |
Description | Interface for an SQL database connection. |
Const ERR_CONNECT_FAIL:Int | |
Description | Connection to the specified server could not be made or is no longer valid. |
Const ERR_GENERAL:Int | |
Description | A general error has occurred. |
Const ERR_INIT_FAIL:Int | |
Description | Initialization of the SQL database library has failed. |
Const ERR_INVALID_COLUMN:Int | |
Description | An invalid column name or index has been referenced. |
Const ERR_INVALID_ROWCOL:Int | |
Description | An invalid row and column has been referenced. |
Const ERR_NO_RESULTS:Int | |
Description | Indicates that no results were returned. |
Const ERR_NONE:Int | |
Description | No information has been set. |
Const ERR_NOT_SUPPORTED:Int | |
Description | The called functionality is not implemented in the underlying engine. |
Const ERR_OK:Int | |
Description | Status of OK. |
Const ERR_QUERY_FAIL:Int | |
Description | Database server failed to process the sent SQL statement. |
Const ERR_RESULT_FAIL:Int | |
Description | Indicates a problem with the returned query result handle. |
Const ERR_SRVCMD_FAIL:Int | |
Description | Database server failed to process the sent command. |
Const ERR_UNKNOWN:Int | |
Description | An unknown error has occurred. Check the error messages for more info. |
Method closeConnection() Abstract | |
Description | Closes an open a connection to the server. |
Method execute:ISQLResult(query:String) Abstract | |
Returns | An instance of ISQLResult or Null if failed. |
Description | Executes an SQL query on the connected database server. |
Information | Used for SELECT SQL statements. If the return value is Null, check the error information on ISQLDB. |
Method executeNonQuery:ISQLResult(stmt:String) Abstract | |
Returns | An instance if ISQLResult or Null if failed. |
Description | Executes an SQL statement on the connected database server that does not return data as a result. |
Information | Used for INSERT, UPDATE, and DELETE SQL statements. While the result will not contain rows, getNumRows() will tell the number of rows affected and getInsertId() will tell the autocreated record Id if there was one (and the implementation supports it). |
Method executeScalar:String(query:String,field_nm:String=Null) Abstract | |
Returns | If field_nm parameter is used, the value of the passed field in the first row of the result set, else the value of the first row, first column of the result set. |
Description | Executes an SQL query on the connected database server and returns a single value from the first row of the result set. |
Information | Returned value can be Null. Check error information to see if an error occurred. Error will be ERR_NO_RESULTS if the query resulted in no returned rows. |
Method getDB:String() Abstract | |
Description | Gets the database that the server is accessing. |
Method getError:Int() Abstract | |
Description | Gets the error type of the last ISQLDB error that occurred. |
Method getErrorMsg:String() Abstract | |
Description | Gets the error message of the last ISQLDB error that occurred. |
Method getHost:String() Abstract | |
Description | Gets the database server being accessed. |
Method getNativeError:String() Abstract | |
Description | Gets the native error message of the last error that occurred. |
Information | "Native" refers to the error as reported by the underlying SQL database engine. |
Method getNativeHandle:Int() Abstract | |
Description | Gets the native handle For this instance of ISQLDB. |
Information | "Native" refers To the underlying SQL database engine connection handle. This handle can be used To access native engine functions directly. |
Method getPassword:String() Abstract | |
Description | Gets the password used to login to the server. |
Method getPort:Int() Abstract | |
Description | Gets the port used to connect to the server. |
Method getUsername:String() Abstract | |
Description | Gets the username used to login to the server. |
Method openConnection:Int() Abstract | |
Returns | True if a successful connection was made, otherwise False. |
Description | Attempts to open a connection to the server. |
Function setOnEndResultHandler(handler:IOnEndResultEventHandler=Null) Abstract | |
Description | Sets the event handler that will fire each time a result set is received in its entirety. |
Information | This is global to the type, not the instance. |
Function setOnResultHandler(handler:IOnResultEventHandler=Null) Abstract | |
Description | Sets the event handler that will fire each time a result set is received. |
Information | This is global to the type, not the instance. This may not be implemented for some engines. |
Type ISQLResult Abstract | |
Description | The result of an ISQLDB query providing access to the returned data. |
Method getColIdx:Int(col:String) Abstract | |
Returns | The index of the column or ERR_INVALID_COLUMN if not found. |
Description | Gets the index of the passed column name. |
Method getColName:String(col:Int) Abstract | |
Returns | The column name or Null if not found. |
Description | Gets the column name of the passed index. |
Method getColWidth:Int(row:Int,col:Int) Abstract | |
Description | Gets the width in bytes of the data contained in a row/column. |
Method getComplete:Int() Abstract ' returns true if all results have been downloaded | |
Returns | True/False. |
Description | Gets whether all the results have been returned. |
Method getConnection:ISQLDB() Abstract | |
Description | Gets the instance of ISQLDB that created the result. |
Method getDoubleVal:Float(row:Int,col:Int) Abstract | |
Returns | The column value as a Double. |
Description | Gets the value of a column by row and column index. |
Information | A RuntimeError will be generated if an invalid row or column is passed. |
Method getDoubleValByName:Float(row:Int,col:String) Abstract | |
Returns | The column value as a Double. |
Description | Gets the value of a column by row index And column name. |
Information | A RuntimeError will be generated If an invalid row or column is passed. |
Method getError:Int() Abstract | |
Description | Gets the error type of the last ISQLDB error that occurred. |
Method getErrorMsg:String() Abstract | |
Description | Gets the error message of the last ISQLDB error that occurred. |
Method getFloatVal:Float(row:Int,col:Int) Abstract | |
Returns | The column value as a Float. |
Description | Gets the value of a column by row and column index. |
Information | A RuntimeError will be generated if an invalid row or column is passed. |
Method getFloatValByName:Float(row:Int,col:String) Abstract | |
Returns | The column value as a Float. |
Description | Gets the value of a column by row index And column name. |
Information | A RuntimeError will be generated If an invalid row or column is passed. |
Method getInsertId:String() Abstract | |
Returns | The new Id as a String. |
Description | Gets the last Id generated for a new record by the SQL statement that generated this result. |
Method getIntVal:Int(row:Int,col:Int) Abstract | |
Returns | The column value as an Integer. |
Description | Gets the value of a column by row and column index. |
Information | A RuntimeError will be generated if an invalid row or column is passed. |
Method getIntValByName:Int(row:Int,col:String) Abstract | |
Returns | The column value as an Integer. |
Description | Gets the value of a column by row index and column name. |
Information | A RuntimeError will be generated if an invalid row or column is passed. |
Method getLongVal:Long(row:Int,col:Int) Abstract | |
Returns | The column value as a Long. |
Description | Gets the value of a column by row and column index. |
Information | A RuntimeError will be generated if an invalid row or column is passed. |
Method getLongValByName:Long(row:Int,col:String) Abstract | |
Returns | The column value as a Long. |
Description | Gets the value of a column by row index And column name. |
Information | A RuntimeError will be generated If an invalid row or column is passed. |
Method getNativeError:String() Abstract | |
Description | Gets the native error message of the last error that occurred. |
Information | "Native" refers to the error as reported by the underlying SQL database engine. |
Method getNativeHandle:Int() Abstract | |
Description | Gets the native handle for this instance of ISQLResult. |
Information | "Native" refers to the underlying SQL database engine result handle. This handle can be used to access native engine functions directly. |
Method getNumCols:Int() Abstract | |
Description | Gets the number of columns in this result. |
Method getNumRows:Int() Abstract | |
Description | Gets the number of rows in this result or the of rows affected by the SQL statement. |
Method getQuery:String() Abstract | |
Description | Gets the SQL query statement that created this result. |
Method getSuccess:Int() Abstract | |
Returns | True/False. |
Description | Gets if the query was successful or not. |
Information | Check error information for details on why the query failed. |
Method getVal:String(row:Int,col:Int) Abstract | |
Returns | The column value as a string. |
Description | Gets the value of a column by row and column index. |
Information | Can check for ERR_INVALID_COLUMN or ERR_INVALID_ROWCOL errors to see if this failed. |
Method getValByName:String(row:Int,col:String) Abstract | |
Returns | The column value as a string. |
Description | Gets the value of a column by row index and column name. |
Information | Can check for ERR_INVALID_COLUMN or ERR_INVALID_ROWCOL errors to see if this failed. |
Name | Pub.ISQLDB v1.00 |
---|---|
Description | BlitzMax Interface for accessing SQL databases |
License | freebie |
Authors | gman |
History | 2006/1/18 - initial release v1.00 |