IT    Universe documentation - BCI

BCI

Contents:

Id Description Syntax E/W
ClearDiagnostics Use ClearDiagnostics in a procedure to clear any diagnostics from the SQL diagnostics area associated with @HSTMT. This removes any errors set by the procedure, allowing the procedure to return SQL.SUCCESS and a result to the calling program. No warning or error text is returned.   status = ClearDiagnostics ()    
GetDiagnostics Use GetDiagnostics in a procedure to return the current error text associated with @HSTMT. This text is the same as what would be returned to the output variable error by SQLError. The error text is removed from the SQL diagnostics area.   error = GetDiagnostics ()    
SQLAllocConnect Use this function to create a connection environment to connect to a particular data source. One SQL Client Interface environment can have several connection environments, one for each data source. The function stores the internal representation of the connection environment in the connect.env variable.   status = SQLAllocConnect (bci.env, connect.env)   N  
SQLAllocEnv Use this function to allocate memory for an SQL Client Interface environment. The function stores the address in the bci.env variable. SQLAllocEnv must be the first SQL Client Interface call issued in any application.   status = SQLAllocEnv (bci.env)   N  
SQLAllocStmt Use this function to allocate memory for an SQL statement environment.   status = SQLAllocStmt (connect.env, statement.env)   N  
SQLBindCol Use this function to tell the SQL Client Interface where to return the results of an SQLFetch call. SQLBindCol defines the name of the variable (column) to contain column results retrieved by SQLFetch, and specifies the data conversion (data.type) on the fetched data. SQLBindCol has no effect until SQLFetch is used.   status = SQLBindCol (statement.env, col#, data.type, column)    
SQLBindParameter Parameter markers are placeholders in SQL statements. Input parameter markers let a program send user-defined values with the SQL statement when an SQLExecute or SQLExecDirect call is executed repeatedly. Output parameter markers receive values returned from a called procedure. The placeholder character is ? (question mark). For more information about parameter markers, see "Using Parameter Markers in SQL Statements" in Chapter4.   status = SQLBindParameter ( statement.env, mrk#, data.type,
sql.type, prec, scale, param [, param.type] )  
 
SQLCancel This function is equivalent to the SQLFreeStmt call with the SQL.CLOSE option. It closes any open cursor associated with the SQL statement environment and discards pending results at the data source.   status = SQLCancel (statement.env)    
SQLColAttributes Use this function to get information about a column. SQLColAttributes returns the specific information requested by the value of col.attribute.   status = SQLColAttributes (statement.env, col#, col.attribute,
text.var, num.var)  
 
SQLColumns This function returns a result set in statement.env as a cursor of 12 columns describing those columns found by the search pattern (see SQLTables). As with SQLTables, the search is done on the SQL catalog. This is a standard result set that can be accessed with SQLFetch. The ability to obtain descriptions of columns does not imply that a user has any privileges on those columns.   status = SQLColumns (statement.env, schema, owner, tablename,
columnname )  
 
SQLConnect Use this function to connect to the data source specified by data.source. UniVerse data sources must be defined in the configuration file. Use the logon1 and logon2 parameters to log on to the DBMS specified by data.source.   status = SQLConnect (connect.env, data.source, logon1, logon2)   N  
SQLDescribeCol Use this function to get information about the column described by col#.   status = SQLDescribeCol (statement.env, col#, col.name,
sql.type, prec, scale, null)  
 
SQLDisconnect You cannot use SQLDisconnect within a transaction. An SQLDisconnect call issued within a transaction returns SQL.ERROR, and sets SQLSTATE to 25000. You must commit or roll back active transactions before disconnecting, and you must be in autocommit mode. If there is no active transaction, SQLDisconnect frees all SQL statement environments owned by this connection before disconnecting.   status = SQLDisconnect (connect.env)    
SQLError Use SQLError when a function returns a status value other than SQL.SUCCESS or SQL.INVALID.HANDLE. SQLError returns a value in sqlstate when the SQL Client Interface detects an error condition. The dbms.code field contains information from the data source that identifies the error.   status = SQLError (bci.env, connect.env, statement.env,
sqlstate, dbms.code, error)  
 
SQLExecDirect SQLExecDirect differs from SQLExecute in that it does not require a call to SQLPrepare. SQLExecDirect prepares the SQL statement or procedure call implicitly. Use SQLExecDirect when you do not need to execute the same SQL statement or procedure repeatedly.   status = SQLExecDirect (statement.env, statement)    
SQLExecute Use this function to repeatedly execute an SQL statement, using different values for parameter markers. You must use an SQLPrepare call to prepare the SQL statement before you can use SQLExecute. If the SQL statement specified in the SQLPrepare call contains parameter markers, you must also issue an SQLBindParameter call for each marker in the SQL statement before you use SQLExecute. After you load the parameter marker variables with data to send to the data source, you can issue the SQLExecute call. By se tting new values in the parameter marker variables and calling SQLExecute, new data values are sent to the data source and the SQL statement is executed using those values.   status = SQLExecute (statement.env)    
SQLFetch Use this function to retrieve the next row's column values from the result set at the data source and put them into the variables specified with SQLBindCol. SQLFetch performs any required data conversions (see AppendixA, "Data Conversion," for details).   status = SQLFetch (statement.env)    
SQLFreeConnect You must use SQLDisconnect to disconnect the connection environment from the data source before you release the connection environment with SQLFreeConnect, otherwise an error is returned.   status = SQLFreeConnect (connect.env)    
SQLFreeEnv You must use SQLFreeConnect to release all connection environments attached to the SQL Client Interface environment before you release the SQL Client Interface environment with SQLFreeEnv, otherwise an error is returned.   status = SQLFreeEnv (bci.env)    
SQLFreeStmt Use this function at the end of processing to free resources used by the SQL statement environment.   status = SQLFreeStmt (statement.env, option)    
SQLGetInfo This function supports all of the possible requests for information defined in the ODBC 2.0 specification. The #defines for info.type are contained in the ODBC.H include file.   status = SQLGetInfo (connect.env, info.type, info.value)    
SQLGetTypeInfo SQLGetTypeInfo returns a standard result set ordered by DATA.TYPE and TYPE.NAME. The following table lists the columns in the result set. For more detailed information about data type information, see the Microsoft ODBC 2.0 Programmer's Reference and SDK Guide   status = SQLGetTypeInfo (statement.env, sql.type)    
SQLNumResultCols Use this function after executing an SQL statement to find the number of columns in the result set. If the executed statement was not a SELECT statement or a called procedure that produced a result set, the number of result columns returned is 0.   status = SQLNumResultCols (statement.env, cols)    
SQLParamOptions You can use SQLParamOptions before or after you issue an SQLBindParameter call.   status = SQLParamOptions (statement.env, option, value)   E  
SQLPrepare Use this function to deliver either an SQL statement or a call to an SQL procedure to the data source where it can prepare to execute the passed SQL statement or the procedure. The application subsequently uses SQLExecute to tell the data source to execute the prepared SQL statement or procedure.   status = SQLPrepare (statement.env, statement)   N  
SQLRowCount Statements such as GRANT and CREATE TABLE, which do not update rows in the database, return 0 in rows.   status = SQLRowCount (statement.env, rows)    
SQLSetConnectOption The SQL.OS.UID and SQL.OS.PWD options let you specify user names and passwords for the operating system of a UniVerse server.   status = SQLSetConnectOption (connect.env, option, value)    
SQLSetParam SQLSetParam is a synonym for SQLBindParameter.      
SQLSpecialColumns Results are returned as a standard result set ordered by SCOPE. The following table lists the columns in the result set. The lengths of VARCHAR columns are maximums; the actual lengths depend on the data source. To get the length of the COLUMN.NAME column, use the SQL.MAX.COLUMN.NAME.LEN option of the SQLGetInfo function.   status = SQLSpecialColumns (statement.env, col.type,
schema, owner, tablename, IDscope, null)  
 
SQLStatistics SQLStatistics returns information as a standard result set ordered by NON.UNIQUE, TYPE, INDEX.QUALIFIER, INDEX.NAME, and SEQ.IN.INDEX. The result set combines statistics for the table with statistics for each index. The table below lists the columns in the result set.   status = SQLStatistics (statement.env, schema, owner,
tablename, index.type, accuracy)  
N  
SQLTables This function returns statement.env as a standard result set of five columns containing the schemas, owners, names, types, and remarks for all tables found by the search. The search criteria arguments can contain a literal, an SQL LIKE pattern, or be empty. If a literal or LIKE pattern is specified, only values matching the pattern are returned. If a criterion is empty, tables with any value for that attribute are returned. owner cannot specify a LIKE pattern. You can access the result set with SQLFetch. T hese five columns have the following descriptors:   status = SQLTables (statement.env, schema, owner, tablename,
type)  
 
SQLTransact This function provides the same transaction functions as the UniVerse BASIC statements COMMIT, and ROLLBACK. When connect.env is a valid connection environment with SQL.AUTOCOMMIT set to OFF, SQLTransact commits or rolls back the connection.   status = SQLTransact (bci.env, connect.env, type)    
SetDiagnostics On exiting an SQL procedure, if an error has been set in the SQL diagnostics area associated with @HSTMT, the procedure returns SQL.ERROR to the SQLExecute or SQLExecDirect function that called it. The caller can then invoke SQLError or GetDiagnostics to determine the SQLSTATE, native error number, and the error text. The error text is stored in the SQL diagnostics area associated with @HSTMT and remains available until the next programmatic SQL statement is executed.   status = SetDiagnostics (text)   E  

All documents copyright by their respective owners.

2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81