Get the error below when compiling the code (also see below) in SQL Editor using the "Execute Statement" and Execute as Script" buttons. However, the same code compiles fine in SQL Plus or when the "Execute in QSR" and "Execute in SQL Plus" in SQL Editor is used.
[Error] Syntax check (15: 15)
ERROR line 15, col 15, ending_line 15, ending_col 18, Found 'date', Expecting: decimal number float integer string
CODE:
create or replace function weekdays_in_range
return number
is
v_weekdays_in_range number;
begin
select count(*)
into v_weekdays_in_range
from(
select x
from dual
where 1=2
model
dimension by (to_date(null) x)
measures (0 y)
(y[for x from date '2007-11-08' to date '2008-01-07' increment interval '1' day]=0)
)
where to_char(x,'d') not in ('1','7');
return v_weekdays_in_range;
end weekdays_in_range;
/
WORKAROUND:
None
STATUS:
Waiting for fix in a future release of Toad for Oracle.
This is fixed in Toad for Oracle 9.7 Beta.
© ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center