× 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: SQLRPG question
  • From: "Goodbar, Loyd (AFS-Water Valley)" <LGoodbar@xxxxxxxxxxxxxx>
  • Date: Wed, 20 Jun 2001 14:00:50 -0400

I'm trying to create a dynamic SQL statement for an intranet based lookup
application. The actual select portion is fixed, but the where and order by
portions are dynamic.

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.
2) Do I use the host variable :VAR syntax, or the ? marker syntax in the sql
statement?

Thanks,
Loyd

--
Loyd Goodbar
Programmer/Analyst
BorgWarner Incorporated
Air/Fluid Systems, Water Valley, MS



+---
| 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-Ups:

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.