× 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.



Yogesh,

What if you could use an SQL statement
but did not have to use embedded SQL?
With the DynSQL procedure in the
iSeries-toolkit you could use something
like:

     D Count           S             10I 0 BASED(pInput)
     D FetRtn          DS

     D  isErr                          N

     D  isEof                          N

     D Dsp             S             52A

     D Hnd             S              5U 0

      /COPY QPROTOSRC,DynSQL

     C                   EVAL      Hnd = CrtSQLHnd(

     C                                     'Select COUNT(*) From QAUOOPT
+
     C                                        Where Command like
(''DSP%'')':
     C                                     *OMIT:

     C                                     pInput)

     C                   IF        Hnd <> 0

     C                   IF        not ExcSQLSel(Hnd)

     C                   EVAL      FetRtn = ExcSQLFet(Hnd)
     C                   CALLP     ClsSQLStm(Hnd)
     C                   ENDIF

For another example see:

http://sourceforge.net/docman/display_doc.php?docid=8869&group_id=39365

There is no requirement that you have the SQL
development kit on your system to use this.
If it looks workable, just download the package
at http://iseries-toolkit.sourceforge.net

David Morris

>>> eck@tkm.co.in 02/09/02 03:33 AM >>>


Hi All,

Actually i am also facing a similar problem as Mike in one of the
programs
under development here. We are working on only RPG (i.e. no embedded
SQL),
and what we need to know is something like

' Select count(*) from XYZ where < some condition >'.

I need to make sure the count(*) for the given condition is 0 before the
program proceeds any further. Any suggestions on the fastest (and
elegant)
way to do this on RPG. I am not keen on having new logical files with
keys
for the fields in the 'where' condition of SQL as these fields are only
a
set of flags.

TIA

Yogesh Pathak



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-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.