Versions Compared

Key

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

...

#

Name

Title

Mandatory

Default

Example
1

command_script_file

SQL script to be executed

true

 

c:\app\bin\sqls\get_upd_count.sql

2

db_url

Database service or Instance name

true

 

DORCL01

3

db_user

User name for database access

true

 

db username
4

db_password

Password for database access

true

 

db password
5shell_commandSQL plus client nametrue sqlplus
6

variable_parser_reg_expr

Regular expression to parse output and

set order parameters for next job steps

false^SETs+(\\s)\\s*ISs(.*)$

 

 
7Commandcommand_Line_optionsSQL*Plus command line optionsfalse -S -L
8ignore_ora_messagesIgnore ora error messagesfalse  
9ignore_sp2_messagesignore sp2 error messagesfalse  
10include_filesCode blocks should be executed before SQLfalse  

command_script_file

  • The SQL script  can be:
    • saved to a separate file such as get_order.sql . This file can subsequently be referred to as the value of the "command_script_file" job parameter. This is a recommended approach for achieving "separation of concern" in application architecture. 

      Code Block
      languagesql
       <param  name="command_script_file" value="config/live/commn/sqls/get_order.sql"/>
    • SQL code can also be specified as the value of the CDATA tag as part of the Job.XML. This approach is preferred only if the SQL  code is very small and only used by a single job.

      Code Block
      languagesql
       <script  language="java" java_class="sos.scheduler.db.SOSSQLPlusJobJSAdapterClass">
              <![CDATA[
               WHENEVER SQLERROR EXIT SQL.SQLCODE
              WHENEVER OSERROR EXIT FAILURE
              SELECT TO_CHAR(SYSDATE,'dd.mm.yyyy DAY') FROM DUAL;
              ]]>
          </script>

...

The password for the DB user defined in the db_user parameter.

shell_command

x

variable_parser_reg_expr 

By default the JobSchedulerSQLPlus job defines a regular expression to parse console output from the execution of SQL Script and sets order parameters for subsequent job steps. For example, the SQL*Plus client stdout  prompt SET period_prev IS ${PN_YEAR_PREV_PERIOD}  displays the output on console; if  period_prev is 20140915, it will be parsed by regular expression ^SETs+(\\s)\\s*ISs(.*)$ and return the period_prev="20140915" order parameter.  All stdout statements matching the ^SETs+(\\s)\\s*ISs(.*)$ regular expression will be set as order_parameters.

command_Line_options

 x

ignore_ora_messages

x

ignore_sp2_messages

x

include_files

x

Saving Database Connection Settings in a Parameter File

...

Code Block
languagesql
titledatabase_connection_sqlplus.parameter.xml
collapsetrue
 <params >
    <param  name="db_url"      value="DORCL01"/>
    <param  name="db_user"     value="sos_scheduler"/>
    <param  name="db_password" value="sos"/>
</params>

...