dbms job not created [message #529768] |
Wed, 02 November 2011 15:54 |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
Hi Experts,
I am running the follwing statment and it is displaying
job no.But when i am checking in dba_jobs,I am not able
to find it.Is it an oracle bug?
SQL> DECLARE
2 X NUMBER;
3 BEGIN
4 SYS.DBMS_JOB.SUBMIT
5 ( job => X
6 ,what => 'PURGE_CONTROLLER(''A'');'
7 ,next_date => to_date('02/11/2011 14:00:00','dd/mm/yyyy hh24:mi:ss')
8 ,interval => '/*1:Days*/ sysdate + 1'
9 ,no_parse => TRUE
10 );
11 SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
12 END;
13 /
Job Number is: 122
PL/SQL procedure successfully completed.
|
|
|
|
Re: dbms job not created [message #529780 is a reply to message #529770] |
Wed, 02 November 2011 22:23 |
andy huang
Messages: 498 Registered: July 2011
|
Senior Member |
|
|
hi,
my test is not any problem.
SQL> set serveroutput on;
SQL> Declare
2 x Number;
3 Begin
4 Sys.Dbms_Job.Submit(Job => x,
5 What => 'PURGE_CONTROLLER(''A'');',
6 Next_Date => To_Date('02/11/2011 14:00:00',
7 'dd/mm/yyyy hh24:mi:ss'),
8 Interval => 'sysdate + 1',
9 No_Parse => True);
10 Sys.Dbms_Output.Put_Line('Job Number is: ' || To_Char(x));
11 End;
12 /
Job Number is: 104
PL/SQL procedure successfully completed.
SQL> Select job From dba_jobs aa
2 Where aa.JOB =104;
JOB
----------
104
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
|
|
|
|
|
|
|
Re: dbms job not created [message #529867 is a reply to message #529824] |
Thu, 03 November 2011 08:09 |
andy huang
Messages: 498 Registered: July 2011
|
Senior Member |
|
|
hi,
cookiemonster, you must commit your job after job.
Declare
x Number;
Begin
Sys.Dbms_Job.Submit(Job => x,
What => 'PURGE_CONTROLLER(''A'');',
Next_Date => To_Date('02/11/2011 14:00:00',
'dd/mm/yyyy hh24:mi:ss'),
Interval => 'sysdate + 1',
No_Parse => True);
commit; -- it must commit!
Sys.Dbms_Output.Put_Line('Job Number is: ' || To_Char(x));
End;
|
|
|
|
|
Re: dbms job not created [message #529893 is a reply to message #529891] |
Thu, 03 November 2011 09:20 |
|
Michel Cadot
Messages: 68716 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
As well, I mentioned the wiki page only because it is a short introduction easy to read, the documentation is a better input.
Regards
Michel
|
|
|