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


  • Subject: Re: SQLRPG question
  • From: "R. Bruce Hoffman, Jr." <rbruceh@xxxxxxxxxxxxx>
  • Date: Wed, 20 Jun 2001 15:11:22 -0400

-----Original Message-----
From: Goodbar, Loyd (AFS-Water Valley) <LGoodbar@afs.bwauto.com>
To: 'midrange-l@midrange.com' <midrange-l@midrange.com>
Date: Wednesday, June 20, 2001 2:18 PM
Subject: SQLRPG question

>Fixed portion:
>SELECT chg_cc as cc, stockno, desc, issueqty, uom, cost, date, value,
>mtlreqn, number FROM mspivtfd WHERE type = ''5''
>
>Varying portions (to be added to above, depending on conditions):
>and date='':TEMPDATE''
>and date between '':TEMPDATE'' and '':TEMPDATE2''
>and cc='':INDEPT''
>and stockno=''INSTOCKNO''
>order by cc, date, stockno
>order by cc, stockno
>
>I am building the SQL statement in an RPG variable at run time.
>
>Some questions...
>1) I assume I need to use SQLDA because the varying portions of my where
>statements have different variables.

The DA is normally only required when you vary the selected columns, the
varying where and order by should not have any requirement for a DA.


>2) Do I use the host variable :VAR syntax, or the ? marker syntax in the
sql
>statement?


As in a recent post, for dynamic statements, it's the parameter marker (?).


===========================================================
R. Bruce Hoffman, Jr.
 -- IBM Certified Specialist - AS/400 Administrator
 -- IBM Certified Specialist - RPG IV Developer

"America is the land that fought for freedom and then
  began passing laws to get rid of it."

     - Alfred E. Neuman



+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.