Pruthviraj Desai
Pruthviraj Desai

Reputation: 21

While converting a Sybase ASE script to a PL/pgSQL procedure, how we can translate "goto"?

I am trying to rewrite a Sybase ASE script to a PostgreSQL script. There is goto in Sybase ASE to shift the execution to a particular block of code and after executing that block, the execution should end. I am unable to achieve this scenario in a PL/pgSQL procedure.

I want to convert this script to PL/pgSQL:

if (select p_Financial_Table) = Indent then 
goto Indent;

end if;

if (select p_Financial_Table) = TE then

goto TE;

end if;

if (select p_Financial_Table) Selected_Quote then 
goto Selected_Quote;

end if;

if (select p_Financial_Table) Orders 
then goto Orders;

 select NLCLevel, Date_FAClearance into v_NLCLevel, v_Date_FAClearan from Selected_Quote sq where sq.Quote_Key=p_Quote_Key;

Upvotes: 0

Views: 28

Answers (0)

Related Questions