sId | (String) Unique identifier that is used by the PmaAdo object to store the result data in the form of the AdoRecordset object.
If an empty string ("") is used, then the SQL statement is executed and the data is returned in the form of the AdoRecordset object, but the PmaAdo object will not store it. This is handy if it is necessary to execute some SQL query in the script and process the resulting data immediately, and release the AdoRecordset object right after that. Empty string is also entered if entered statement does not return the resulting data. |
---|---|
sCommand | (String) Usually, it is statement in the SQL language syntax (INSERT, UPDATE, DELETE, etc.), that does not return any data in the form of the AdoRecordset object.
It can also return the data in the form of the AdoRecordset object containing SQL query SELECT, table name, calling the saved procedure, name or URL address of the file containing the saved AdoRecordset object. |
sParams | (String) Additional parameters of the DbExecute method. Entries are in the KeyVal format, for example "command:text;execute:norecords;return:map;".
"command:xxx;" (optional) - Specifies how the corresponding ADO Provider evaluates the sSource parameter, especially if it contains something different than query/statement in the SQL language syntax (e.g. SELECT, INSERT, etc.).
text (default) - Specifies that the ADO Provider should evaluate the sSource parameter as a textual definition of a command.
It corresponds to the ADO adCmdText value. table - Specifies that the ADO Provider should generate an SQL query to return all records of the database table named in the sSource parameter.
It corresponds to the ADO adCmdTable value. storedproc - Specifies that the ADO Provider should evaluate the sSource parameter as a stored procedure.
It corresponds to the ADO adCmdStoredProc value. file - Specifies that a persisted (saved) AdoRecordset object should be restored from the file named in the sSource parameter.
It corresponds to the ADO adCmdFile value. tabledirect - Specifies that the ADO Provider should return all records of the database table named in the sSource parameter.
It corresponds to the ADO adCmdTableDirect value. unknown - Specifies that the type of command in the sSource parameter is not known. The ADO Provider will try to evaluate it, but it will just consume more time.
It corresponds to the ADO adCmdUnknown value. "execute:xxx;" (optional) - Specifies the corresponding ADO Provider how to execute the SQL query. The default mode is the synchronous query, it means that the method waits for the operation result.
async - Asynchronous query, it means that the method does not wait for the operation result.
It corresponds to the ADO adAsyncExecute value. asyncfetch - Specifies that the rows defined by the ADO Recordset.CacheSize property are to be read synchronously and any remaining rows should be fetched asynchronously.
It corresponds to the ADO adAsyncFetch value. asyncfetchnonblocking - Specifies that the main thread will never be blocked while reading is being processed. If the requested row is not read, then the cursor will be moved to the end.
It corresponds to the ADO adAsyncFetchNonBlocking value. norecords - Specifies that the called query/statement does not return any data. If so, then the data will be discarded and not returned (no AdoRecordset object = value null for JavaScript or Nothing for VBScript).
It corresponds to the ADO adExecuteNoRecords value. record - Specifies that the called query/statement returns a single row, that is in the form of the AdoRecord object.
It corresponds to the ADO adExecuteRecord value. "return:xxx;" (optional) - Specifies whether the method return value is a map containing multiple values (new procedure) or a single value (old procedure).
If not set, then the old procedure is used. map - Returns a map (PmMap object) containing multiple returned values (new procedure) (e.g. Result, AffectedRows, ErrorCode, ErrorText). |
var oDb = pMe.Pm("/TestAdoDb");
oDb.DbExecute("", "INSERT table1 (name, value) VALUES ('pi', 3.14)", "");