Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > SQLRetrieve FunctionThis custom VB function fetches the results of a pending query on the connection specified by connection and returns the results in the destination() array. NOTE: Siebel VB SQLxxxx functions are supported for non-Unicode databases only. SyntaxSQLRetrieve(connection, destination()[, maxColumns][, maxRows] ReturnsA variant containing the following values: UsageIf maxColumns or maxRows is omitted, the array size is used to determine the maximum number of columns and rows retrieved, and an attempt is made to return the entire result set. Extra rows can be retrieved by using SQLRetrieve again and by setting fetchFirst to 0. If maxColumns specifies fewer columns than are available in the result, SQLRetrieve discards the rightmost result columns until the results fit the specified size. When columnNames is nonzero, the first row of the array is set to the column names as they are specified by the database schema. When rowNumbers is nonzero, row numbers are returned in the first column of destination(). SQLRetrieve clears the user's array prior to fetching the results. When fetchFirst is nonzero, it causes the result set to be repositioned to the first row if the database supports the function. If the database does not support repositioning, the result set -1 error is returned. If there are more rows in the result set than can be contained in the destination() array or than have been requested using maxRows, the user can make repeated calls to SQLRetrieve until the return value is 0. CAUTION: This function, as well as the other SQL functions available in Siebel VB, should not be used to query the underlying database. Use the Siebel Object Interfaces to query Siebel data. Use the SQL functions only to query non-Siebel data. ExampleThis example retrieves information from a data source. Sub Button_Click Dim connection As Long ' retrieve the first 50 rows with the first 6 columns of retcode = SQLRetrieve(connection: = connection, _ ' Get the next 50 rows of from the result set ' Close the connection See AlsoSQLClose Function |
Siebel VB Language Reference |