Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

SQL.SetCommandOption

Sets a string value of a specific command option.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
SQL 2.6 Yes Yes Yes Yes Yes

MBS( "SQL.SetCommandOption"; Command; Key; Value )

Parameters

Parameter Description Example value
Command The command reference number gained with SQL.NewCommand. $Command
Key A string key of the command option. ""
Value The new value. ""

Result

Returns "OK" or error message.

Description

Sets a string value of a specific command option.

Call this method to set value(s) of server specific command options. See Server specific notes.

A command related option may be specified in either connection object or command object. If it is specified in connection object it affects all the commands on that connection.

If an option is not specially assigned to the command object the Library takes this option from related connection object (see SQL.GetCommandOption function). If an option is not specified in neither command nor connection objects, the Library takes the default option value.

SQL.SetCommandOption method is safe to use in cross-server applications. An option related to a particular server does not affect others.

see also
http://www.sqlapi.com/OnLineDoc/Command_setOption.html

Examples

Requests a scrollable record set:

MBS( "SQL.SetCommandOption"; $Command; "Scrollable"; "True" )

Store MySQL RecordSet locally:

MBS( "SQL.SetCommandOption"; $Command; "HandleResult"; "Store" )

Requests 100 rows to be prefetched:

MBS( "SQL.SetCommandOption"; $Command; "PreFetchRows"; "100" )

Set an option we may for ODBC to FileMaker:

MBS( "SQL.SetCommandOption"; $Command; "ODBCAddLongTextBufferSpace"; "false" )
// newer plugins automatically set it right when connecting to FileMaker

Allow multple connections for Microsoft SQL Server:

MBS( "SQL.SetCommandOption"; $Command; "SQL_ATTR_CURSOR_TYPE"; "SQL_CURSOR_DYNAMIC" )

See also


SQL.SetClient   -   SQL.SetCommandTag

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos