Returns the value stored in the specified column as an array of bytes.
GetBlob2 (IndexAsInt) AsByte()
Returns the value stored in the specified column ordinal as an array of bytes.
GetColumnName (IndexAsInt) AsString
Returns the name of the column at the specified index. The first column index is 0.
GetDouble (ColumnNameAsString) AsDouble
Returns the value stored in the specified column as Double.
GetDouble2 (IndexAsInt) AsDouble
Returns the value stored in the specified column ordinal as Double.
GetInt (ColumnNameAsString) AsInt
Returns the value stored in the specified column as Int.
GetInt2 (IndexAsInt) AsInt
Returns the value stored in the specified column ordinal as Int.
GetLong (ColumnNameAsString) AsLong
Returns the value stored in the specified column as Long.
GetLong2 (IndexAsInt) AsLong
Returns the value stored in the specified column ordinal as Long.
GetString (ColumnNameAsString) AsString
Returns the value stored in the specified column as String.
GetString2 (IndexAsInt) AsString
Returns the value stored in the specified column ordinal as String.
IsInitializedAsBoolean
Tests whether this object was initialized.
NextRowAsBoolean
Moves to the next row and returns true if there is such a row. You should always call NextRow before trying to get a value from the ResultSet. Example: DimrsAsResultSet = SQL1.ExecQuery2("SELECT * FROM table1 WHERE col1 = ?", Array(100))
DoWhilers.NextRow 'work with records Loop rs.Close
TagAsObject
Gets or sets the Tag object. This is a placeholder for any object you like to tie to this object.
Adds the command and the parameters to the batch. Call ExecNonQueryBatch to execute the batch. Example: Fori = 1To1000 sql.AddNonQueryToBatch("INSERT INTO table1 VALUES (?)", Array(Rnd(0, 100000)))
Next DimSenderFilterAsObject = sql.ExecNonQueryBatch("SQL")
WaitFor (SenderFilter) SQL_NonQueryComplete (SuccessAsBoolean)
Log("NonQuery: " & Success)
BeginTransaction
Starts an update transaction. The code structure should be: SQL1.BeginTransaction Try 'block of statements SQL1.TransactionSuccessful Catch SQL1.Rollback'cancel the transaction Log("Error: " & LastException)
EndTry
Close
Closes the database.
ExecNonQuery (StatementAsString)
Executes a non query statement (statement other than SELECT). Make sure to explicitly create a transaction if executing more than a few statements.
ExecNonQuery2 (StatementAsString, ArgsAsList)
Executes a non query statement (statement other than SELECT). Make sure to explicitly create a transaction if executing more than a few statements. The query can include question marks which will be correctly replaced with the values from the list. Example: SQL1.ExecNonQuery2("INSERT INTO table1 VALUES (?, ?, 0)", Array ("some text", 2))
ExecNonQueryBatch (EventNameAsString) AsObject
Asynchronously executes all the commands previously added with AddNonQueryToBatch. The NonQueryComplete event will be raised. Returns an object that can be used as the sender filter in Wait For calls. Example: Fori = 1To1000 sql.AddNonQueryToBatch("INSERT INTO table1 VALUES (?)", Array(Rnd(0, 100000)))
Next DimSenderFilterAsObject = sql.ExecNonQueryBatch("SQL")
WaitFor (SenderFilter) SQL_NonQueryComplete (SuccessAsBoolean)
Log("NonQuery: " & Success)
ExecQuery (QueryAsString) AsResultSet
Executes a SELECT query and returns a ResultSet which is used to go over the results. Example: DimrsAsResultSet = SQL1.ExecQuery("SELECT col1, col2 FROM table1")
DoWhilers.NextRow Log(Cursor.GetString("col1")
Loop
Executes a SELECT query and returns a ResultSet which is used to go over the results. Example: DimrsAsResultSet = SQL1.ExecQuery2("SELECT col1, col2 FROM table1 WHERE col3 = ?", Array (22))
DoWhilers.NextRow Log(Cursor.GetString("col1")
Loop
Asynchronously executes the given query. The QueryComplete event will be raised when the results are ready. Returns an object that can be used as the sender filter for Wait For calls. Example: DimSenderFilterAsObject = sql.ExecQueryAsync("SQL", "SELECT * FROM table1", Null)
WaitFor (SenderFilter) SQL_QueryComplete (SuccessAsBoolean, rsAsResultSet)
IfSuccessThen DoWhilers.NextRow Log(rs.GetInt2(0))
Loop rs.Close Else Log(LastException)
EndIf
ExecQuerySingleResult (QueryAsString) AsString
Executes the query and returns the value in the first column of the first row. Returns an empty string if no value was found. Example: DimNumberOfMatchesAsInt = SQL1.ExecQuerySingleResult("SELECT count(*) FROM table1 WHERE col2 > 300")
Executes the query and returns the value in the first column of the first row. Returns an empty string if no value was found. Example: DimNumberOfMatchesAsInt = SQL1.ExecQuerySingleResult2("SELECT count(*) FROM table1 WHERE col2 > ?", Array(300))
Initializes the database file. A new database will be created if the file does not exist (and CreateIfNecessary is true). The database file cannot be located in the assets folder.