title: Oracle's dbms_metadata.get_ddl for object_type JOB
body: <p>I'd like to create ddl scripts for most of my database objects. <a href="http://psoug.org/reference/dbms_metadata.html" rel="noreferrer">dbms_metadata.get_ddl</a> works for most of the object types. For instance the following creates the ddl for a view:</p>
  
  <pre><code>select dbms_metadata.get_ddl ( 'VIEW', 'SAMPLE_VIEW') from dual
  </code></pre>
  
  <p>On the other hand it's not working for object_type 'JOB'. The following:</p>
  
  <pre><code>select dbms_metadata.get_ddl( 'JOB', 'SAMPLE_JOB' ) from dual
  </code></pre>
  
  <p>gives the following error:</p>
  
  <pre><code>ORA-31604: invalid NAME parameter "NAME" for object type JOB in function SET_FILTER
  ORA-06512: at "SYS.DBMS_SYS_ERROR", line 116
  ORA-06512: at "SYS.DBMS_METADATA_INT", line 4705
  ORA-06512: at "SYS.DBMS_METADATA_INT", line 8582
  ORA-06512: at "SYS.DBMS_METADATA", line 2882
  ORA-06512: at "SYS.DBMS_METADATA", line 2748
  ORA-06512: at "SYS.DBMS_METADATA", line 4333
  ORA-06512: at line 1
  </code></pre>
  
  <p>If I list my jobs using</p>
  
  <pre><code>select * from user_objects where object_type='JOB'
  </code></pre>
  
  <p>it shows SAMPLE_JOB (just like it shows SAMPLE_VIEW if filtered for object_type='VIEW').</p>
  
  <p>Why is it working for VIEW (and TABLE, INDEX, TRIGGER, ...) and not for JOB?</p>
  
  <p>I'm using Oracle 10g.</p>