Database library

Typelibrary
DictionaryLCS
LibraryLiveCode Script
Synonymsdatabase libraries,database library
RelatedGlossary: ODBC, LiveCode custom library
Description

The LiveCode custom library that supports connections to MySQL, PostgreSQL, ODBC, Valentina, and Oracle (LiveCode Enterprise only) databases.

Tagsdatabase
TypeNameSummarySyntax
commandrevCloseCursor

Closes a redcord set|record set (database cursor).

revCloseCursor <recordSetID>

- - -revCloseDatabase

Closes the connection to a database.

revCloseDatabase <databaseID>

- - -revCommitDatabase

Saves recent changes to a database.

revCommitDatabase <databaseID>

- - -revExecuteSQL

Executes a SQL statement on a database.

revExecuteSQL <databaseID>, <SQLStatement> [,{<variablesList> | <arrayName>}]

- - -revMoveToFirstRecord

Moves to the first record of a record set (glossary).

revMoveToFirstRecord <recordSetID>

- - -revMoveToLastRecord

Moves to the last record of a record set (glossary).

revMoveToLastRecord <recordSetID>

- - -revMoveToNextRecord

Moves to the next record in a record set (glossary).

revMoveToNextRecord <recordSetID>

- - -revMoveToPreviousRecord

Moves to the previous record in a record set (glossary).

revMoveToPreviousRecord <recordSetID>

- - -revMoveToRecord

Moves to the specified record in a record set.

revMoveToRecord <recordSetId>, <recordNumber>

- - -revRollBackDatabase

Rolls back recent changes to a database.

revRollBackDatabase <databaseID>

- - -revSetDatabaseDriverPath

Specifies where the Database library should look for database drivers.

revSetDatabaseDriverPath <driverFolder>

functionrevCurrentRecord

Returns the number of the current record in a record set.

revCurrentRecord(<recordSetID>)

- - -revCurrentRecordIsFirst

Returns whether the current record is the first record in a record set (glossary).

revCurrentRecordIsFirst(<recordSetID>)

- - -revCurrentRecordIsLast

Returns whether the current record is the last record in a record set (glossary).

revCurrentRecordIsLast(<recordSetID>)

- - -revDatabaseColumnCount

Returns the number of database fields in a record set (glossary).

revDatabaseColumnCount(<recordSetID>)

- - -revDatabaseColumnIsNull

Returns true if the specified database field has a null value, false otherwise.

revDatabaseColumnIsNull(<recordSetID>, <columnNumber>)

- - -revDatabaseColumnLengths

Returns the maximum field sizes in a record set (glossary).

revDatabaseColumnLengths(<recordSetID>)

- - -revDatabaseColumnNamed

Returns data from a specified database field in a database.

revDatabaseColumnNamed(<recordSetID>, <columnName> [, <holderVariable>])

- - -revDatabaseColumnNames

Returns the list of database field names in a record set or a database table

revDatabaseColumnNames(<recordSetOrConnectionId> [, <tableName>])

- - -revDatabaseColumnNumbered

Returns data from a specified database field.

revDatabaseColumnNumbered(<recordSetID>, <columnNumber> [, <holderVariable>])

- - -revDatabaseColumnTypes

Returns the data types of the columns in a record set.

revDatabaseColumnTypes(<recordSetID>)

- - -revDatabaseConnectResult

Returns the most recent error message for a database.

revDatabaseConnectResult(<databaseID>)

- - -revDatabaseCursors

Returns the record set IDs associated with a connection to a database.

revDatabaseCursors(<databaseID>)

- - -revDatabaseID

Returns the database ID of the database that opened a record set.

revDatabaseID(<recordSetID>)

- - -revDatabaseTableNames

Returns a list of the table names in the current database.

revDatabaseTableNames(<databaseID>)

- - -revDatabaseType

Returns the type of database associated with a connection.

revDatabaseType(<databaseID>)

- - -revDataFromQuery

Gets records from a database according to a SQL query and places the resulting data in a variable, without creating a record set.

revDataFromQuery([<columnDelim>],[<rowDelim>], <databaseID>, <SQLQuery> [, <varsList>])

- - -revdb_closecursor

Executes the revCloseCursor command.

revdb_closecursor(<recordSetID>)

- - -revdb_commit

Executes the revCommitDatabase command.

revdb_commit(<databaseID>)

- - -revdb_disconnect

Executes the revCloseDatabase command.

revdb_disconnect(<databaseID>)

- - -revdb_execute

Executes the revExecuteSQL command.

revdb_execute(<databaseID>, <SQLQuery> [, <variablesList>])

- - -revdb_movefirst

Executes the revMoveToFirstRecord command.

revdb_movefirst(<recordSetID>)

- - -revdb_movelast

Executes the revMoveToLastRecord command.

revdb_movelast(<recordSetID>)

- - -revdb_movenext

Executes the revMoveToNextRecord command.

revdb_movenext(<recordSetID>)

- - -revdb_moveprev

Executes the revMoveToPreviousRecord command.

revdb_moveprev(<recordSetID>)

- - -revdb_rollback

Executes the revRollBackDatabase command.

revdb_rollback(<databaseID>)

- - -revGetDatabaseDriverPath

Returns the folder where the Database library looks for database drivers

revGetDatabaseDriverPath()

- - -revNumberOfRecords

Returns the number of records in a record set (glossary).

revNumberOfRecords(<recordSetID>)

- - -revOpenDatabase

Connects to a MySQL, SQLite, PostgreSQL, ODBC or Oracle database.

revOpenDatabase("mysql", <hostAddress>, <databaseName>, [<userName>],[<passWord>],[<useSSL>], [<socketAddr>], [<rwTimeout>], [<autoReconnect>])

revOpenDatabase("odbc", <hostAddress>, <databaseName>, [<userName>],[<passWord>],[<cursorType>])

revOpenDatabase("sqlite",<filePath>,[<sqliteOptions>])

revOpenDatabase("postgresql", <hostAddress>, <databaseName>, [<userName>], [<passWord>] [, <sslOption> ...])

revOpenDatabase("oracle", <hostAddress>, <databaseName>, [<userName>],[<passWord>])

- - -revOpenDatabases

Returns a list of open databases.

revOpenDatabases()

- - -revQueryDatabase

Selects records in a database according to a SQL query.

revQueryDatabase(<databaseID>, <SQLQuery> [,{<variablesList> | <arrayName>}])

- - -revQueryResult

Returns the most recent error message associated with a record set (glossary).

revQueryResult(<recordSetID>)