|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Adding a single quote in ESQL - Solved |
« View previous topic :: View next topic » |
Author |
Message
|
Sukerl |
Posted: Mon Jul 04, 2005 7:21 am Post subject: Adding a single quote in ESQL - Solved |
|
|
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 |
|
 |
fschofer |
Posted: Mon Jul 04, 2005 7:41 am Post subject: |
|
|
 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 |
|
 |
Sukerl |
Posted: Mon Jul 04, 2005 7:51 am Post subject: |
|
|
Newbie
Joined: 04 Jul 2005 Posts: 2
|
This was exactly the way I was looking for!
Thanks a lot!
Florian |
|
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
|
|
|
|