Difference between revisions of "Remote Data Connectivity"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) (→Sending SQL Queries and Statements) |
Yvonnemilne (Talk | contribs) (→Navigating the Result Set) |
||
Line 93: | Line 93: | ||
=====Navigating the Result Set===== | =====Navigating the Result Set===== | ||
* [[RDO_FETCH_ROW()|rdo_fetch_row()]] - return the next row from a result set as an object | * [[RDO_FETCH_ROW()|rdo_fetch_row()]] - return the next row from a result set as an object | ||
+ | |||
+ | <pre> | ||
+ | object = rdo_fetch_row(resultset as object) | ||
+ | </pre> | ||
+ | |||
* [[RDO_FETCH_OBJECT()|rdo_fetch_object()]] - return the next row from a result set as an object | * [[RDO_FETCH_OBJECT()|rdo_fetch_object()]] - return the next row from a result set as an object | ||
+ | |||
+ | <pre> | ||
+ | object = rdo_fetch_object(resultset as object) | ||
+ | </pre> | ||
+ | |||
* [[RDO_DATA_SEEK()|rdo_data_seek()]] - move the internal row pointer | * [[RDO_DATA_SEEK()|rdo_data_seek()]] - move the internal row pointer | ||
+ | |||
+ | <pre> | ||
+ | numeric = rdo_data_seek(resultset as object, row as numeric) | ||
+ | </pre> | ||
+ | |||
* [[RDO_FIELD_SEEK()|rdo_field_seek()]] - jump to a specified field in a result set | * [[RDO_FIELD_SEEK()|rdo_field_seek()]] - jump to a specified field in a result set | ||
+ | |||
+ | <pre> | ||
+ | numeric = rdo_field_seek(resultset as object, column as numeric) | ||
+ | </pre> | ||
=====Result Set Information===== | =====Result Set Information===== |
Revision as of 15:18, 28 July 2010
Contents
- 1 Remote Data Connectivity
- 1.1 Overview of Remote Data Connectivity Functions
- 1.2 Overview of Recital Data Objects (RDO)
- 1.3 Using Recital Client/Server
- 1.4 Using Recital with MySQL
- 1.5 Using Recital with PostgreSQL
- 1.6 Using Recital with Oracle
- 1.7 Using Recital with DB2
Remote Data Connectivity
Overview of Remote Data Connectivity Functions
- sqlcancel() - request that an executing SQL statement be cancelled
- sqlcolumns() - store column information to a cursor
- sqlcommit() - commit a transaction
- sqlconnect() - connect to a data source
- sqldisconnect() - disconnect from a data source
- sqlexec() - send an SQL statement to a data source
- sqlgetprop() - query property settings for a connection or the environment
- sqlmoreresult() - check if more results sets are available and if so, copy next results set to a cursor
- sqlprepare() - prepare an SQL statement that will be executed by the SQLEXEC() function
- sqlrollback() - rollback a transaction
- sqlsetprop() - set property settings for a connection
- sqlstringconnect() - connect to a data source using a gateway connection string
- sqltables() - store data source table names to a table
Overview of Recital Data Objects (RDO)
The RDO functions can be used for data access for both remote third-party/Recital and local Recital data sources. The functions allow a connection to be made to the data, SQL queries to be sent and the results to be loaded into a result set object for further processing.
Each MySQL compatible RDO function also has a MySQL-named equivalent for ease of use, e.g. rdo_connect() and mysql_connect() are synonyms.
Connecting to a Data Source
- rdo_connect() - connect to a data source
numeric = rdo_connect(servertype as character, hostname_or_ip as character, account as character, password as character [, database as character])
- rdo_select_db() - set the active database for a data source connection
numeric = rdo_select_db(database as character [, connection as numeric])
Disconnecting from a Data Source
- rdo_close() - close a data source opened with rdo_connect()
numeric = rdo_close(connection as numeric)
Sending SQL Queries and Statements
- rdo_exec() - execute a non-SELECT statement
numeric = rdo_exec(statement as string [, connection as numeric])
- rdo_query() - return a result set object for a SELECT query
object = rdo_query(query as string [, connection as numeric])
- rdo_unbuffered_query() - return a result set object for a SELECT query
object = rdo_unbuffered_query(query as string [, connection as numeric])
- rdo_fetch_array() - return the results of a query as an associative array
array = rdo_fetch_array(query as string)
- rdo_fetch_assoc() - return the results of a query as an associative array
array = rdo_fetch_assoc(query as string)
- rdo_real_escape_string() - escape special characters in a string for use in an SQL statement
string = rdo_real_escape_string(query as string [, connection as numeric])
- rdo_affected_rows() - return the number of rows affected by the last operation
numeric = rdo_affected_rows()
- rdo_info() - return information about the last query
string = rdo_info()
Processing Result Sets
- rdo_fetch_row() - return the next row from a result set as an object
object = rdo_fetch_row(resultset as object)
- rdo_fetch_object() - return the next row from a result set as an object
object = rdo_fetch_object(resultset as object)
- rdo_data_seek() - move the internal row pointer
numeric = rdo_data_seek(resultset as object, row as numeric)
- rdo_field_seek() - jump to a specified field in a result set
numeric = rdo_field_seek(resultset as object, column as numeric)
Result Set Information
- rdo_fetch_field() - return an object containing information about a field from a result set
- rdo_fetch_lengths() - return the length of the contents of each field in a result set
- rdo_num_fields() - return the number of fields in a result set
- rdo_num_rows() - return the number of rows in a result set
Field Information
- rdo_field_flags() - return the flags of a field in a result set
- rdo_field_len() - return the length of a field in a result set
- rdo_field_name() - return the name of a field in a result set
- rdo_field_type() - return the type of a field in a result set
- rdo_result() - return the value of a field in a result set
- rdo_field_table() - return the name of the table where a specified field is located
Freeing Memory
- rdo_free_object() - free memory used by a result set object
numeric = rdo_free_object(resultset as object)
- rdo_free_result() - free memory used by a result set object
numeric = rdo_free_result(resultset as object)
Getting Error Information
- rdo_errno() - return the number of the last error
numeric = rdo_errno()
- rdo_error() - return the error description of the last Recital error
string = rdo_errno()
Getting Environment Information
- rdo_get_client_info() - return information about the client
string = rdo_get_client_info()
- rdo_get_host_info() - return information about the connection
string = rdo_get_host_info(connection as numeric)
- rdo_list_dbs() - list the available databases for the current or specified connection
object = rdo_list_dbs([connection as numeric])
- rdo_ping() - check whether a server connection is active
logical = rdo_ping(connection as numeric)
- rdo_stat() - return the current system status of Recital
numeric = rdo_stat(connection as numeric)
- rdo_thread_id() - return the current thread ID
numeric = rdo_thread_id([connection as numeric])