user3157674
user3157674

Reputation: 65

Filemaker Execute SQL with column name

I think this is a very dumb question but I just can't find how to do it.

I'm using ExecuteSQL in filemaker but I noticed the result text doesn't contain the column name, any idea how I can make the result show column name?

Thanks in advance!

Upvotes: 0

Views: 651

Answers (1)

michael.hor257k
michael.hor257k

Reputation: 116982

You could simply add a text line to your calculation, before calling the ExecuteSQL() function, e.g.:

"SomeField,AnotherField¶" 
& 
Execute SQL ( "SELECT SomeField, AnotherField FROM YourTable" ; "" ; "" )

Note that you can use the GetFieldName() function to protect your calculation against fields being renamed.

You can also use a query like:

SELECT * FROM FileMaker_Fields WHERE TableName='YourTable'

to retrieve ALL field names of a table.

Upvotes: 2

Related Questions