By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,007 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,007 IT Pros & Developers. It's quick & easy.

Problem string with literals

P: 1
Hi all
i have following problems with literals

id = 1
vname = Maria
lname = D'Alessio


INSERT INTO ADDRESS values( 1,'D'Alessio', 'Maria')

SQLSTATMENT is

STATEMENT = "INSERT INTO ADDRESS" values(",
"'"id"',",
"'"vname"',",
"'"lname"')")"


and receive following error
SQL0010N Error "')' .... SQLSTATE 42603

because of literal D' Alessio

Thanks for help
Sep 29 '07 #1
Share this Question
Share on Google+
2 Replies


Purple
Expert 100+
P: 404
Ursx,

I am going to move this post to the forum because you have posted into the articles.

MODERATOR
Oct 4 '07 #2

P: 6
If you want to have a single-quote inside a literal string, use two consecutive single quotes, like this:
values( 1,'D''Alessio', 'Maria')

Hi all
i have following problems with literals

id = 1
vname = Maria
lname = D'Alessio


INSERT INTO ADDRESS values( 1,'D'Alessio', 'Maria')

SQLSTATMENT is

STATEMENT = "INSERT INTO ADDRESS" values(",
"'"id"',",
"'"vname"',",
"'"lname"')")"


and receive following error
SQL0010N Error "')' .... SQLSTATE 42603

because of literal D' Alessio

Thanks for help
Nov 2 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.