Hello,
In dynamic sql. Where do we use single quotes and doulble quotes for queries. Really I did not understand. I got confused. How do we follow. I went through some docs but did not get it. Doed any body explain me or give me simple example.
i find the best way to figure out what is going on with quotes is just use easy sql statements and look at what is returned. E.G
select '''test''' from dual; will return: 'test'
select '''' from dual; will return: '
4 qoutes would be used if you wanted the value of a db field to be surrounded by quotes
select ''''||EMP_NO||'''' FROM EMPLOYEE;
if empno 1234 will return: '1234'.
hope this explains some bit.
Actually it doesn't relate to dynamic sql itself, but rather to denoting string literals. If you need single quote within string literal it should be doubled. E.g. string literal don't may be produced as 'don''t'. Double quotes don't need any additional care.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.