cancel
Showing results for 
Search instead for 
Did you mean: 

Stored Proc Execution through OS command using shell script

Former Member
0 Kudos

Hi All,

I have a requirement of executing one stored procedure before putting data in Table through JDBC adaptor and two stored procedures after that.

I was thinking to write a shell script and execute it before and after message processing in adaptor.

Can anybody please tell me how should i write a shell script for it?

I have identified that exec <Stored_Proc_Name> is the syntax for it.

Will i need to write something more in this script?

Thanks,

Atul

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Atul,

Stored procedures are written on the Database server for which you are going to write JDBC adapter.

you will just call the storedprocedure in to your adapter.

as per your requirement you shd run one stored procedure (let us say SP1) and then you have to push data into tables and then run SP2 and SP3...

so for this write three stored procedures and call them into another SP. in this SP you call SP1 first then insert statement to insert data into tables and then SP2 and SP3.

finally call SP into your JDBC adapter.

you can call SP1 in SP as below

Var_SQL :='call SP1 (''' || Var_1 || ''',''' || Var_2 ||''')' ;

EXECUTE IMMEDIATE Var_SQL;

i think for this shell script is not required.. correct me if i am wrong...

Regards,

Sukarna.

Former Member
0 Kudos

Hi Sukarna,

Thanks for ur reply.

My problem is The scenario File to JDBC already exists. Only thing i want to change is call stored procedures. In that case i will have to change many things if i follow ur approach.

So i want to call stored proc in OS command only.

If i want to call a stored procedure in JDBC adaptor how can i do it?

Thanks,

Former Member
0 Kudos

Hi Atul,

i didn't work on Shell Scripts.... but i think you can run your script in JDBC adapter by using "Run Operating System Command" in processing tab....

my solution will be idle for your scenario, maintainance would be easy.

Regards,

Sukarna.