Embedded SQL Pre-Compiler issue

15 pts.
Tags:
as-400 rpgle
AS400 - Embedded SQL
non-existent file name
Why would the SQL Pre-Compile check fail to recognize an invalid/non-existent file name in a SQL Statement?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 5  Replies

 
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.
  • ToddN2000
    I believe it might be only checking the syntax of the SQL statement. Post the SQL code so we can see if there is another issue. If you are not qualifying the file location, verify that the file does not exist in any library in the JOBD as well.
    117,375 pointsBadges:
    report
  • Jmfuchs

    I did validate that the file referenced in the SQL statement did not exist as any type of object on the system.

    I had the name of the file spelled incorrectly (CPRCONPF instead of CPRECONPF).

    I did notice that it is reported as a Warning in the compile but would have expected that it would have failed the pre-compile edits as I have seen previously when compiling embedded SQL statements.

    Not sure why it kicks out in some cases and not others. Will chalk it up to being a requirement for myself to check the listings when I get a good compile to review the warnings.

    15 pointsBadges:
    report
  • GregManzo
    The file might not exist at compile time, but will at run time. I often have code to create a workfile in QTEMP and then run "insert into QTEMP/workfile select <fields> from etc.". If the compile failed because the QTEMP workfile didn't exist I'd have to compile interactively.
    2,855 pointsBadges:
    report
  • BigKat
    if the file exists and you spell a field wrong, it will error, but if the file doesn't exist, the pre-compiler just syntax checks assuming the file WILL exist at run-time and the field types will match, etc.

    9,270 pointsBadges:
    report
  • TheRealRaven
    The simple answer is that it's not always a SQL error for a file not to exist at compile-time. It's always an error not to exist at run-time. We'd need to see the relevant code to know why you didn't receive SQL1001, "External file definition for filename not found."
    29,400 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.

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

Following

Share this item with your network: