Kevin,
No, you are wrong. I construct a string that will be used as the sql statement. I perform the prepare using that string. I open the cursor and perform a fetch. The fetch fails with an EOD. I display the string, copy it and start STRSQL. I paste the string and press enter. It returns the expected value. At no time do I do anything to alter the sql statement other than modify it ion STRSQL because the ands have 1 character on the previous line and the nd on the next.
Thanks,
Marvin
No trees were killed in the sending of this message, but a large number of electrons were terribly inconvenienced, traumatized, triggered, and crying for their safe spaces.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Kevin Bucknum
Sent: Wednesday, December 11, 2019 2:50 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: A problem in embedded SQL
You say that you are copy and pasting the statement, but the statement uses host variables. At the very least I would think that you are manually replacing those with the values you want to use. If you are doing that, then you are doing what you think the sql preprocessor and run time pieces are doing. Either, the preprocessor/runtime isn't doing what you think it is, you have some other small bug that you are overlooking in your code, or you have found a bug in the OS. If it is #1 or #2 then the information that people have been asking for would help eliminate those. If it is #3 then you need to open a support ticket with IBM. Since you seem to be unwilling to give anyone the information they are asking for, at this point it seems to me your only choice is going to be opening a support ticket with IBM. I would be interested in what they say. As I said before, I got so tired of fighting host variables, likes, and wildcards that if I have one I need today, I automatically just write it as a dynamic sql statement.
________________________________
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Marvin Radding <marvin.radding@xxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, December 11, 2019 3:49 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: A problem in embedded SQL
Booth,
As I have repeatedly said, I am doing a copy/paste to use the sql statement in STRSQL. It fails in RPGLE but is successful in STRSQL.
Thanks,
Marvin
No trees were killed in the sending of this message, but a large number of electrons were terribly inconvenienced, traumatized, triggered, and crying for their safe spaces.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Booth Martin
Sent: Wednesday, December 11, 2019 1:33 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: A problem in embedded SQL
Have you run the program in debug and looked at the prepared statement?
Sometimes there will be a missing space character so that the statement will run, but not correctly.
(There is no need to ask me how come I happen to know that.)
On 12/11/2019 9:25 AM, Marvin Radding wrote:
Alan,
I construct the sql statement, perform a prepare, and then open the cursor. When I do the fetch it fails to find the record. I copy the sql statement from the RPGLE program and paste it into STRSQL and it finds the record. I don't understand why there is a difference between the two.
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
Notice: This e-mail transmission may contain information that is proprietary, privileged and/or confidential and is intended exclusively for the person(s) to whom it is addressed. This message may also contain Protected Health Information (PHI) and must be treated confidentially and handled in accordance with HIPAA and other federal and state privacy laws. Any use, copying, retention or disclosure by any person other than the intended recipient or the intended recipient's designees is strictly prohibited. If you are not the intended recipient or their designee, please notify the sender immediately and delete this e-mail (and any accompanying attachments).
As an Amazon Associate we earn from qualifying purchases.