|
Peter, For a number of reasons you should NOT use * on your select. 1) Suppose IBM adds fields to the underlying file and you do not recompile your program. IBM, (or the standards), has various warning fields in the SQLCA to handle this, and you can check this. However I think that in a higher release, they actually fail the fetch. 2) Performance reasons. Why select the fields you do not need? 3) For the reason you are having. It is valid to use an externally defined data structure, as you do. However just: 1) Change your select to select only the fields you want. 2) Change your fetch to only receive these fields I've searched the memo to users for this change and can't find it. I thought about searching the archives of this list but couldn't think of a valid search. (But I am fighting a bear of a cold, an unload/reload that is stretching out to a week, and nasty battles with TSM). Rob Berendt -- "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." Benjamin Franklin "Peter Colpaert" <Peter.Colpaert@ho To: RPG400-L@midrange.com nda-eu.com> cc: Sent by: Fax to: rpg400-l-admin@mid Subject: SQLCODE -305 range.com 09/24/2002 04:55 AM Please respond to rpg400-l Hi group, I have a strange SQLRPGLE problem. When I try to get a list of files using a certain field on screen using an embedded SQL RPGLE program, I get no info on the screen, but when I execute the SQL statment in interactive SQL, I do get a number of records. These are the relevant program specs: * d DsQaDbiFld e ds extname(qadbifld) c/exec sql c+ Declare CR1 cursor for c+ Select * c+ From qadbifld c+ Where dbifld = :k1fld c+ Order by dbilib, dbifil, dbifmt c/end-exec * c/exec sql c+ open CR1 c/end-exec * c Dou SqlCod <> *zeros * c/exec sql c+ fetch CR1 into :DsQaDbiFld c/end-exec * c If SqlCod = *zeros .... some processing c Endif c Enddo The SQLCOD is -305. According to the IBM site this means that an indicator variable is required. The archives indicate that you have to provide an additional field for every field that is null-capable. Does this mean that I have to manually specify all fields in DsQaDbiFld, adding additional fields for every field that is null-capable, or is there an easy way to tell the program to substitute null numeric fields by *zero and null alpha fields by *blanks, while still retaining the easy EXTNAME keyword? Thanks for any help with this. Peter Colpaert Application Developer Honda Europe NV Langerbruggestraat 104 B-9000 GENT Belgium Peter.Colpaert@honda-eu.com Tel: +32 9 2501 334 Fax: +32 9 2501 231 ---------- Yoda of Borg are we: Futile is resistance. Assimilate you, we will. ---------- ______________________________________________________________________ The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or the entity to whom it is addressed and others authorised to receive it. If you have received it by mistake, please let the sender know by e-mail reply and delete it from your system. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance of the contents of this information is strictly prohibited and may be unlawful. Honda Europe NV is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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.