ACF Library

DemoGetSQLdata

Back to List

Description: A short demo to demonstrate the named placeholders and the INTO statement in ACF-plugin SQL.

FileMaker Prototype:

Set Variable [$res; ACF_Run("DemoGetSQLdata"; string_prefix)]

Category: SQL

Function source:

function DemoGetSQLdata (string prefix)
    // Declare arrays for the SQL
    array string aNames, aPositions; 
    array date aHiredDate; 
    array int aid; 
    
    string sql = "SELECT id, name, position, hiredDate FROM emplyees
    WHERE department_fk = :prefix

    INTO :aid, :aNames, :aPositions, :aHiredDate"; 

    string res = ExecuteSQL (sql); 
    // Res = OK, or error message. 
    // The result is in the arrays. 
    // Do something with the data.....
    return res; 
end

Back to List