|
Sorry, SQL doesn't offer a *MAP *DROP. Nor an EVAL-COR. I'd consider having a SQL view defined. Then just using the good old CPYF with FMTOPT(*MAP *DROP). Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121
-----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Crosby Sent: Tuesday, August 01, 2006 1:33 PM To: 'RPG programming on the AS400 / iSeries' Subject: SQL block insert I'll bet you guys are getting tired of me asking SQL questions, aren't you? <g> Up to now, all my embedded SQL has been cursor driven. However I have one now where I want to join 2 files and output the result set into another file. Since SQL is set-at-a-time, I didn't see a reason to use a cursor, just slam the whole result set out there. The statement I'm wanting to execute is this: Insert into AUTHITEM (Select c.*, i.* From NXCHNBIL C Join NXITMMST I On c.ITNBR = i.ITNBR Where c.ACREC = 'A' and c.CUSNR = 0509 and c.CHAUT in ('2', '8', '9')) It gives me an error saying field QSUN2 doesn't map properly. My guess is that it is mapping the fields based on order, and I want to map based on field name. Am I right on the error? And is there a way to map by field name without specifying each? File AUTHITEM has 100+ fields, some from each of the other 2 files, but not nearly all fields. Thanks. -- Jeff Crosby Dilgard Frozen Foods, Inc. P.O. Box 13369 Ft. Wayne, IN 46868-3369 260-422-7531 The opinions expressed are my own and not necessarily the opinion of my company. Unless I say so. -- 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.