problem in converting oracle stored procedure

Database
Enthusiast

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;
begin
for 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 sql
Thanks in advance.
1 REPLY
Teradata Employee

Re: problem in converting oracle stored procedure

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