Jump to content

This topic is 3522 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I saw it was added new in 13 but I do not remember its name so I can not find it to read up on how to do it.  It was something new added to SQL so we could ask for only the top x records.  What is it called?  Thank you for reading.

Posted (edited)

ExecuteSQL ( sqlQuery; fieldSeparator; rowSeparator {;arguments...} )

here is a great resource for discovering how to implement it.

http://filemakerhacks.com/2012/10/19/the-missing-fm-12-executesql-reference/

offset and fetch is what you need

http://help.filemaker.com/app/answers/detail/a_id/12061/~/specifying-offset-and-fetch-first-clauses-in-filemaker-pro-using-the-executesql

Edited by Ocean West
  • Like 2
  • 2 months later...
Posted (edited)

Has anyone had a problem using fetch with arguments (i.e. substituting the value with a '?')?

e.g.

executesql ("

SELECT * FROM t1 FETCH FIRST ?ROWS ONLY

";"";"";settings::global_row_specify)

does not work for me. But this does:

 

executesql ("

SELECT * FROM t1 FETCH FIRST " & settings::global_row_specify & " ROWS ONLY

";"";"";"")

 
Edited by sal88
Posted

Has anyone had a problem using fetch with arguments (i.e. substituting the value with a '?')?

That does not work; but you can use

ExecuteSQL ( "
  SELECT *
  FROM t1
  FETCH FIRST " & settings::global_row_specify " ROWS ONLY
  " ; "" ; "" 
)

This topic is 3522 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.