next up previous contents
Next: Beispielprogramme Up: Definitionsmodule Previous: SQL

SQLExt

 

 nnnnnn¯ 
DEFINITION SQLExt;

IMPORT SQL;

PROCEDURE AppendType (c: SQL.Connection; VAR str: ARRAY OF CHAR;

type: SQL.Type); (* appends the name of the Oberon data type, which is mapped to

its corresponding DB type, and its creation parameters to str. *)

PROCEDURE BrowseConnect (connStrIn: ARRAY OF CHAR;

VAR connStrOut: ARRAY OF CHAR); (* supports an iterative method of discovering

and enumerating the attributes and attribute values required to connect to a data

source. Each call of BrowseConnect returns successive levels of attributes and attribute values.

When all levels have been enumerated (c.ret is no longer SQL.NeedData), a connection

to the data source is completed and a connection string is returned which can be used as

input parameter to SQL.OpenUI. *)

PROCEDURE Cancel (s: SQL.Statement); (* cancels the processing on the statement.

A function may be running asynchronously, a function may need data. *)

PROCEDURE ColumnPrivileges (c: SQL.Connection; tableQual, tableOwner,

table, colPat: ARRAY OF CHAR): SQL.Statement; (* returns a prepared statement

holding the list of coluns and associated privileges for the specified table. *)

PROCEDURE Columns (c: SQL.Connection; tableQual, tableOwnerPat, tablePat,

colPat: ARRAY OF CHAR): SQL.Statement; (* returns a prepared statement holding

the list of column names in the specified tables. *)

PROCEDURE DataTypes (c: SQL.Connection; sqlType: INTEGER): SQL.Statement;

(* returns a prepared statement holding the list of data types supported by the database for

the specified sqlType (may be 0 inorder to enumerate all data types). *)

PROCEDURE DescribeParam (s: SQL.Statement; parIdx: INTEGER;

VAR sqlType: INTEGER; VAR prec: LONGINT; VAR scale, nullable: INTEGER); (* returns

the description of the specified parameter. parIdx 1. nullable can be 0 for the parameter does

not allow NULL values, 1 for the parameter allows NULL values, and 2 for the driver

cannot determine if the parameter allows NULL values. *)

PROCEDURE ForeignKeys (c: SQL.Connection; pkTableQual, pkTableOwner,

pkTable, fkTableQual, fkTableOwner, fkTable: ARRAY OF CHAR):

SQL.Statement; (* returns a prepared statement holding the list of foreign keys in the

specified table (columns in the specified table that refer to primary keys in other tables) or

the list of foreign keys in other tables that refer to the primary key in the specified table. *)

PROCEDURE FunctionImplemented (c: SQL.Connection;

functionNr: INTEGER): BOOLEAN; (* returns TRUE when the driver

(Driver Manager or driver itself) supports the specified ODBC function. *)

PROCEDURE GetColAttrib (s: SQL.Statement; colIdx, type: INTEGER;

VAR val: LONGINT); (* returns descriptor information for the specified column in

the result set, it cannot be used to return information about a bookmark column (colIdx=0).

The descriptor information is returned as a 32-bit descriptor dependent value or an integer

value in val. *)

PROCEDURE GetColAttribStr (s: SQL.Statement; colIdx, type: INTEGER;

VAR val: ARRAY OF CHAR); (* returns descriptor information for the specified

column in the result set, it cannot be used to return information about a bookmark column

(colIdx=0). The descriptor information is returned as a character string in val. *)

PROCEDURE GetCursorName (s: SQL.Statement;

VAR cursorName: ARRAY OF CHAR); (* returns the cursor name associated with the

statement. The only ODBC SQL statements that use a cursor name are position update and

delete (for example "UPDATE myTable ... WHERE CURRENT OF cursorName"). If the

application does not call SetCursorName to define a cursor name, on execution of a SELECT

statement the driver generates a name that begins with the letters SQL_CUR and does not

exceed 18 characters in length. *)

PROCEDURE MoreResults (s: SQL.Statement); (* determines whether there are more results

available on the statement (should be a SELECT, UPDATE, INSERT, or DELETE statement)

and, if so, initializes processing of those results *)

PROCEDURE NativeSQLStatement (c: SQL.Connection;

sqlIn: ARRAY OF CHAR; VAR sqlOut: ARRAY OF CHAR); (* returns the SQL string

as translated by the driver. *)

PROCEDURE NumParams (s: SQL.Statement): INTEGER; (* returns the number of

parameters associated with the statement, can only be called after the statement was prepared. *)

PROCEDURE NumResultCols (s: SQL.Statement): INTEGER; (* returns the number of

columns in the result set associated with the statement. *)

PROCEDURE PrimaryKeys (c: SQL.Connection; tableQual, tableOwner,

table: ARRAY OF CHAR): SQL.Statement; (* returns a prepared statement holding the

column names that comprise the primary key for a table. This function does not support

returning primary keys from multiple tables in a single call. *)

PROCEDURE ProcedureColumns (c: SQL.Connection; procQual, procOwnerPat,

procPat, colPat: ARRAY OF CHAR): SQL.Statement; (* returns a prepared statement

holding the list of input and output parameters, as well as the columns that make up the

result set for the specified procedures. *)

PROCEDURE Procedures (c: SQL.Connection; procQual, procOwnerPat,

procPat: ARRAY OF CHAR): SQL.Statement; (* returns a prepared statement holding the

list of procedure names stored in a specific data source. Procedure is a generic term

used to describe an executable object or a named entity that can be invoked using input and

output parameters, and which can return result sets similar to the result sets returned by

SQL SELECT expressions. *)

PROCEDURE SetCursorName (s: SQL.Statement; cursorName: ARRAY OF CHAR);

(* associates the specified cursor name with the statement. The only ODBC SQL statements

that use a cursor name are positioned update and delete (for example "UPDATE myTable ...

WHERE CURRENT OF cursorName"). If the application does not call SetCursorName to

define a cursor name, on execution of a SELECT statement the driver generates a name that

begins with the letters SQL_CUR and does not exceed 18 characters in length. All cursor

names associated with a connection must be unique. *)

PROCEDURE SetCursorPos (s: SQL.Statement; rowIdx, option, lock: INTEGER); (* sets the

cursor position in a rowset and allows an application to refresh, update, delete, or add data

to the rowset. *)

PROCEDURE SetScrollOptions (s: SQL.Statement; concurrency: INTEGER;

rowsInKeyset: LONGINT; rowsInRowset: INTEGER); (* sets options that control the

behaviour of cursors associated with the statement in the areas of concurrency control,

sensitivity to changes made by other transactions, and rowset size. In ODBC 2.0

SetScrollOptions has been superceded by the SQL_CURSOR_TYPE, SQL_CONCURRENCY,

SQL_KEYSET_SIZE, and SQL_ROWSET_SIZE statement options. *)

PROCEDURE SpecialColumns (c: SQL.Connection; colType: INTEGER;

tableQual, tableOwner, table: ARRAY OF CHAR; scope,

nullable: INTEGER): SQL.Statement; (* returns a prepared statement holding information

about columns within the specified table, namely the optimal set of columns that uniquely

identifies a row in the table (when colType = SQL_BEST_ROWID) or the columns

that are automatically updated when any value in the row is updated by a transaction (when

colType = SQL_ROWVER). *)

PROCEDURE Statistics (c: SQL.Connection; tableQual, tableOwner,

table: ARRAY OF CHAR; indexType, accuracy: INTEGER): SQL.Statement; (* returns

a prepared statement holding a list of statistics about a single table and the indexes associated

with the table. *)

PROCEDURE TablePrivileges (c: SQL.Connection; tableQual, tableOwnerPat,

tablePat: ARRAY OF CHAR): SQL.Statement; (* returns a prepared statement holding a

list of tables and the privileges associated with each table. *)

PROCEDURE Tables (c: SQL.Connection; tableQual, tableOwnerPat,

tablePat, tableTypes: ARRAY OF CHAR): SQL.Statement; (* returns a prepared

statement holding a list of all table names in the specified data source. tableTypes can hold

a list of table types to match (e.g. "TABLE, VIEW" or "'TABLE', 'VIEW'"). *)

END SQLExt.



next up previous contents
Next: Beispielprogramme Up: Definitionsmodule Previous: SQL



Christoph Steindl
Thu Jul 24 14:37:19 MET DST 1997