5 pts.
 iseries stored procedure : read character string containing single apostrophe …. ex: Let’s
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

Software/Hardware used:
ASKED: December 27, 2007  11:04 PM
UPDATED: March 7, 2010  11:55 AM

Answer Wiki:
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
Last Wiki Answer Submitted:  March 7, 2010  11:55 am  by  Saravanakumarg   30 pts.
All Answer Wiki Contributors:  Saravanakumarg   30 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _