Script starting with EXEC fails in Toad but works in sql plus.
Steps to reproduce the issue:
1. Log into a database
2. open a sql editor and paste the code below:
SET SERVEROUTPUT ON
EXEC if trunc(sysdate)=to_date('23.05.2013','dd.mm.yyyy') then dbms_output.put_line('today is 23'); else dbms_output.put_line('today is not 23'); end if;
3. Press F5
you will get the error message
BEGIN if trunc(sysdate)=to_date('23.05.2013','dd.mm.yyyy') then dbms_output.put_line('today is 23'); END;
Error at line 2
ORA-06550: line 1, column 106:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
if
Script Terminated on line 2
WORKAROUND
Use double quotes.For example:
EXEC "if trunc(sysdate)=to_date('23.05.2013','dd.mm.yyyy') then dbms_output.put_line('today is 23'); else dbms_output.put_line('today is not 23'); end if;"
STATUS
Waiting for fix in a future release of Toad for Oracle
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center