Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Branching Logic
Store all those strings in a Table.Using a cursor and dynamic SQL, U can
achieve this.
Here is the psuedo code.
CREATE TABE string_action
(string VARCHAR2(10), -- to store your string
actio VARCHAR2(200) ); -- the respective SQL statement to perform action
LOOP for row
dbms_sql.parse ( pass the action string from table )
END Loop;
The action can always be changed/updated ate table level, so the PL/SQL is generic
Mohamed
dds_at_visi.com wrote:
> Hi all,
>
> I am working on a project where I have the requirement of branching to
> a specific procedure based upon a string variable. The variables look
> like this 'ABCDEFGH', ABCDEFIJ', etc.
>
> I have the option to change the strings to make them easier to
> evaluate. There is the possibility of up to 10000 of these strings to
> exist.
>
> PL/SQL is pretty limited with its IF-ELSE-END branching structure. I do
> not want to have a IF-ELSIF-END structure with 10000 evaluations.
>
> Anyone have a similar problem or a solution?
>
> Thanks,
>
> Dan
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Jan 12 2000 - 14:35:52 CST
![]() |
![]() |