How to run OWB mappings from SQL*Plus

Hi:
I used to run OWB mappings using the sample code RUN_MY_OWB_STUFF in a customized PL/SQL procedure. This works for OWB 10g release 1 but not for OWB Paris (10g Release 2) because the execution always returns FAILURE.
Is there something new in OWB Paris that RUN_MY_OWB_STUFF doesn't work anymore?
Thanks,
Hazbleydi C. Verástegui

Hi Maruthi:
I already check the input parameters of the mapping. I'm setting them as a custom parameters. This is the output of the execution:
16:01:11 SQL> EXEC PR_RUN_OWBMAPPING_TABLA2('MPG_EMPLEADOS_NOMINA_PERIODO',2007,01);
Stage 1: Decoding Parameters
| location_name=LOC_DM_STAGING
| task_type=PLSQL
| task_name=MPG_EMPLEADOS_NOMINA_PERIODO
Stage 2: Opening Task
| l_audit_execution_id=39635
Stage 3: Overriding Parameters
| P_ANO%CUSTOM='2007'
| P_MES%CUSTOM='1'
Stage 4: Executing Task
| l_audit_result=3 (FAILURE)
Stage 5: Closing Task
Stage 6: Processing Result
| exit=3
By the way, RUN_MY_OWB_STUFF is the same as RUN_OWB_CODE.sql except for the two first parameters (p_result and p_audit_id):
create or replace procedure run_owb_code
( p_result out number
, p_audit_id out number
, p_repos_owner in varchar2 default null
, p_location_name in varchar2 default null
, p_task_type in varchar2 default null
, p_task_name in varchar2 default null
, p_system_params in varchar2 default '","'
, p_custom_params in varchar2 default '","'
, p_oem_friendly in number default 0
is
CREATE OR REPLACE function run_my_owb_stuff
( p_repos_owner in varchar2 default null
, p_location_name in varchar2 default null
, p_task_type in varchar2 default null
, p_task_name in varchar2 default null
, p_system_params in varchar2 default '","'
, p_custom_params in varchar2 default '","'
, p_oem_friendly in number default 0
) return number
is
How do you invoke your wrapper PL/SQL with these two first parameters?
Thanks in advance,
Hazbleydi C. Verástegui

Similar Messages

  • How to run multiple scripts in sql*plus?

    I would like to run 2 scripts in sql*plus, how do I do this? I tried the following, but it won't run.
    create table student_new
    AS
    select *
    from student
    insert into student_new
    (last_name, first_name
    values
    (Crop, Jenny)
    The above are the two scripts I want to run, what am I doing wrong.
    Thanks

    Do you have a solution to run multiple scripts continuosly, one after the other as one script.
    Say I have file1.sql file2.sql, file3.sql.
    I want to create a script run.sql, where this will run file1.sql,file2.sql,file3.sql one after other without any one running one after the other like follows:
    run.sql should have
    begin
    @file1.sql
    @file2.sql
    @file3.sql
    dbms_output.put_line(select sysdate from dual);
    end;
    If I run run.sql all the three scripts should be executed successfully and then display the current time . All these files have update statements(50,000 updates each file).
    Very urgetn. Can some one hlpe, please.
    Thanks in advance.

  • How execute this stored procedure from SQL PLUS???

    Hello folks....
    Help me please...
    I have this procedure....
    CREATE OR REPLACE PROCEDURE TEST(COD OUT VARCHAR2, NUM OUT
    VARCHAR2, ID OUT VARCHAR2)
    AS
    BEGIN
    END;
    SO, I4D LIKE TO EXECUTE IT FROM SQL PLUS::
    BUT, I DONT KNOW HOW TO DO..PLEASE SEND ME A SAMPLE..
    THANK U

    Thank u man!!!
    look, my error before was :
    SQL> set serveroutput on
    SQL> declare
    SQL> cod varchar2(100);
    SQL> num varchar2(100);
    SQL> id varchar2(100);
    SQL> begin
    SQL> TEST( cod, num, id );
    SQL> EXEC DBMS_OUTPUT.put_line( cod || ' ' || num || ' ' ||
    id );
    SQL> end;
    SQL> /
    i put the EXEC....
    thank u!!!

  • How to return a value from sql plus activity

    Hi,
    I want to return a value from sqlplus activity to a processflow variable.
    SQL PLUS activity has a property :"RESULT_CODE", whenever i run the process flow this value is always reurned as 0.
    in sqlplus activity i have written some pl/sql block....
    for example
    begin
    end;
    exit
    i want to do something like
    begin
    if v=100 then
    return 1
    else
    return 0;
    end if;
    end;
    exit
    can some please tell me how can i return value from this pl/sql block to proessflow.
    Regards,
    RD_RBS

    table ==> function
    input param from table to function. ==> input mapping paramter to store the output from the mapping.
    Will this now work.

  • How to detect client OS from SQL*Plus script

    Sometimes in a SQL*Plus script I need to execute OS commands e.g.
    host rm tempfile.bufHowever of course Windows has no "rm" command by default, so I have to edit the script to use
    host del tempfile.bufNow if I could define &DELETE (for example, "cat"/"type" is another) as a substitution variable, I could just use
    host &DELETE tempfile.bufMaybe I need more coffee but all I could come up with was something like this:
    def rm=rm
    def cat=cat
    spool sqlplus_windows_defs.cmd
    prompt echo def rm=del
    prompt echo def cat=type
    spool off
    host .\sqlplus_windows_defs > sqlplus_windows_defs.sql
    @sqlplus_windows_defs.sql
    host &rm sqlplus_windows_defs.cmd
    host &rm sqlplus_windows_defs.sqlthe idea being that you first define the variables for nix ("rm" and "cat"), then attempt to create and execute a Windows command file containing DOS versions ("dele" and "type"), which does not run under nix. Unfortunately the OS failure message (".sqlplus_windows_defs: not found" in Unix) appears on the screen despite SET TERM OFF, so I'm back where I started.
    I know there are various ways to get the server OS, and you can get the SQL*Plus version with &_SQLPLUS_RELEASE and so on, but I can't see a way to determine the client OS. Any suggestions?

    Thanks guys. This seems to work in Windows XP - will try on Unix when I get a chance:
    col DELETE_COMMAND new_value DELETE_COMMAND
    col LIST_COMMAND new_value LIST_COMMAND
    def list_command = TYPE
    def delete_command = DEL
    SELECT DECODE(os,'MSWIN','TYPE','cat') AS list_command
         , DECODE(os,'MSWIN','DEL','rm')   AS delete_command
    FROM   ( SELECT CASE WHEN UPPER(program) LIKE '%.EXE' THEN 'MSWIN' END AS os
             FROM   v$session
             WHERE  audsid = SYS_CONTEXT('userenv','sessionid') );
    host &LIST_COMMAND xplan_errors.lst
    host &DELETE_COMMAND xplan_errors.lstIf the user doesn't have access to v$session it will just default to the Windows commands.
    http://www.williamrobertson.net/code/xplan.sql

  • How to Strip Extraneous Output from SQL*Plus Session

    We are running Oracle Database 11g on Solaris 10, and I am trying to use SQL*Plus to create a temporary .sql file that I can execute in a later step of a Korn shell script. Here is the code:
         $ORACLE_HOME/bin/sqlplus / as sysdba <<EOF
    --whenever oserror exit failure;
    --whenever sqlerror exit sql.sqlcode;
    set serveroutput on
    set termout off
    set trimspool on
    set verify off
    set heading off
    set feedback off
    set echo off
    spool /usr/oracle/temp/apply_site_security_for_oracle_database_11g.ksh.tmp
    declare
         Value_DSC varchar2(2000);
         CommandLine_DSC varchar2(4000);
    begin
         select v\$parameter.value into Value_DSC from v\$parameter where lower(name)='diagnostic_dest';
         CommandLine_DSC := 'host chmod 751 ' || Value_DSC;
         dbms_output.put_line('--Ready to execute: ' || CommandLine_DSC);
         dbms_output.put_line(CommandLine_DSC);
         CommandLine_DSC := 'host ls -ld ' || Value_DSC;
         dbms_output.put_line('--Ready to execute: ' || CommandLine_DSC);
         dbms_output.put_line(CommandLine_DSC);
    end;
    spool off;
    exit;
    EOF
    I've tried to turn off everything I don't need, but I am missing something. When I run the script, I get the following in the temporary file:
    SQL>
    SQL> declare
    2 Value_DSC varchar2(2000);
    3 CommandLine_DSC varchar2(4000);
    4
    5 begin
    6 select v$parameter.value into Value_DSC from v$parameter where lower(name)='diagnostic_dest';
    7
    8 CommandLine_DSC := 'host chmod 751 ' || Value_DSC;
    9 dbms_output.put_line('--Ready to execute: ' || CommandLine_DSC);
    10 dbms_output.put_line(CommandLine_DSC);
    11
    12 CommandLine_DSC := 'host ls -ld ' || Value_DSC;
    13 dbms_output.put_line('--Ready to execute: ' || CommandLine_DSC);
    14 dbms_output.put_line(CommandLine_DSC);
    15 end;
    16 /
    --Ready to execute: host chmod 751 /s01/app/oracle
    host chmod 751 /s01/app/oracle
    --Ready to execute: host ls -ld /s01/app/oracle
    host ls -ld /s01/app/oracle
    SQL>
    SQL> spool off;
    I am hoping to whittle this down to just the following lines so I can execute them as a script.
    --Ready to execute: host chmod 751 /s01/app/oracle
    host chmod 751 /s01/app/oracle
    --Ready to execute: host ls -ld /s01/app/oracle
    host ls -ld /s01/app/oracle
    Any ideas?
    Edited by: shew01 on Jan 19, 2010 10:51 AM

    I just found it. Just add "-S" to the sqlplus command. Argh... I hunted for that a while back. Why didn't I remember it??????????
    This works:
         $ORACLE_HOME/bin/sqlplus -S / as sysdba <<EOF
    whenever oserror exit failure;
    whenever sqlerror exit sql.sqlcode;
    set serveroutput on
    set linesize 2000
    set pagesize 0
    set termout off
    set trimspool on
    set feedback off
    spool /usr/oracle/temp/apply_site_security_for_oracle_database_11g.ksh.tmp
    declare
         Value_DSC varchar2(2000);
         CommandLine_DSC varchar2(4000);
    begin
         select v\$parameter.value into Value_DSC from v\$parameter where lower(name)='diagnostic_dest';
         CommandLine_DSC := 'host chmod 751 ' || Value_DSC;
         dbms_output.put_line('--Ready to execute: ' || CommandLine_DSC);
         dbms_output.put_line(CommandLine_DSC);
         CommandLine_DSC := 'host ls -ld ' || Value_DSC;
         dbms_output.put_line('--Ready to execute: ' || CommandLine_DSC);
         dbms_output.put_line(CommandLine_DSC);
    end;
    spool off;
    exit;
    EOF
    Edited by: shew01 on Jan 19, 2010 11:02 AM

  • How to compile a procedure from Sql*Plus?

    Dear friends,
    I couldnt find the way how to compile my invalid procedure through sql*Plus.
    I know this is very awkward,but I m in need of that command only.
    Thanks
    Ritesh Sharma

    Pls check it --
    SQL>
    SQL>
    SQL> @C:\RND\Oracle\Function\a.sql;
    11  /
    Function created.
    SQL>
    SQL>
    SQL> start C:\RND\Oracle\Function\a.sql;
    11  /
    Function created.
    SQL> Regards.
    Satyaki De.

  • Can we run a unix script from sql plus

    Hello,
    Is there any possibility to run unix command from sql plus? I would appreciate if you can provide with the syntax.
    Thank You
    KK

    user539616 wrote:
    Hello,
    Is there any possibility to run unix command from sql plus? I would appreciate if you can provide with the syntax.
    Thank You
    KKWithin sqlplus you can run
    1) SQL statements
    2) PL/SQL blocks
    3) any valid sqlplus command.
    SQLplus commands are documented in the SQLPlus reference manual. For 10g this is found at http://docs.oracle.com/cd/B19306_01/server.102/b14357/toc.htm. You might be interested in the HOST command, detailed at http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12026.htm#sthref2314
    Just beware that the HOST command (or the shortcut version of it alluded to by Warren Tolentino) spawns a child process. When control comes back to sqlplus, that child process is gone.
    What is the business problem you are trying to solve? If we knew that we could probably give better advice than blindly giving you the correct technical answer to a narrow question.

  • How to run O/S command from SQL * Plus.

    Hi,
    Can i run O/S commands, say copy or move, from SQL * Plus prompt? If yes, what is the command.
    Thanks.

    hi,
    or you can try the following
    slq > !
    and then your command
    rgds
    Alan

  • Execute a mapping deployed with OWB 9.0.4 from SQL*Plus

    Hello,
    I could execute a mapping designed with OWB 9.0.3 from SQL*Plus with the next sentence:
    SQL> exec my_mapping.main;
    But now, with OWB 9.0.4, mappings are deployed as functions (in 9.0.3 were deployed as procedures) and they need parameters.
    Somebody know how I can execute deployed mappings with OWB 9.0.4 from SQL*Plus? I don't know the parameters I need to call a mapping.
    Thanks in advance,
    Pedro.

    Well, I've solved the problem with roles but
    I've executed the script called sqlplus_exec_template.sql and it fails at Stage 2 because the next sentence
    l_audit_execution_id := wb_rt_api_exec.open(l_task_type, l_task_name, l_location_name);
    returns me NULL.
    It is not clear the value that the variable called l_location_name have to stored. The script explain that this variable store the physical name of the
    location to which the task was deployed. I understand that this variable have to store the schema where the mapping was deployed. That's right?
    So I called the script in this manner:
    SQL> @sqlplus_exec_template OWBRUN904I OJBHT PLSQL MY_MAPPING "," "," ;
    where OWBRUN904I is the name of the Runtime Repository Schema, OJBHT is the
    schema where MY_MAPPING is deployed, PLSQL is the task type and MY_MAPPING is
    the name of the mapping I've designed.
    Can you tell me why the scripts fails?
    Regards,
    Pedro

  • How to pass table type variable into function from SQL*PLUS ?

    How to pass a table type variable from sql*plus prompt into a function ?
    Thanx in advance.

    Krishna,
    Do you mean like this?SQL> DECLARE
      2      TYPE t_tbl IS TABLE OF VARCHAR2(20);
      3      l_sample_tbl           t_tbl;
      4
      5      FUNCTION print_contents ( p_tbl IN t_tbl )
      6      RETURN VARCHAR2
      7      IS
      8          l_string            VARCHAR2(1000);
      9      BEGIN
    10          FOR i IN 1..p_tbl.COUNT LOOP
    11              IF (i = 1) THEN
    12                  l_string := p_tbl(i);
    13              ELSE
    14                  l_string := l_string || ', ' || p_tbl(i);
    15              END IF;
    16          END LOOP;
    17          RETURN (l_string);
    18      END print_contents;
    19
    20  BEGIN
    21      l_sample_tbl := t_tbl();
    22      l_sample_tbl.EXTEND;
    23      l_sample_tbl(1) := 'one';
    24      l_sample_tbl.EXTEND;
    25      l_sample_tbl(2) := 'two';
    26      l_sample_tbl.EXTEND;
    27      l_sample_tbl(3) := 'three';
    28      l_sample_tbl.EXTEND;
    29      l_sample_tbl(4) := 'four';
    30      l_sample_tbl.EXTEND;
    31      l_sample_tbl(5) := 'five';
    32      DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
    33  END;
    34  /
    one, two, three, four, five
    PL/SQL procedure successfully completed.
    SQL> HTH,
    T.

  • How to exit from SQL PlUS

    HI,I came to know that direct exit from SQL Plus without Oracle shutdown causes future issues of ORA-0600 kind of errors. Is it true? If yes could u pls suggest me how to shutdown from user "SYSTEM/manager". Bcoz with this am warned that I dont have previleges.

    Hello,
    HI,I came to know that direct exit from SQL Plus without Oracle shutdown causes future issues of ORA-0600 kind of errors. Is it true?The ORA-00600 is an internal error it can be caused for instance by a Bug, a corruption, ... , and if someday you experience this kind of error, you should open a Service Request to My Oracle Support.
    However, I've never heard that exiting sqlplus could cause this kind of error. Where did you get such information ?
    how to shutdown from user "SYSTEM/manager". To shutdown the database you should be connected with the User SYS (as SYSDBA). You may use the following statement:
    sqlplus /nolog
    connect / as sysdba
    shutdown immediate;
    exitHope this help.
    Best regards,
    Jean-Valentin

  • How to connect from sql*plus to Sql Server

    Dear Profs.
    How I can connect from sql*plus v8 on my local pc(Win XP) to Sql Server Express 2005 light weight installed in same local pc ?
    Thanks,
    Ahmed.

    You'll need to setup heterogeneous services. This is done by creating an init file for the SQL Server db with %ORACLE_HOME%\hs\admin that refers to a DSN for the Sql Server Database. The listener would also need an entry for the SQL Server DB DSN. After that you would create a dblink to SQL Server in your Oracle instance and then could query across the dblink.

  • How to login as DBA in oracle 9i from sql plus .

    how to login as DBA in oracle 9i from sql plus . ???

    First you need to check whether your HR schema is still unlocked or not? If it is locked - then you have to unlock it. And, then you can connect the Hr schema.
    But, i'm not sure - why you need system to log into the HR schema?
    Regards.
    Satyaki De.

  • How to start/stop process flow from sql*plus?

    Hi,
    i know how to start a process flow via sqlplus_exec_template.sql, but i cannot find any information on how to stop (and rollback) a working flow from sql*plus. Any help would be appreciated.
    Greetings
    Christoph
    Message was edited by:
    ctrierweiler

    Hi,
    I've had a go.
    How should I interpret the results of list_requests:
    owner_owr@ORKDEV01> @list_requests
    ====================
    DEPLOYMENTS
    ====================
    Audit ID Status Name Date Owner
    2706 READY Deployment Fri Nov 11-NOV-05 10:49:59 OWNER_OWR
    11 10:46:37 CET 2
    005
    ====================
    DEPLOYMENT UNITS
    ====================
    Audit ID Status Name Date Owner
    2707 READY Unit0 11-NOV-05 10:49:59 OWNER_OWR
    ====================
    EXECUTIONS
    ====================
    Er zijn geen rijen geselecteerd.
    owner_owr@ORKDEV01>
    Whilst a process flow is executing the last query will list executions, all of which have status BUSY:
    owner_owr@ORKDEV01> @list_requests
    ====================
    DEPLOYMENTS
    ====================
    Audit ID Status Name Date Owner
    2706 READY Deployment Fri Nov 11-NOV-05 10:49:59 OWNER_OWR
    11 10:46:37 CET 2
    005
    ====================
    DEPLOYMENT UNITS
    ====================
    Audit ID Status Name Date Owner
    2707 READY Unit0 11-NOV-05 10:49:59 OWNER_OWR
    ====================
    EXECUTIONS
    ====================
    Audit ID Status Name Date Owner
    394512 BUSY PF_ONB01 04-MEI-06 09:11:12 OWNER_OWX
    395328 BUSY ONB:FULL_PREPARE 04-MEI-06 09:11:55 OWNER_OWR
    395324 BUSY PF_ONB01:ONB 04-MEI-06 09:11:55 OWNER_OWR
    owner_owr@ORKDEV01>
    As an aside, I will attempt to get rid of the READY deployment and deployment unit using deactive_deployment.sql
    Now, if I attempt to use deactivate_execution.sql on any of the executions with status BUSY I get:
    owner_owr@ORKDEV01> @deactivate_execution
    Voer waarde voor 1 in: 396136
    declare
    FOUT in regel 1:
    .ORA-20003: The object is not in a valid state for the requested operation
    ORA-06512: at "OWNER_OWR.WB_RTI_EXCEPTIONS", line 94
    ORA-06512: at "OWNER_OWR.WB_RTI_EXECUTION", line 774
    ORA-06512: at "OWNER_OWR.WB_RT_EXECUTION", line 90
    ORA-06512: at line 4
    owner_owr@ORKDEV01>
    So all the seems to remain is to use abort_exec_request.sql
    This does the job, but the script itself hangs.
    I think it has to do with the l_stream_id not being checked again after the initial IF. I think it should probably be part of the loop condition as it is again reset in the do_acks inside the loop.
    Cheers & thanks,
    Colin

Maybe you are looking for

  • Error- Unable to lookup in the system.

    Dear All, For my backend server I have created system object on portal. Then I have made 1 transaction iview for the same system object. In the preview of the iview it is showing me correct screen and its operations are also fine. But when I am attac

  • ITunes says there is music on my iPhone but it's not showing up!

    iTunes says it is syncing with my iPhone, and it says there is music on the iPhone. However, on the 'iPod' section of my iPhone, there is nothing there! I have synced multiple times (am also having LOADS of issues with files that iTunes says are corr

  • Customer wise  material list

    Dear all , i have a requirement from the client  who needs  customer wise  all the details like General data, Sales area data, and also the  partnumber  which are   being sold ,  is this possible through standard report, or do we need to customize fo

  • Using analog outputs in labview with

    I have recently started using the USB personal measurement device PMD1208-LS from measurement computing with labview. I am having problems with using the analog outputs in labview i keep getting error message 41 "This function can not be used with th

  • Border around "scale-to-fit" image is not "tight" around image

    I have a form with repeating pages that displays an image (jpg file) on each page. Each image is a different size so I need to use the scale-to-fit feature so the images appear in a predetermined location. One of the requirements given to me is that