Add date and time into DBMS_SCHEDULER.CREATE_JOB job name
711993Dec 3 2009 — edited Dec 6 2009Hi,
I have a JDeveloper application that needs to create
"DBMS_SCHEDULER.CREATE_JOB ()"
The problem that I am facing is that I may need to create two jobs that may be waiting at the same time. When this happens I am getting an error saying that this job name already exists.
So I have tried to create the name of the Job so that it has the data and time the Job was created, which will give it a unique identifier. But whenever I have tried the following I get a invalid name for database object error.
begin
DBMS_SCHEDULER.CREATE_JOB (
'EmailJobDefinition'||to_char(SYSDATE,'DD-MM-YY HH24:MI:SS')||'',
'PLSQL_BLOCK',
'BEGIN EMAIL.SEND_LONG_MAIL('','','','') END',
0,
to_date('03/12/2009 09:30',' DD/MM/YYYY HH24:MI:SS'),
NULL,
NULL,
'DEFAULT_JOB_CLASS',
FALSE,--TRUE?
TRUE,
'Comments');
end;
Is there a way to incorporate the date and time into the name of the job name?
Thanks,
Steve