|
Hi ColinANZQRY gives you a spooled file that lists the things that could not be brought over from a QRYDFN to a QMQRY. You might want to look in the Query Management Programming manual - there is a good chapter there on all the things that don't get retrieved exactly.
I hear what Rob is saying - the syntax does not say JOIN, but they are like joins in the old style of using a WHERE clause of the join-fields. I think IBM could, if they wanted, generate the equivalent - it is not hard - in SQL. Pity!!
I love QMQRYs and QMFORMs for quick report design. HTH Vern At 02:18 AM 2/19/2007, you wrote:
Thanks for the responses folks.I have kjust looked at rtvqmqry and it looks useful, pity about the lack of 'join' info as you described. Not quite figured out anzqry yet, what it does or where it outputs to, i will have a play....Many thanks, Colin. rob@xxxxxxxxx wrote: Some of the ways Query does stuff is a little crude. For example, Query doesn't use any JOINs - it links files together only by using WHEREs. Therefore when you use options in Query like the matching records with primary file, kind of stuff what you get may not be what query actually uses. Hence the command ANZQRY. It tells you when RTVQMQRY will lie. Also, your record selection can often be prettied up with the use of parenthesis - something Query sorely lacks. For example how would you do the following in Query? where (field1>100 and (field2>200 or field3<700)) And if you did figure out how to do it in Query, what would a RTVQMQRY of that query show you? Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com "Jonathan Mason \(Tiscali\)" Sent by: rpg400-l-bounces@xxxxxxxxxxxx 02/16/2007 11:13 AM Please respond to RPG programming on the AS400 / iSeries To "'RPG programming on the AS400 / iSeries'" cc Fax to Subject RE: Sql insert multiple records Hi Colin >> On another matter, I don't suppose anyone knows if it is possible to >> convert AS400 query definitions into their equivalent SQL commands (a bit >> of a long shot I think.!) I haven't tried it on "complicated" queries, but you can use the RTVQMQRY command to get back the QMQRY definition of a Query/400 query. The QMQRY definition does contain the SQL commands for the query which you can cut and paste quite happily. For example: H QM4 05 Q 01 E V W E R 01 03 07/16/02 11:41 V 1001 050 V 5001 004 *HEX SELECT ALL XROBNM, XROBLB, XROBTP, XROBTX, XRRFOB, XRRFLB, XRRFTP FROM A10UTLLIB/AUKP225A T01 WHERE XRRFOB NOT LIKE 'Q%' ORDER BY XROBNM ASC, XRRFTP ASC, XRRFOB ASC You will need to specify ALWQRYDFN(*YES) on the RTVQMQRY command to pull back the definition from the Query/400 object. Hope it helps All the best Jonathan --------------------------------- What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship. -- 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. -- 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. -- 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. ---------------------------------Inbox full of unwanted email? Get leading protection and 1GB storage with All New Yahoo! Mail.-- 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.