How to execute DB2 stored procedure multiple times to update multiple records - informatica-powercenter

I want to create a mapping to update multiple records, more than 1000 records in DB2 using/calling a stored procedure. We will send the parameters to call the stored procedure. How to implement that?
Target is DB2 table
We should use DB2 stored procedure to update or insert records
How to create the mapping-target to execute stored procedure multiple times?

You can not use Informatica to run anything in loop. However you can put DC code into a stored procedure, setup and schedule a workflow to run at desired frequency.

Related

Is there a way to check what oracle stored procdure is loading while running

I have a stored procedure which has been running for a long time and I don't find any entry for that in v$session_longops. Is there a way to check on the current status of that?
Also, am pretty new to oracle. So is there a way to check on the amount of data the proc is trying to load into a table just like work flow monitor in informatica?
I am a dev and am using Oracle 12c.
Check with a view called gv$session. Column sql_text should let you identify your session and column rows_processed should tell you how many rows, if any, have been processed.
You may need to ask your DBA to grant you access to that view.

Avoiding frequent call to same view inside a Oracle procedure

I have a oracle view it returns 5 million records from different tables and i use this view to insert into different tables using a single procedure, inside this procedure i use this several times and this is affecting the performance, is there any way we can query the view once and later i can use it multiple places?
A view is a stored query; itself, it doesn't contain any data. If its code is complex and fetches data from several tables, using different conditions, aggregations, whatnot, it can take some time to access data.
In your situation, maybe a global (or private; depending on Oracle version you use) temporary table (GTT) would help.
you create it once
at the beginning of the procedure, insert data from the view into it
the rest of the procedure would work with those prepared data
once the session (or transaction; depending on how you set the GTT up) is over, data from the table is lost
the table can be reused next time you run the procedure

Generate insert statement using a stored procedure for all tables in a database

Using a a stored procedure I want to generate insert scripts for all the tables available in database and the table name and the columns must be passed as a parameter, how to do this?

pl/sql stored procedure writes to a different table

Good day Everyone,
I am fairly new to pl/sql stored procedure. I have a script that calls a stored procedure that will execute many stored procedures sequentially. Now my problem is one of my stored procedures writes to a different table instead to the table that it should write to. But when i run the stored procedure on its own it write to the correct table. Any ideas on why is this happening?

Is it possible in oracle to trigger a SAS program after an insert or update on oracle table?

I'm new to oracle and I saw Oracle triggers can trigger some action after an update or insert is done on oracle table.
Is it possible to trigger a SAS program after every update or insert on Oracle table.
There's a few different ways to do this but a problem like this is an example of the saying "Just because you can, doesn't mean you should".
So sure, your trigger can be fired on update or insert and that can call a stored procedure in a package which can use the oracle host command to call an operating system command which can call SAS.
Here are some questions:
do you really want to install SAS on the same machine as your Oracle database?
do you really want every transaction that inserts or updates to have to wait until the host command completes? What if SAS is down? Do you want the transaction to complete or.....?
do you really want the account that runs the database to have privileges to start up or send information to other executables? Think security risks.
if an insert does one record the action is clear. What if an update affects a thousand records? What message do you want to send to SAS? One thousand update statements? One update statement?
There are better ways to do this but a complete answer needs more details from you as to the end goal and business logic involved. Some ways I have used include:
trigger inserts data into an Oracle advanced queue. At predetermined intervals take the changes off the queue and write them to a flat file. Write a file watcher to look for the files and send the info to SAS.
write a Java program to take the changes and ship them
use the APEX web service and expose the changes as a series of JSON or REST packets.

Resources