i need to know hows this happening? [message #182993] |
Wed, 19 July 2006 02:33 |
amul
Messages: 252 Registered: April 2001 Location: Chennai
|
Senior Member |
|
|
forgive me for being ignorant but i need to know how is this being executed?
select ('senthil''s') from dual;
when i execute this command the output is senthil's
how is this possible?please reply
|
|
|
|
Re: i need to know hows this happening? [message #183003 is a reply to message #182997] |
Wed, 19 July 2006 02:51 |
amul
Messages: 252 Registered: April 2001 Location: Chennai
|
Senior Member |
|
|
i think u got me wrong.
what i need to know is
as a string if we execute this select ('senthil') from dual
its going to display as senthil
but when i execute this statement
select('senthil''s') from dual i get an output like senthil's
but it shud come like senthils.so i need to know wats wrong..can n e one reply?
|
|
|
|
Re: i need to know hows this happening? [message #183007 is a reply to message #183003] |
Wed, 19 July 2006 02:58 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
In SQL, if a string contains two single quotes next to each other, these are converted into a single quote that is contained in the string.
It is a way of getting string delimiters into strings.
SQL> select 'abcd' from dual;
'ABC
----
abcd
SQL> select 'abc'd' from dual;
ERROR:
ORA-01756: quoted string not properly terminated
SQL> select 'abc''d' from dual;
'ABC'
-----
abc'd
Is this what you are looking for?
|
|
|
|
|
Re: i need to know hows this happening? [message #183021 is a reply to message #183013] |
Wed, 19 July 2006 03:29 |
ehegagoka
Messages: 493 Registered: July 2005
|
Senior Member |
|
|
hi!
in 10g you can also used q or Q followed by a character to use as the marker for the quote, like [,( and then close it at the end ),] followed by another ', like this =)
SQL> select q'(silenthill's)' quote from dual
2 /
QUOTE
------------
silenthill's
|
|
|
|