|
You could construct the SQL statement dynamically...... Eric DeLong Sally Beauty Company MIS-Project Manager (BSG) 940-898-7863 or ext. 1863 -----Original Message----- From: Rusling, John B. (Alliance) [mailto:jbrusling@xxxxxxxxxxxxxxx] Sent: Tuesday, February 17, 2004 9:49 AM To: 'rpg400-l@xxxxxxxxxxxx' Subject: SQL question - Library that file resides in as a column in SELECT stmt output. I have a SELECT statement, looks like this - SELECT code, id, seq, startpos FROM sf ....+....1....+....2....+....3....+. Code ID Sequence Start Position SR10 IT 0 1 SR10 IT 0 36 SR10 IT 0 37 SR10 IT 0 38 SR10 IT 0 39 SR10 IT 0 40 ******** End of data ******** I'd like the library that the file (sf) resides in to be a column in the output of the SELECT statement. ....+....1....+....2....+....3....+....4....+....5....+ Code ID Sequence Start Position Library SR10 IT 0 1 MYLIB SR10 IT 0 36 MYLIB SR10 IT 0 37 MYLIB SR10 IT 0 38 MYLIB SR10 IT 0 39 MYLIB SR10 IT 0 40 MYLIB ******** End of data ******** Is there a Function/Column keyword or something/someway to do this? Reason for this is - I have an file that resides in multiple libraries. (identical file, same fields etc.) I'd like to check some of the field values for validity (in all the libraries the file exists.) I thought I might use "UNION" to put them all together and test them all at once but this wouldn't do me any good w/o the "originating" library. tfahmf John B. _______________________________________________ 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 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.