Hi Folks,
I would like to package the following code in a file (on Unix) and to execute it via the Oracle schedular. However, I can't seem to make the dynamic part of the code to execute.
Can somebody please make a suggestion.
The code is as follows
select case when to_char(SYSDATE, 'DY') = 'MON' then 'select count(*) from test partition(monday);'
when to_char(SYSDATE, 'DY') = 'TUE' then 'select count(*) from test partition(tuesday);'
when to_char(SYSDATE, 'DY') = 'WED' then 'select count(*) from test partition(wednesday);'
when to_char(SYSDATE, 'DY') = 'THU' then 'select count(*) from test partition(thursday);'
when to_char(SYSDATE, 'DY') = 'FRI' then 'select count(*) from test partition(friday);'
when to_char(SYSDATE, 'DY') = 'SAT' then 'select count(*) from test partition(saturday);'
when to_char(SYSDATE, 'DY') = 'SUN' then 'select count(*) from test partition(sunday);'
end
from dual;
Thanks in advance
rogers42
I would like to package the following code in a file (on Unix) and to execute it via the Oracle schedular. However, I can't seem to make the dynamic part of the code to execute.
Can somebody please make a suggestion.
The code is as follows
select case when to_char(SYSDATE, 'DY') = 'MON' then 'select count(*) from test partition(monday);'
when to_char(SYSDATE, 'DY') = 'TUE' then 'select count(*) from test partition(tuesday);'
when to_char(SYSDATE, 'DY') = 'WED' then 'select count(*) from test partition(wednesday);'
when to_char(SYSDATE, 'DY') = 'THU' then 'select count(*) from test partition(thursday);'
when to_char(SYSDATE, 'DY') = 'FRI' then 'select count(*) from test partition(friday);'
when to_char(SYSDATE, 'DY') = 'SAT' then 'select count(*) from test partition(saturday);'
when to_char(SYSDATE, 'DY') = 'SUN' then 'select count(*) from test partition(sunday);'
end
from dual;
Thanks in advance
rogers42