|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
adding a single quote to a string |
« View previous topic :: View next topic » |
Author |
Message
|
mehedi |
Posted: Sat Jul 19, 2008 4:49 pm Post subject: adding a single quote to a string |
|
|
Centurion
Joined: 11 Nov 2001 Posts: 102 Location: PSTech
|
The string should contain
'ABC'
including the opening and closing quotes.
Tried
(a) SET var1 = '\'ABC'\':
(a) SET var1 = '\"ABC"\':
and many such things . Anybody with a answer ?
Thanks
Mehedi |
|
Back to top |
|
 |
mehedi |
Posted: Sat Jul 19, 2008 6:02 pm Post subject: How do you pass multiple values to a SELECT IN predicate |
|
|
Centurion
Joined: 11 Nov 2001 Posts: 102 Location: PSTech
|
Figured out the single quote bit , and came to the realization this was not the problem .
Here is the next stumbling block --
How do you pass multiple values to a SELECT IN predicate
Declare XFirstname Char;
SET XFirstName = 'James'; \\ This returns a result (a)
SET XFirstName = 'James' || ',' || 'Jane' ; \\ no result (b)
-- The select statement below returns a value with the
-- variable as set on (a) , not with (b)
SET Environment.Variables.Data[] = (
Select FIRST_NAME
FROM EMPLOYEE
WHERE FIRST NAME IN ?' ,
XFirstName)
thanks
Mehedi |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Jul 19, 2008 10:46 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
As I see it, our second select is looking for a row (or rows) in EMPLOYEE where the name you are looking up is
'JAMES,JANE'
In the case where this occurs, you should perhaps modify the select to use
AND
OR
etc as appropriate
An IF, ELSE, END IF wrapped around it all should make it work together nicely.
Variable SQL can be a real PITA at times. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|