Home » Developer & Programmer » Data Integration » runnig unix script before the mapping
runnig unix script before the mapping [message #204428] Mon, 20 November 2006 11:54 Go to next message
femi
Messages: 4
Registered: June 2002
Junior Member
i have a unix script which i want to run before my mapping.
how can i do that in OWB?
Thanks.
Re: runnig unix script before the mapping [message #206284 is a reply to message #204428] Wed, 29 November 2006 07:44 Go to previous messageGo to next message
jvalerof
Messages: 9
Registered: September 2006
Junior Member
One way is define a workflow. Inside the workflow you put

1)an external process that "points to" the shell script and then
2)put the mapping

The external process must have the "COMMAND" parameter set to the name of the shell script. If the script has parameters you must put them in the "PARAMETERS LIST" separated by "?" (for example, ?par1?par2).

The path where OWB executes the external process I think is the ORACLE_HOME of the OWB.

I hope this helps.
Re: runnig unix script before the mapping [message #214941 is a reply to message #204428] Thu, 18 January 2007 12:52 Go to previous message
StephSide
Messages: 1
Registered: January 2007
Location: Montreal, Quebec, Canada
Junior Member
If you don't use workflow, you can try with this more complex solution. I tried with 9i and OWB 9.2 and it's working well.

You create an autonomous procedure (within a package or not) :

CREATE PROCEDURE Extract_Email_List
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;

And use the sys.shell script that you need your dba/unix admin to install first of all, with a call like that.

sys.shell('sh ' || txt_dir_name || '/send_email_marketing.sh ' || txt_dir_name || ' ' || email_addr );

Then you import your procedure into OWB and use it in your mapping with the "pre-mapping" icon (you can set parameters for your proc with constants if you want).

To implement sys.shell, go to metalink and find "Note:168065.1" - "How to call a UNIX shell script from PL/SQL".

Once it's done once, it's not so bad. But I would still recommend the workflow approach also...
Previous Topic: flat file as a target table and external table
Next Topic: Oracle express olap tool
Goto Forum:
  


Current Time: Thu Mar 28 12:50:27 CDT 2024