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.

Add date and time into DBMS_SCHEDULER.CREATE_JOB job name

711993Dec 3 2009 — edited Dec 6 2009
Hi,
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
This post has been answered by 730428 on Dec 3 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2010
Added on Dec 3 2009
6 comments
635 views