Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
SQLRetrieveToFile Function
This custom VB function fetches the results of a pending query on the connection specified by connection and stores them in the file specified by destination.
NOTE: Siebel VB SQLxxxx functions are supported for non-Unicode databases only.
Syntax
SQLRetrieveToFile(connection, destination[, columnNames][, columnDelimiter])
Returns
If successful, a variant containing the number of rows in the result set; if unsuccessful, -1.
Usage
The arguments must be named arguments. For information about named arguments, read Named Arguments and Call Statement.
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.
Example
This example opens a connection to a data source and retrieves information to a file.
Sub Button_Click
'DeclarationsDim connection As Long
Dim destination(1 To 50, 1 To 125) As Variant
Dim retcode As long'open the connection
connection = SQLOpen("DSN = SblTest",outputStr,prompt: = 3)
' Execute the query
query = "select * from customer"
retcode = SQLExecQuery(connection,query)
'Place the results of the previous query in the file
'named by filename and put the column names in the file
'as the first row.
'The field delimiter is %filename = "c:\myfile.txt"
columnDelimiter = "%"
retcode = SQLRetrieveToFile(connection: = connection, _
destination: = filename, columnNames: = 1, _
columnDelimiter: = columnDelimiter)retcode = SQLClose(connection)
End Sub
See Also
SQLClose Function
SQLError Function
SQLExecQuery Function
SQLGetSchema Function
SQLOpen Function
SQLRequest Function
SQLRetrieve Function
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |