Wednesday, May 14, 2008

q used to define a quote delimiter for PL/SQL

I don't know why I can never remember the 'q' for a quote delimiter, so I am putting it here for myself so I can easily find it.



q'';

DECLARE
s1 VARCHAR2(20);
s2 VARCHAR2(20);
s3 VARCHAR2(20);
BEGIN
s1 := q'[Isn't this cool]';
s2 := q'"Isn't this cool"';
s3 := q'|Isn't this cool|';

dbms_output.put_line(s1);
dbms_output.put_line(s2);
dbms_output.put_line(s3);
END;


source: http://www.psoug.org/reference/string_func.html

No comments: