Use of Quote operator "q" in Oracle 11g

The following SQL statements will produce the same results.

select q'<Welcome to DanBrother's Blog. It's fantastic!>' as text from dual;
select q'#Welcome to DanBrother's Blog. It's fantastic!#' as text from dual;
select q'+Welcome to DanBrother's Blog. It's fantastic!+' as text from dual;
select q'@Welcome to DanBrother's Blog. It's fantastic!@' as text from dual;
select q'*Welcome to DanBrother's Blog. It's fantastic!*' as text from dual;
select q'(Welcome to DanBrother's Blog. It's fantastic!)' as text from dual;
select Q'cWelcome to DanBrother's Blog. It's fantastic!c' as text from dual;

TEXT
------------------------------------------------------
Welcome to DanBrother's Blog. It's fantastic!

 

declare
v_text varchar2(50):='fantastic!';
begin
select q'#Welcome to DanBrother's Blog. It's #'||v_text into v_text from dual;
dbms_output.put_line(v_text);
end;
/

 

 

arrow
arrow
    全站熱搜

    DanBrother 發表在 痞客邦 留言(0) 人氣()