×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Mark,

Can you show an example of the code from the stored procedure.

Thanks,
Cary Phillips

-----Original Message-----
    From: "MWalter@hanoverwire.com"<MWalter@hanoverwire.com>
    Sent: 11/20/02 1:55:58 PM
    To: "rpg400-l@midrange.com"<rpg400-l@midrange.com>
    Subject: Embedded SQL

    Hello all,

    I have a stored Procedure that when the SQL statement that is executed in
    the SP, I get a 26501 but when I copy the same stored procedure to
    interactive SQL, It runs fine. Here is the statement that is being
    executed:

     SELECT a.trndt,a.invnr,c.cusnm, c.cusa1,c.cusa2,c.cusa3,d.trmdes,a.invnr,
    c.stacd FROM Openar a JOIN
      Oehhst c ON a.invnr = c.invno JOIN Terms d ON c.trmcde = d.trmcde JOIN
    Custmast e ON a.cusno = e.cusno
     WHERE a.trtyp = 1 AND c.ordtyp NOT IN('CCA','CCR') AND a.cusno IN
    (206800,99999999) AND a.trndt
     BETWEEN 1020929 AND 1021026 ORDER BY cusnm,invnr

    For testing, I just print it to a spooled file. The dates and customer
    number clause are passed in as parameters.What I then did was copy the text
    from the spooled file to STRSQL and it ran fine.

    I'm preparing the statement and declaring a cursor on the prepared
    statement. Then checking the SQLSTT after the OPEN.

    Thanks,

    Mark


    Mark Walter
    Sr. Programmer/Analyst
    Hanover Wire Cloth a div of CCX, Inc.
    mwalter@hanoverwire.com
    http://www.hanoverwire.com
    717.637.3795 Ext.3040
    /"\
    \ /
     X
    / \


    _______________________________________________
    This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
    To post a message email: RPG400-L@midrange.com
    To subscribe, unsubscribe, or change list options,
    visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
    or email: RPG400-L-request@midrange.com
    Before posting, please take a moment to review the archives
    at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.