COGNOiSe.com - The IBM Cognos Community

ETL, App Development and other tools => COGNOS DecisionStream/Data Manager => Topic started by: vetteheadracer on 09 Jul 2007 10:01:03 AM

Title: [Solved] Calling a PL/SQL Procedure from a Jobstream
Post by: vetteheadracer on 09 Jul 2007 10:01:03 AM
Is it possible to call a pl/sql procedure from a Jobstream in DecisionStream?

If so what is the syntax? Should I use a Procedure Node or a SQL Node?
Title: Re: Calling a PL/SQL Procedure from a Jobstream
Post by: chad.ongstad on 09 Jul 2007 02:04:05 PM
use a procedure node.... you will need to add a sql function

  Sql(connection,sqlstatement);


SQL('SOURCEA','BEGIN <PROC NAME (PARAMETERS)>; END;');

If you need to pass in parameters from DS you will need to use the concat function to create your sql statement on the fly.

Chad


Title: Re: [Solved] Calling a PL/SQL Procedure from a Jobstream
Post by: vetteheadracer on 16 Jul 2007 06:51:37 AM
Thanks Chad it worked great :)
Title: Re: [Solved] Calling a PL/SQL Procedure from a Jobstream
Post by: bmilespal on 26 Oct 2007 03:35:23 PM
Is it possible to get Event Studio to execute a Decision Stream job?

If so, how?
Title: Re: [Solved] Calling a PL/SQL Procedure from a Jobstream
Post by: newmans_99 on 27 Oct 2007 12:46:22 PM
Yes. From Data Manager 8.2+ you can publish Data Movement tasks into Cognos Connection. These tasks can then be added to a Job, these Jobs can be called from Even Studio.

Steve
Title: Re: [Solved] Calling a PL/SQL Procedure from a Jobstream
Post by: wendoze on 15 Nov 2007 10:02:35 PM
Hey Chad,

Any chance you can elaborate on "If you need to pass in parameters from DS you will need to use the concat function to create your sql statement on the fly."

I'm having probs passing a parameter, even when I copy the syntax straight from Toad. Not sure what you mean by using the concat function....?

thanks heaps.
Title: Re: [Solved] Calling a PL/SQL Procedure from a Jobstream
Post by: wendoze on 15 Nov 2007 10:39:22 PM
Nevermind, worked it out (eventually!).  ;)

Thanks for the tip.

If anyone is intersested, instead of the following from Toad (off Oracle):

======================
DECLARE
  V_DATASOURCE VARCHAR2(200);

BEGIN
  V_DATASOURCE := 'CFMS';

  DB.DATA_CONTROL_UPDATE_CURR_FLAG ( V_DATASOURCE );
  COMMIT;
END;

========================
I called it with this in Stored Procedure Node:

Sql('DB',
'BEGIN DB.DATA_CONTROL_UPDATE_CURR_FLAG (''CFMS'');
  COMMIT;
END;');

========================
Title: Re: [Solved] Calling a PL/SQL Procedure from a Jobstream
Post by: chad.ongstad on 16 Nov 2007 11:33:26 PM
If you don't want to hardcode your input parameters to your function you would need to do the following in your procedure node. This would be particulary usefull if the procedure is going to be called multiple times with different parameters. Allowing you to pass the variables through to the procedure each time you call it.

$v_Param1 := '''CFMS''';
$v_DB := 'DB';
$v_SQL := concat('BEGIN DB.DATA_CONTROL_UPDATE_CURR_FLAG (' ,$v_Param1, '); COMMIT; END;');
Sql($v_DB,$v_SQL);