Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Following is simple example of the JITL JobSchedulerPLSQLJob. Following job is is simple example of executing an PL/SQL unanimous code bloc. Following example is selecting current system date and displaying is as a order_date.

Code Block
languagexml
titleSimple JobSchedulerPLSQLJob
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>
<job  title="Execute PL/SQL procedure" order="yes">
    <description >
        <include  file="jobs/JobSchedulerPLSQLJob.xml"/>
    </description>
    <params >
        
        <param  name="db_url"      value="jdbc:oracle:thin:@:1521:DORCL01"/>
        <param  name="db_user"     value="sos_scheduler"/>
        <param  name="db_password" value="sos"/>			
		<param  name="command"     value="
		DECLARE   
		  DECLARE   
		   v_order_date DATE := SYSDATE; 
		BEGIN      		    
			SELECT SYSDATE    
			INTO v_order_date   
			FROM DUAL;     
			DBMS_OUTPUT.PUT_LINE(' +++              +++');   
			DBMS_OUTPUT.PUT_LINE('SET order_date IS '|| v_order_date);  
			DBMS_OUTPUT.PUT_LINE(' +++              +++');   
		END;
		"/>
        <param  name="variable_parser_reg_expr" value="^SET\s+([^\s]+)\s*IS\s+(.*)$"/>
    </params>
    <script  language="java" java_class="sos.scheduler.db.JobSchedulerPLSQLJobJSAdapterClass"/>
    <run_time />
</job>

 

Parameters

Name

Title

Mandatory

Default

Example

command

PL/SQL statements to be executed

true

 

select sysdate from dual

db_url

JDBC connection string

true

 

jdbc:oracle:thin:@localhost:1521:XE

db_user

User name for database access

true

 

 

db_password

Password for database access

true

 

 
variable_parser_reg_expr

Regular expression to parse dbms_output and

set order parameters for next job steps

false^SETs+(\\s)\\s*ISs(.*)$
following line
DBMS_OUTPUT.PUT_LINE('SET order_date IS '|| v_order_date);   
will be parsed by regular expression ^SETs+(\\s)\\s*ISs(.*)$  will result in

order parameter order_date="20140915"

 

How is the PL/SQL script defined?

...