Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

oracle q delimiter - ORA-01036 - illegal variable name/number

user5716448Oct 16 2020 — edited Oct 16 2020

Hi,

version 10.2.0.4

using sql below get ORA-01036 - illegal variable name/number

v_sql := q'[
select to_date('05/10/2020 22:22:43','DD/MM/YYYYHH24:MI:SS')
from dual]';

            dbms\_output.put\_line(v\_sql);    

want to have dynamic sql which has dates such as this - had hoped to use the q delimiter for this but doesn't seem to like.

How can we achieve this with q delimiter- didn't really want to have to use quotes like below a quite alot of dates in the sql concerned.

v_sql := '
select to_date(''05/10/2020 22:22:43'',''DD/MM/YYYYHH24:MI:SS'')
from dual';

            dbms\_output.put\_line(v\_sql);    

Thanks

This post has been answered by user5716448 on Oct 20 2020
Jump to Answer
Comments
Post Details
Added on Oct 16 2020
6 comments
2,243 views