× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



oh yeah - next on your fetch is not needed either, and is probably
invalid if you don't specify scroll.

On 4/11/06, rick baird <rick.baird@xxxxxxxxx> wrote:
> looks like mine - except I don't believe you need "SCROLL" on your declare.
>
> scroll is only for reading multiple records, afaik.
>
> On 4/11/06, Tyler, Matt <mattt@xxxxxxxxxxxxxx> wrote:
> > Here's an example program. Just replace my select statement with one of
> > your choosing.  Sorry if formatting is messed up, code.midrange.com is
> > not working for me.
> >
> >      D SQLSTMT         s            256A   varying
> >
> >      D RCCOUNT         S              9P 0
> >
> >
> >
> >      C                   EVAL      SqlStmt ='Select Count(*) from
> > RimIPRpf -
> >      C                                       Where IPRS <>3 and
> > IPUPC=4011'
> >      C
> >
> >
> >
> >      C/EXEC SQL
> >
> >      C+ Prepare SQLST2 FRom :SQLSTMT
> >
> >      C/END-EXEC
> >
> >
> >
> >      C/EXEC SQL
> >
> >      C+ DECLARE SQLCSR2 SCROLL CURSOR FOR SQLST2
> >
> >      C/END-EXEC
> >
> >
> >
> >      C/EXEC SQL
> >
> >      C+ OPEN SQLCSR2
> >
> >      C/END-EXEC
> >
> >
> >
> >      C                   CLEAR                   RCCOUNT
> >
> >      C/EXEC SQL
> >
> >      C+ FETCH NEXT FROM SQLCSR2 INTO :RCCOUNT
> >
> >      C/END-EXEC
> >
> >
> >      C     RCCOUNT       DSPLY
> >
> >      C                   EVAL      *INLR = *ON
> >      C                   RETURN
> >
> >
> > Thanks, Matt
> >
> >
> > --
> > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> > To post a message email: RPG400-L@xxxxxxxxxxxx
> > To subscribe, unsubscribe, or change list options,
> > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> > or email: RPG400-L-request@xxxxxxxxxxxx
> > 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 ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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.