Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Jobs are created by a user, so query <a href="http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_5332.htm#REFRN26105" rel="nofollow"><code>USER_JOBS</code></a>. This has all the jobs for this user.</p> <p>Equally, as a DBA user you should not be querying <code>JOB$</code>, use <a href="http://docs.oracle.com/cd/E11882_01/server.112/e25513/statviews_4100.htm" rel="nofollow"><code>DBA_JOBS</code></a>.</p> <p>In 11g, <code>DBMS_JOB</code> is only provided <a href="http://docs.oracle.com/cd/E11882_01/server.112/e25494/appendix_a001.htm#BGBFBIHF" rel="nofollow"><em>"for backwards compatability"</em></a>. There's now the much more powerful <a href="http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_sched.htm#ARPLS72235" rel="nofollow"><code>DBMS_SCHEDULER</code></a> instead.</p> <p>However, the premise of your question appears to be flawed. You've written:</p> <blockquote> <p>In my job creation query I need to set a unique 'job_id' that do not conflict with existing dbms_jobs. My plan is to select job_ids from entire dbms_jobs so that from the result set i can decide my job_id is existing or not</p> </blockquote> <p>The job ID in <a href="http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_job.htm#i1000807" rel="nofollow"><code>DMBS_JOB.SUBMIT()</code></a> is an <em>OUT</em> parameter. You do not assign this, the package does if for you.</p> <pre><code>declare l_job_id number; begin dbms_job.submit( l_job_id, what =&gt; ... ); end; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload