EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
Expand all | Collapse all

SQL Close

Discussion Topic

Discussion TopicWed October 28, 2015 10:32 AM

  • 1.  SQL Close

    Posted Wed October 28, 2015 10:32 AM

    Hi Folks,

     

    I have a sample EGL SQL statement code:

     

    open AB07 with #sql{

    SELECT AB07REMA

       FROM TEST.AB07

    WHERE AB07PROG = :AB2000_WRK.W_NPRO };

    get next from AB07 INTO AB07RS.AB07REMA;

    but not accept

    close AB07;

    IWN.VAL.6659.e 312/14 AB2000 - Invalid identifier AB07. The target of a close statement must be a printform, an SQL, MQ,

    indexed, relative, CSV, or serial record variable, or a result set identifier.

    Why the close does not accept ? if the AB07 is a result set identifier.

    it's accept when close AB07RS; sql record

     

    Hsieh


  • 2.  Re: SQL Close

    Posted Wed October 28, 2015 11:30 AM

    Hsieh,

     

    I tried your source on RBD 9.1.1 and it worked fine for me when I used the result set.

     

    As a question..do you have build automatically turned on?

     

    If you can attach the .egl files associated with this (record, function, and containing program), then I will take a look.  

     

    take care.

     

    Mark

    markevans


  • 3.  Re: SQL Close

    Posted Wed October 28, 2015 02:18 PM

    Hi Mark,

    I have installed RBD 9.1.1.

    I was isolating a pece of egl code to send for you and I found the problem and i think it is a bug.

    record AB2000_WRK type basicRecord

    W_NPRO char(9);

    AB07REMA char(65);

    AB07 char(15);

    end

    program Prog3 type BasicProgram

    {includeReferencedFunctions = yes, allowUnqualifiedItemReferences = yes, throwNrfEofExceptions = yes, handleHardIOErrors = no, V60ExceptionCompatibility = yes, I4GLItemsNullable = no, textLiteralDefaultIsString = no, localSQLScope = yes}

    AB2000_WRK AB2000_WRK;

    function main()

    open AB07

    with #sql{

    SELECT AB07REMA

    FROM TEST.AB07

    WHERE AB07PROG = :AB2000_WRK.W_NPRO

    };

    get next from AB07 into AB2000_WRK.AB07REMA;

    close AB07;

    end

    end

     

    Notices: the AB07 is result set identified and it has same name variable field AB07 defined in AB2000_WRK record without structure level.

    This sample egl code close AB07 is accept and no error.

    But after changed AB2000_WRK record with structure level

    record AB2000_WRK type basicRecord

    01 W_NPRO char(9);

    01 AB07REMA char(65);

    01 AB07 char(15);

    end

    close AB07 is not accept

    IWN.VAL.6659.e 312/14 AB2000 - Invalid identifier AB07. The target of a close statement must be a printform, an SQL, MQ,

    indexed, relative, CSV, or serial record variable, or a result set identifier.

     

    Hsieh


  • 4.  Re: SQL Close

    Posted Wed October 28, 2015 02:30 PM

    Hsieh,

     

    Ok.. I can see where that might be a conflict and it might be working as designed since you are using duplicate names and the program says it should allow unqualified item references.   But since it works with non structured records, we can investigate if you would open a PMR and attach the .egl to that.

    markevans


  • 5.  Re: SQL Close

    Posted Wed October 28, 2015 02:37 PM

    Ok ! Mark.

    I will opened a PMR.

    Thanks a lot.

    Hsieh