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 » Adding a single quote in ESQL - Solved

Post new topic  Reply to topic
 Adding a single quote in ESQL - Solved « View previous topic :: View next topic » 
Author Message
Sukerl
PostPosted: Mon Jul 04, 2005 7:21 am    Post subject: Adding a single quote in ESQL - Solved Reply with quote

Newbie

Joined: 04 Jul 2005
Posts: 2

Hi out there!

I have a little problem derived from the single-quote character. I want to do an insert into a DB2 Table with the Database-Node in WBIMB 5.0 with values I read from a XML-File.

One of the values i want to insert a ZIP-Code and Name of a city called "Epis d'Ajoie". With this name my insert-statement looks like this:

Code:
INSERT INTO TestDB VALUES('1287','Epis d'Ajoie')


The problem is, that this insert doesn't work, because DB2 expects the statement with an escape character (with two single-quotes). So the statement should look like this:

Code:
INSERT INTO TestDB VALUES('0010','Epis d''Ajoie')


My ESQL looks like this:
Code:

SET chrName = InputTree.Cityname;
SET chrInsertStatement = 'INSERT INTO TestDB VALUES(''' || chrZIPCode || ''',''' || chrName || ''')';
PASSTHRU(chrInsertStatement);


I'm looking for a way to replace the single quote with two single quotes. I already tried but couldn't find a solution. Ideas?

Greetings

Florian


Last edited by Sukerl on Mon Jul 04, 2005 7:52 am; edited 1 time in total
Back to top
View user's profile Send private message
fschofer
PostPosted: Mon Jul 04, 2005 7:41 am    Post subject: Reply with quote

Knight

Joined: 02 Jul 2001
Posts: 524
Location: Mainz, Germany

Hi, try
Code:
SET chrName = InputTree.Cityname;
SET chrInsertStatement = 'INSERT INTO TestDB VALUES(?,?)';
PASSTHRU(chrInsertStatement, chrZIPCode,  chrName );

Greetings
Frank
Back to top
View user's profile Send private message Send e-mail
Sukerl
PostPosted: Mon Jul 04, 2005 7:51 am    Post subject: Reply with quote

Newbie

Joined: 04 Jul 2005
Posts: 2

This was exactly the way I was looking for!

Thanks a lot!

Florian
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 » Adding a single quote in ESQL - Solved
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.