ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » The ' character in a concatenation

Post new topic  Reply to topic
 The ' character in a concatenation « View previous topic :: View next topic » 
Author Message
krustyelpayaso
PostPosted: Tue Nov 08, 2005 5:29 am    Post subject: The ' character in a concatenation Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

Hello everybody,

We can supose that the value of the nom varible is: peter1
I have the next code:

SET libelle = ' AND A.BI04INFO_ID NOT IN ( ';
----
---- I build the reste of the "libelle" variable here with others values
----
SET libelle = libelle || ' )';

---- I concatenate the two variables

SET infoNom = nom || libelle;

--ESQL
SET OutputRoot.XML.infosIdFound[] = (SELECT A.BI04INFO_ID FROM Database.BI04_INFORMATION AS A WHERE A.BI04SI_ID = siId AND A.BI04TI_ID = tiId AND A.BI04CI_ID = ciId AND A.BI04KEY_SI_ID = infoNom);

I try to write a sentence like: WHERE A.BI04SI_ID = sid AND A.BI04TI_ID = tiId AND A.BI04CI_ID = ciId AND A.BI04KEY_SI_ID = 'peter1' AND A.BI04INFO_ID NOT IN (id1, id2). The trouble is i don't know how add the ' character at the nom. I try that because if the value of the variable nom, hasen't the ' character, the select don't work.

I've tried to put ''' (single, single, single), or "'" (double, single, double), or '\'' (single, slash, single, single), etc.

Do you know how i can do it?

A lot of thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 08, 2005 5:34 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you need '' (single-single).

http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp?topic=/com.ibm.etools.mft.doc/ak17830_.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
krustyelpayaso
PostPosted: Tue Nov 08, 2005 5:53 am    Post subject: Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

I'm afraid that work with other characters (*,@,$etc), but not with the ' character. I've tried but it puts AND A.BI04KEY_SI_ID = peter1 AND A.BI04INFO_ID NOT IN (id1, id2). (peter1 without ')

Agghhh
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 08, 2005 5:54 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Can you show the exact code you use, and the exact result it produces?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
krustyelpayaso
PostPosted: Tue Nov 08, 2005 6:10 am    Post subject: Reply with quote

Apprentice

Joined: 24 Oct 2005
Posts: 26

Ok. Well, this is my code

DECLARE nbInfosFound INTEGER;
DECLARE E INTEGER 1;
DECLARE infos CHARACTER;
DECLARE libelle CHARACTER;
DECLARE reste BOOLEAN;
DECLARE aux INTEGER;

SET reste = FALSE;
SET libelle = ' AND A.BI04INFO_ID NOT IN ( ';
WHILE E <= D DO

IF (OutputRoot.XML.actualInfoId[E] IS NOT NULL) THEN
SET infos = CAST(OutputRoot.XML.actualInfoId[E] AS CHARACTER);
IF ( infos IS NOT NULL ) THEN
SET libelle = libelle || infos ;
IF ( E <> D) THEN
SET libelle = libelle || ' ,';
ELSE
SET libelle = libelle || ' ';
END IF;


SET reste = TRUE;

END IF;

END IF;

SET E = E + 1;

END WHILE;

SET libelle = libelle || ' )';

IF (reste) THEN
SET infoNom = '' || nom || '' || libelle;
ELSE
SET infoNom = '' || nom || '' ;
END IF;

SET OutputRoot.XML.infosIdFound[] = (SELECT A.BI04INFO_ID FROM Database.BI04_INFORMATION AS A WHERE A.BI04SI_ID = siId AND A.BI04TI_ID = tiId AND A.BI04CI_ID = ciId AND A.BI04KEY_SI_ID = infoNom);

I can't send you the results because it's a long process. I've have see the result with the debugger . When he make a
IF (reste) THEN
SET infoNom = '' || nom || '' || libelle;
ELSE
SET infoNom = '' || nom || '' ;
END IF;
and it go to the ELSE, it's works OK. Perfect. It haven´t the ' character and AND A.BI04INFO_ID NOT IN.... neither. But when it take the other path (SET infoNom = '' || nom || '' || libelle; ), it don't find the items, and i can certificarte than the items exists into the Oracle Database.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » The ' character in a concatenation
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.