|
On Thursday, August 27, 1998 9:57 PM, Tim Truax [SMTP:truax@usaor.net]
wrote:
> Hi Buck,
> Thanks for tha answer. Being methodical is the only way to go when it
> comes to
> doing anything on the 400. I am curious, what do you use for SQL, the
> strqm
> (Query Manager) ? And are you able to generate an SQL script and
> populate an
> AS400 externally described file? I seem to remember I had trouble doing
> this.
>
> > 9. Use SQL to copy the single record from each production "master" to
> > test
> > "master" - insert into test/master (select * from prod/master where
> > key=12345)
> > 10. Use SQL to copy all the related records from the production
> > "non-master" to test "non-master" based on the records found in test
> > "master" - insert into test/journal (select * from prod/journal where
> > jrnkey in (select key from test/master))
Tim,
If you have IBM's SQL product, you can simply embed SQL into your RPG
programs. One can dynamically prepare and execute SQL statements this
way. I have a home-grown command-line SQL command that I use for this,
but it's only a "prettier" interface into STRQMQRY. The basic idea is to
do an INSERT INTO your test file and SELECT * from your production file
WHERE your conditions are met. Something like:
insert into test/master (select * from prod/master where itclas in
('A','B','C') or weight>100)
You can certainly use QMQRY for this, either build the QMQRYSRC on the fly
or use parameter markers as a skeleton and "fill in the blanks."
Buck Calabro
Commsoft, Albany, NY
mailto:mcalabro@commsoft.net
+---
| 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 mailing list archive is Copyright 1997-2025 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.