All Forums Database
abhisiue 7 posts Joined 01/09
02 Jan 2009
problem in converting oracle stored procedure

Hi all,I am novice to teradata and I have a task to convert oracle stored procedure to teradata stored procedure V2R6.2. In oracle procedure I have inner procedures and functions which use normal cursors and cursors with parameters and perform some calculations.eg: /// an oracle test case procedure create or replace procedure sample() is cursor cur1(a varchar2) is select stmt; function get_cost(b varchar2) begin select count(1) into y from b; return (y); end;beginfor r in cur1('sample')loop x = get_cost('tablename');end loop;when i drilled down the reference manuals, there is nothing like cursors with parameters as in oracle and we cannot have user defined functions right away-- we need to write c/c++ to do that.can some one please give me tips to convert the above procedure into teradata sqlThanks in advance.

Adeel Chaudhry 773 posts Joined 04/08
04 Jan 2009

Hello,Functions can be replaced with stored-procedure having an OUT variable. But you need to consider the no. of times it will be called, or if possible convert and embed its logic as SQL.For parameterized cursors, you can use dynamic-SQL.HTH.Regards,Adeel

-- If you are stuck at something .... consider it an opportunity to think anew.

You must sign in to leave a comment.