Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   Crossplatform   Server (Not)   Client   Components   Old   Guides
New in version: 5.0   5.1   5.2   5.3   5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1    Statistic  

SQL.Execute

Executes the current command.

Component: SQL
Version: 2.6
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "SQL.Execute"; Command )

Parameters

Parameter Description Example value
Command The command reference number gained with SQL.NewCommand. $Command

Result

Returns "OK" or error message.

Description

Executes the current command.

Use the Execute method to execute the query or stored procedure specified in the command text. Execute method calls Prepare method implicitly if needed. If the command has input parameters, they should be bound before calling Execute method. Input parameters represented by param object. To bind input variables, use the SetParam commands.
A command (an SQL statement or procedure) can have a result set after executing. To check whether a result set exists use SQL.isResultSet method. If result set exists, a set of Field objects is created after command execution. Rows from the result set can be fetched one by one using SQL.FetchNext method. To get field description or value use Field method.

Output parameters represented by param objects. They are available after command execution.

Examples

Executes a command:

MBS("SQL.Execute"; $Command)

Create a table:

// create comand
$Command = MBS("SQL.NewCommand"; $Connection; "CREATE TABLE Test(FirstName VARCHAR, LastName VARCHAR, Birthday date, NumberOfOrders integer, TotalSales double)"
// run it
$result2 = MBS("SQL.Execute"; $Command)
// commit changed
$result3 = MBS("SQL.Commit"; $Connection)
// and free command
$result4 = MBS("SQL.FreeCommand"; $Command)

See also


SQL.Disconnect   -   SQL.FetchFirst

Feedback: Report problem or ask question.




Links
MBS Real Studio Plugins - Christians Software aus Nickenich