Tuesday, January 15, 2013

Quotes


To add quotes to Oracle String, we could not write directly as other characters.
Normal characters:
SELECT ‘Study and Share’ AS “Blog” FROM DUAL;


However, when we do the same statement with quotes, there is an error:
SELECT ‘Blog’s Study and Share’ AS “Blog” FROM DUAL;


To avoid this error, we could add one more quote:

SELECT ‘Blog’’s Study and Share’ AS “Blog” FROM DUAL;


Or we could use special signs < and >, ( and ), { and }, [ and ] (mean that one open and one close); or normal charater:
SELECT q’<‘Blog’s Study and Share>’ AS “Blog” FROM DUAL;





No comments:

Post a Comment