What is correct syntax for SQL for Maxrecords in OS400/DB2?

pts.
Tags:
AS/400
IBM DB2
SQL Server
What is correct syntax for SQL for Maxrecords in OS400/DB2? We have a process automatically generating SQL code. However, our iSeries doesn't recognise the code it generates for maxrecords. Here are the examples of what I mean. The DB2 database seems happy with SELECT I1PHON,I1ACC,I1ACC1, FROM "TRNGDATA1"."OICRT1" FETCH FIRST 1 ROWS ONLY However the standard sql code generated automatically to do the same reads: SELECT I1PHON,I1ACC,I1ACC1, FROM "TRNGDATA1"."OICRT1? maxrecords=-1) This doesn't get accepted by iseries. Does anyone have some ideas how I can get round this? Sorry, I'm not an SQL guru! Thanks. Can you find out whether the DB2 database handles this parameter?

Answer Wiki

Thanks. We'll let you know when a new response is added.

I don’t believe that MAXRECORDS is part of the “SQL Standard”. I know a few databases (big ones included) have implemented it, but it’s not a part of DB2. I believe it can be set as a property on OLE and ADO DB providers.

sorry :-(

===================================================

Your automatic generator doesn’t generate standard SQL. It generates a proprietary extension that is appropriate only to certain DBMSs and can’t be used cross-platform. Get a different tool.

Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Baloni
    SELECT TOP 1 I1PHON,I1ACC,I1ACC1, FROM "TRNGDATA1
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following