× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



IIRC, an SQL statement in RPGv over multiple lines requires + to continue. Does your code have that?

And that have been requested many times.: your RPG code.

Regards,

Carel Teijgeler.


Op 12-12-2019 om 16:10 schreef Marvin Radding:
Carel,

Yes I have shown the statement. Look back on the messages. You will find the sql statement exactly as it is constructed.

If it were missing a space, the STRSQL would have thrown an error. I also read the error message generated by SQL because I use sqlerrchk that provides for returning the actual text of the message.

My code is not the problem but I will provide the code so you can see for yourself that there is nothing much to my code.

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 Carel
Sent: Thursday, December 12, 2019 6:40 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: A problem in embedded SQL

But you have never shown us the string that you copy into STRSQL unaltered.

It could be a missing space, concattanating two separate words (field names).

Also using DEBUG: have you read the messages DEBUG genearates when executing the SQL statement?

Showing the RPG code has also been requested, especially when do you check SQL CODE and SQL STATE.

Being stubborn is not helping you.

Kind regards,

Carel Teijgeler


Op 12-12-2019 om 00:16 schreef Kevin Bucknum:
Then that doesn't match the code that you showed us. You were using host variables in the code you showed us.

________________________________
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of
Marvin Radding <marvin.radding@xxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, December 11, 2019 4:58 PM
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: A problem in embedded SQL

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 writ
e
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).
--
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



[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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.