iseries stored procedure : read character string containing single apostrophe …. ex: Let’s

5 pts.
Tags:
IBM iSeries
Programmers
Stored Procedures
I am working on a stored procedure that requires a literal string to be input into a VARCHAR(1024) variable. My stored procedure has no problem reading the word........... Let''s However, if I try to read the word............Let's, I get a code violation. Do I need to read the string as a datatype which does not care about single apostrophes? And then convert the string into VARCHAR? Please help as I have been searching for days to find the answer to this "tricky" proposition. I cannot imaging that some of you out there have not run up against this while writing stored procedures for the iSeries/AS400 !!!! I will appreciate your response. Sincerely, dsthornton

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hello,
I think in the word “Let’s” the single code(‘) is recognized as a special charactor. Thats why it is returning error. So when passing the input to the stored procedure just add one more singlecode(‘) like
“Let”s” that is give two single codes between t and s and try. it will work.
Thanks & Regards,
GSK

==========================================================

Without describing what you mean by a stored proc “reading” a word, there’s no way to supply a useful answer. Reading by way of what kind of I/O method? Reading from where?

In essentially every language I’ve ever used, there are problems handling strings that can contain delimiter characters within the string. AS/400 stored procs are no different from any others in that respect.

Tell some minimal description of how you’ve tried things and we can probably help.

Tom

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following