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

SQL.GetFieldAsText

Returns field's value as text value; converts if needed.

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

MBS( "SQL.GetFieldAsText"; Command; Field )

Parameters

Parameter Description Example value
Command The command reference number gained with SQL.NewCommand. $Command
Field The name or one based index of the field. $Field

Result

Returns text or error message.

Description

Returns field's value as text value; converts if needed.
see also:
http://www.sqlapi.com/OnLineDoc/ValueRead_asString.html

Examples

Read field value of field "FirstName" into variable:

$firstname = MBS("SQL.GetFieldAsText"; $command; "FirstName")

Run a stored procedure:

# new command for calling our test procedure on a Microsoft SQL Server
Set Variable [$command; MBS( "SQL.NewCommand"; $Connection; "dbo.Test" ) ]
# set a parameter
Set Variable [$r; MBS( "SQL.SetParamAsNumber"; $Command; "Param1"; 7 ) ]
# execute query
Set Variable [$r; MBS( "SQL.Execute"; $Command ) ]
# fetch first record
Set Variable [$r; MBS( "SQL.FetchNext"; $Command ) ]
# get result field
Set Variable [$result; MBS( "SQL.GetFieldAsText"; $Command; 1 ) ]

See also

Example Databases


SQL.GetFieldAsPNG   -   SQL.GetFieldAsTime

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins