Pub.ISQLDB: Globals Functions Types Modinfo Source  

SQL Database Interface

Globals

Global _isqldbdriver:ISQLDB
DescriptionPrivate variable storing a global reference to the current ISQLDB driver.

Functions

Function GetISQLDBDriver:ISQLDB()
ReturnsAn instance of ISQLDB or Null if none set.
DescriptionGets the current database driver.

Function SetISQLDBDriver:ISQLDB(driver:ISQLDB=Null)
ReturnsAn instance of ISQLDB or Null if none set.
DescriptionSets the current database driver.

Types

Type IOnEndResultEventHandler Abstract
DescriptionSet an instance of this on an implementation to know when a result has been completely processed.
InformationEvery 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
DescriptionFor 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
DescriptionInterface for an SQL database connection.
Const ERR_CONNECT_FAIL:Int
DescriptionConnection to the specified server could not be made or is no longer valid.
Const ERR_GENERAL:Int
DescriptionA general error has occurred.
Const ERR_INIT_FAIL:Int
DescriptionInitialization of the SQL database library has failed.
Const ERR_INVALID_COLUMN:Int
DescriptionAn invalid column name or index has been referenced.
Const ERR_INVALID_ROWCOL:Int
DescriptionAn invalid row and column has been referenced.
Const ERR_NO_RESULTS:Int
DescriptionIndicates that no results were returned.
Const ERR_NONE:Int
DescriptionNo information has been set.
Const ERR_NOT_SUPPORTED:Int
DescriptionThe called functionality is not implemented in the underlying engine.
Const ERR_OK:Int
DescriptionStatus of OK.
Const ERR_QUERY_FAIL:Int
DescriptionDatabase server failed to process the sent SQL statement.
Const ERR_RESULT_FAIL:Int
DescriptionIndicates a problem with the returned query result handle.
Const ERR_SRVCMD_FAIL:Int
DescriptionDatabase server failed to process the sent command.
Const ERR_UNKNOWN:Int
DescriptionAn unknown error has occurred. Check the error messages for more info.
Method closeConnection() Abstract
DescriptionCloses an open a connection to the server.
Method execute:ISQLResult(query:String) Abstract
ReturnsAn instance of ISQLResult or Null if failed.
DescriptionExecutes an SQL query on the connected database server.
InformationUsed for SELECT SQL statements. If the return value is Null, check the error information on ISQLDB.
Method executeNonQuery:ISQLResult(stmt:String) Abstract
ReturnsAn instance if ISQLResult or Null if failed.
DescriptionExecutes an SQL statement on the connected database server that does not return data as a result.
InformationUsed 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
ReturnsIf 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.
DescriptionExecutes an SQL query on the connected database server and returns a single value from the first row of the result set.
InformationReturned 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
DescriptionGets the database that the server is accessing.
Method getError:Int() Abstract
DescriptionGets the error type of the last ISQLDB error that occurred.
Method getErrorMsg:String() Abstract
DescriptionGets the error message of the last ISQLDB error that occurred.
Method getHost:String() Abstract
DescriptionGets the database server being accessed.
Method getNativeError:String() Abstract
DescriptionGets 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
DescriptionGets 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
DescriptionGets the password used to login to the server.
Method getPort:Int() Abstract
DescriptionGets the port used to connect to the server.
Method getUsername:String() Abstract
DescriptionGets the username used to login to the server.
Method openConnection:Int() Abstract
ReturnsTrue if a successful connection was made, otherwise False.
DescriptionAttempts to open a connection to the server.
Function setOnEndResultHandler(handler:IOnEndResultEventHandler=Null) Abstract
DescriptionSets the event handler that will fire each time a result set is received in its entirety.
InformationThis is global to the type, not the instance.
Function setOnResultHandler(handler:IOnResultEventHandler=Null) Abstract
DescriptionSets the event handler that will fire each time a result set is received.
InformationThis is global to the type, not the instance. This may not be implemented for some engines.

Type ISQLResult Abstract
DescriptionThe result of an ISQLDB query providing access to the returned data.
Method getColIdx:Int(col:String) Abstract
ReturnsThe index of the column or ERR_INVALID_COLUMN if not found.
DescriptionGets the index of the passed column name.
Method getColName:String(col:Int) Abstract
ReturnsThe column name or Null if not found.
DescriptionGets the column name of the passed index.
Method getColWidth:Int(row:Int,col:Int) Abstract
DescriptionGets the width in bytes of the data contained in a row/column.
Method getComplete:Int() Abstract ' returns true if all results have been downloaded
ReturnsTrue/False.
DescriptionGets whether all the results have been returned.
Method getConnection:ISQLDB() Abstract
DescriptionGets the instance of ISQLDB that created the result.
Method getDoubleVal:Float(row:Int,col:Int) Abstract
ReturnsThe column value as a Double.
DescriptionGets the value of a column by row and column index.
InformationA RuntimeError will be generated if an invalid row or column is passed.
Method getDoubleValByName:Float(row:Int,col:String) Abstract
ReturnsThe column value as a Double.
DescriptionGets the value of a column by row index And column name.
InformationA RuntimeError will be generated If an invalid row or column is passed.
Method getError:Int() Abstract
DescriptionGets the error type of the last ISQLDB error that occurred.
Method getErrorMsg:String() Abstract
DescriptionGets the error message of the last ISQLDB error that occurred.
Method getFloatVal:Float(row:Int,col:Int) Abstract
ReturnsThe column value as a Float.
DescriptionGets the value of a column by row and column index.
InformationA RuntimeError will be generated if an invalid row or column is passed.
Method getFloatValByName:Float(row:Int,col:String) Abstract
ReturnsThe column value as a Float.
DescriptionGets the value of a column by row index And column name.
InformationA RuntimeError will be generated If an invalid row or column is passed.
Method getInsertId:String() Abstract
ReturnsThe new Id as a String.
DescriptionGets the last Id generated for a new record by the SQL statement that generated this result.
Method getIntVal:Int(row:Int,col:Int) Abstract
ReturnsThe column value as an Integer.
DescriptionGets the value of a column by row and column index.
InformationA RuntimeError will be generated if an invalid row or column is passed.
Method getIntValByName:Int(row:Int,col:String) Abstract
ReturnsThe column value as an Integer.
DescriptionGets the value of a column by row index and column name.
InformationA RuntimeError will be generated if an invalid row or column is passed.
Method getLongVal:Long(row:Int,col:Int) Abstract
ReturnsThe column value as a Long.
DescriptionGets the value of a column by row and column index.
InformationA RuntimeError will be generated if an invalid row or column is passed.
Method getLongValByName:Long(row:Int,col:String) Abstract
ReturnsThe column value as a Long.
DescriptionGets the value of a column by row index And column name.
InformationA RuntimeError will be generated If an invalid row or column is passed.
Method getNativeError:String() Abstract
DescriptionGets 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
DescriptionGets 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
DescriptionGets the number of columns in this result.
Method getNumRows:Int() Abstract
DescriptionGets the number of rows in this result or the of rows affected by the SQL statement.
Method getQuery:String() Abstract
DescriptionGets the SQL query statement that created this result.
Method getSuccess:Int() Abstract
ReturnsTrue/False.
DescriptionGets if the query was successful or not.
InformationCheck error information for details on why the query failed.
Method getVal:String(row:Int,col:Int) Abstract
ReturnsThe column value as a string.
DescriptionGets the value of a column by row and column index.
InformationCan check for ERR_INVALID_COLUMN or ERR_INVALID_ROWCOL errors to see if this failed.
Method getValByName:String(row:Int,col:String) Abstract
ReturnsThe column value as a string.
DescriptionGets the value of a column by row index and column name.
InformationCan check for ERR_INVALID_COLUMN or ERR_INVALID_ROWCOL errors to see if this failed.

Module Information

NamePub.ISQLDB v1.00
DescriptionBlitzMax Interface for accessing SQL databases
Licensefreebie
Authorsgman
History2006/1/18 - initial release v1.00