473,388 Members | 1,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Problem string with literals

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
2 2206
Purple
404 Expert 256MB
Ursx,

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

MODERATOR
Oct 4 '07 #2
ties
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

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

Similar topics

16
by: Don Starr | last post by:
When applied to a string literal, is the sizeof operator supposed to return the size of the string (including nul), or the size of a pointer? For example, assuming a char is 1 byte and a char *...
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
17
by: Janice | last post by:
char* line = "abcd"; How to convert the line to upper case and print? Any option for printf to do this? Thanx
8
by: junky_fellow | last post by:
what would be the output for the following piece of code ? if ( "hello" == "hello" ) printf("True\n"); else printf("False\n"); What is the reason for that ?
12
by: ern | last post by:
I'm using it like this: char * _command = "one two three four"; char * g_UserCommands; const char * delimeters = " "; g_UserCommands = strtok(_command, delimeters); g_UserCommands =...
3
by: Herb Finkel | last post by:
The following code is fairly simple to capture command line arguments: using System; namespace ConsoleApplication1 { class Class1 { static void Main(string args) { string first = args;
6
by: copx | last post by:
Can you / are you supposed to free() string literals which are no longer needed? In my case I've menu construction code that looks like this: menu_items = list_new(); list_add(menu_items,...
5
by: Victor Eijkhout | last post by:
I've used this function before but I'm suddenly getting bus errors: %% cat tok.c #include <stdlib.h> #include <stdio.h> #include <string.h> int main(int argc,char **argv) { char *c,*fs;...
4
by: =?ISO-8859-15?Q?Jean=2DFran=E7ois?= Lemaire | last post by:
Hello all, I'm learning C and I still am struggling to understand some basic concepts. For example, I read in the standard that with functions such as strcpy, 'If copying takes place between...
7
by: lithiumcat | last post by:
Hi, I'm not yet very confident in my use of standard terminology, so please be kind if I'm mis-calling something, I will do my best no to make it again once pointed out. I'm wondering what is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.