how to do a function to return row type from a table in pl/sql?

后端 未结 2 1960
终归单人心
终归单人心 2020-12-11 07:18

I made this function but it return an error when i execute it!

create or replace function get_accounts
(Acc_id in Account1.account_id%Type)
return account1%r         


        
2条回答
  •  独厮守ぢ
    2020-12-11 07:47

    To call a function in Oracle, you need to use its return value. That is, you can't call it as you would a procedure. Something like this would work:

    declare
      myrow account1%rowtype;
      account_id Account1.account_id%Type := ;
    begin
      myrow := Get_Accounts(account_id); 
    end;
    /
    

提交回复
热议问题