Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ODBC LIMIT command. Limit returned rows

Featured Replies

This does not seem to work for me. Does anyone know where I should place the limit property so that I can control how many results are returned?

Here is a (basic) MySQL example:

"Select 'fieldname' FROM table LIMIT 0,10"

This brings back the first 10 records it finds. This causes an error when trying this query with PHP and FileMaker via ODBC.

Error is as follows:

SQL error: [DataDirect][ODBC SequeLink driver][ODBC Socket][DataDirect][ODBC FileMaker driver][FileMaker]Parse Error in SQL, SQL state S1000 in SQLExecDirect

Thanks in advance,

Jim.

Though it seems to be an indispensable feature, you cannot do this in FileMaker ODBC/JDBC, currently.

Please submit a feature request.

http://www.filemaker.com/company/feature_request.html

--

If FileMaker PHP API or FX.php can be your platform, they have corresponding feature, I think.

  • Author

Do you know this for sure?

I cannot believe that this was not included in the ODBC specification. I cannot use FX.php in this instance as I have AND and OR requests in the query. Thanks for your rapid response.

Jim.

I cannot use FX.php in this instance as I have AND and OR requests in the query

... Why not? You just generate multiple find requests.

  • Author

Thanks again for your reply.

How to do a multiple find requests in FX.php then? (With the following as an example).

SQL ~ SELECT * FROM TABLE1 WHERE (Field1='1' OR Field1='2' OR Field1='5') AND (Field2='a' OR Field2='b' OR Field2='e')

How do I do the above example SQL request with FX.PHP?

$userQuery = new FX($serverIP, $webCompanionPort, $dataSourceType);

$userQuery->SetDBData ($HostDB, 'LayoutName');

$userQuery->SetDBUserPass('user', 'pass');

$userQuery->AddDBParam('Field1', '1');

$userQuery->AddDBParam('Field1', '2');

$userQuery->AddDBParam('Field1', '5');

$userQuery->AddDBParam('Field2', 'a');

$userQuery->AddDBParam('Field2', 'b');

$userQuery->AddDBParam('Field2', 'e');

$userQuery->AddDBParam('-lop', 'or');

$userData=$userQuery->FMFind();

The above FX.php would not give the same result as the SQL.

Thanks,

Jim.

Oh right, because in this case it's searching or over any of the fields?

If there's a -lop or, surely there's a -lop and?

  • Author

That is correct, there is a -lop 'and'.

However FX.PHP uses one or the other. You cannot combine a "-lop 'and'" and a "-lop 'or'" in the same request.

Thanks,

Jim.

Go ask this question at: www.fmwebschool.com/frm , you'll probably get a better response for Fx.php and FM API related questions there.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.