ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Error in PREPARE statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error in PREPARE statement

    I'm getting the following error at the PREPARE statement in a SQLRPGLE program during execution:

    SQLCODE: -204, SQLSTATE: 42704

    I'm not able to figure out what this is?

    Could someone please help?

  • #2
    Re: Error in PREPARE statement

    The error corresponds to

    "An undefined object or constraint name was detected."

    Now would it be possible for you to post the exact prepae statement?

    The following checks can also be done:-

    1.) Check if the field and file names used in the prepare statement are correct.
    2.) If the statement is dynamically built, check the logic to see if the query is constructed correctly.
    3.) If the file and field names are correct, check the library list and ensure the file is present in the list.

    Comment


    • #3
      Re: Error in PREPARE statement

      I'm building the statement dynamically and all the files and fields are there (i checked it some 10 times )

      Just an overview of my issue:
      -------------------------------------
      This SQLRPGLE returns a result set to a application that is based on .NET and I'm getting this error only when i test it with the .NET build,but if i execute the same prorgam on AS400 without any interfacing, it gives me a data without any issues

      Comment


      • #4
        Re: Error in PREPARE statement

        Hi,

        The message means:
        &1 in &2 type *&3 not found.

        Please check the value in SQLERM immediately after the prepare statement. There you'll find the replacements for &1, &2 and &3

        Birgitta

        Comment


        • #5
          Re: Error in PREPARE statement

          I'm getting the following values in SQLERM:

          'CFPRFP TVAC110FILE'

          Here CFPRFP is the file and TVAC110 is the schema name. But could you tell me what FILE stand for in this statement?

          The statement that I had build dynamically is as given below:
          Select GMCDRFP,TBLERFP,CBDRFP,SHFTRFP,CPIDRFD,PRIDRFD,ACC TRFd
          ,RACTRFD,ASEXRFD,RACERFD,AGERRFD,HARTRFD,HARCRFD,A TIRRFD,
          atICRFD,PATNRFD,USERRFD From CFPRFP Inner join CFPRFD On ACCTRfp = ACCTRFD And RACTRFP= RACTRFD
          Last edited by K400; August 18, 2009, 09:34 AM.

          Comment


          • #6
            Re: Error in PREPARE statement

            Originally posted by K400 View Post
            I'm getting the following values in SQLERM:

            'CFPRFP TVAC110FILE'

            Here CFPRFP is the file and TVAC110 is the schema name. But what does FILE stand for in this statement?

            The statement that I had build dynamically is as given below:
            Select GMCDRFP,TBLERFP,CBDRFP,SHFTRFP,CPIDRFD,PRIDRFD,ACC TRFd
            ,RACTRFD,ASEXRFD,RACERFD,AGERRFD,HARTRFD,HARCRFD,A TIRRFD,
            atICRFD,PATNRFD,USERRFD From CFPRFP Inner join CFPRFD On ACCTRfp = ACCTRFD And RACTRFP= RACTRFD
            file = table
            using the error message...fill in the blanks:
            CFPRFP in TVAC110 type *FILE not found.

            SQL naming convention equivalent:
            Table CFPRFP in schema TVAC110 not found.
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: Error in PREPARE statement

              Originally posted by K400
              This SQLRPGLE returns a result set to a application that is based on .NET and I'm getting this error only when i test it with the .NET build,but if i execute the same prorgam on AS400 without any interfacing, it gives me a data without any issues
              Change your library list on the .NET side to have the library name where the files/tables reside in.
              Last edited by Mercury; August 19, 2009, 06:47 AM. Reason: typo
              Philippe

              Comment

              Working...
              X