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.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

SQL.SetParamTypesValues

Sets all parameters for a query in one call.

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

MBS( "SQL.SetParamTypesValues"; Command; Type; Value )

Parameters

Parameter Description Example value
Command The command reference number gained with SQL.NewCommand. $Command
Type Pass one type parameter for each value.
Type can be Default, Null, Unknown, Integer, Double, Text, Container, Boolean, Short, UShort, Long, ULong, Date, Time or TimeStamp.
"Integer"
Value Pass one parameter for each parameter. "Hello"

Result

Returns OK or error.

Description

Sets all parameters for a query in one call.
Please pass a type and a value for each parameter.
Please match the number of parameters in your SQL query and their order.
If value is the result of FM.NULL function in this plugin, the value is passed as NULL to the database.

Examples

Set 4 parameters:

MBS( "SQL.SetParamTypesValues"; $Command; "Text"; "Bob"; "Text"; "Miller"; "Date"; $BirthDay; "BLOB"; MyTable::PersonPicture )

Export row

# create command
Set Variable [$Command; Value:MBS("SQL.NewCommand"; $Connection; "INSERT INTO 'Test' (FirstName, LastName, Birthday, NumberOfOrders, TotalSales) VALUES (:1,:2,:3,:4,:5)")]
# fill all parameters
Set Variable [$result; Value:MBS("SQL.SetParamTypesValues"; $Command; "Text"; SQLite fun::FirstName; "Text"; SQLite fun::LastName; "Date"; SQLite fun::Birthday; "Integer"; SQLite fun::NumberOfOrders; "Double"; SQLite fun::TotalSales)]
# Run it
Set Variable [$result; Value:MBS("SQL.Execute"; $Command)]
# Cleanup
Set Variable [$result2; Value:MBS("SQL.Commit"; $Connection)]
Set Variable [$result2; Value:MBS("SQL.FreeCommand"; $Command)]

See also


SQL.SetParamNull   -   SQL.SetParamUnknown

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins