This discussion is archived
2 Replies Latest reply: Nov 22, 2012 12:38 AM by Nick Walsh RSS

Scheduler extract SQL script

Nick Walsh Newbie
Currently Being Moderated
Hi,

SQL Developer version 3.2.10.09

Is there a way to extract the SQL script from a scheduler job? I have set up a job in my test enviromnent using the SQL Developer wizard which worked extremely well, but my dba insists on having a SQL script to deploy it to the live database.

Thanks,

Nick.
  • 1. Re: Scheduler extract SQL script
    dz_r Newbie
    Currently Being Moderated
    Try this:
    select
      dbms_metadata.get_ddl('PROCOBJ', 'your_job_name')
    from dual;
    -------
    You can also create new tab "DDL" for jobs in SQL Developer by yourself in less than 5 minutes:
    (a) Save the following XML in a file - for example "JobEditDDL.xml"
    <items>
      <item type="editor" objectType="SCHNEWJOB" style="Code">
        <title><![CDATA[*DDL]]></title>
          <query>
            <sql><![CDATA[
    select
      dbms_metadata.get_ddl('PROCOBJ', :OBJECT_NAME)
    from dual
    ]]>
          </sql>
        </query>
      </item>
    </items>
    (b) In SQL Developer open: Tools -> Preferences -> Database -> User defined extensions
    (c) Click button <Add Row>. Select EDITOR (type) and add the full path of the xml file.
    (d) Choose "OK" and restart SQL Developer

    Edited by: dz_r on 2012-11-21 23:12
  • 2. Re: Scheduler extract SQL script
    Nick Walsh Newbie
    Currently Being Moderated
    Excellent. Thank you.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points