FastSaveData()


" "

short FastSaveData(long QueryID, Boolean Replace, BSTR TableName, BSTR TableSpaceName,
 [VARIANT Comment])

Description

This function runs the query specified by QueryID and saves the results of the query in the specified table and table space at the database server. You can use this function to save rows that have not been retrieved from the database. If the specified table already exists, the new data should have the same number and types of columns as the existing table.

Note:
Not all database servers are able to handle this type of process, so check with your system administrator if you receive errors when saving data with this method.

This function operates in a separate unit of work than other API functions, and its results are committed automatically. Calling Commit() or Rollback() will have no effect on changes made by this function.

Parameters

Name Description
QueryID The ID of the query, as returned from InitializeQuery().
Replace Use non-zero if you want the specified data to replace the existing data in the table. Use zero if you want the specified data to be appended to the existing data in the table.
TableName The name of the table in which you want to store the data. If the table does not exist, QMF for Windows will create it.
TableSpaceName The name of the table space in which the table exists or will be created. If TableSpaceName is omitted or is an empty string, QMF for Windows will use the default table space. If you have configured QMF for Windows to always use the default table space, this parameter is ignored. See RSR_SDDIFFERENTTS in the description for GetResourceLimit().
Comment Optionally, a string that specifies a comment for the table in which the data is saved.

Return Value

The return value will be zero if successful or non-zero if unsuccessful. If the return value is non-zero, you can call GetLastErrorString(), GetLastErrorType(), GetLastSQLCode(), GetLastSQLError(), or GetLastSQLState() to get additional error information.

Related Tasks

FastSaveDataEx()
GetResourceLimit()
GetResourceLimitEx()
SaveData()
SaveDataEx()