Re: PL/SQL

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 16 May 2001 20:16:57 +0200
Message-ID: <tg5gsp8b9bhc9a_at_beta-news.demon.nl>


"Raymond Lee" <mghong_at_pl.jaring.my> wrote in message news:RI8COzbcJ92i+x1DzJWyfr0d9R4F_at_4ax.com...
> Hello
>
> How can I code a PL/SQL with a constant variable.
> For example I have a constant list of status code = "A,B,C,E,F,G,H'
>
> In my package , among some of the module ,I might need this constant
> to perform my status code checking , how can I simplify it ?
>
> Actually can Oracle declare a constant such as this or not
>
> status_code CONSTANT varchar2:=('A','B','C','D','E','F');
> ...
> ..
> .
> .
> .Procedure check_date
>
> if status NOT IN status_code THEN
> MESSAGE ('AAAA');
> end
>
> Is it possible ?
>
>

You either need a pl/sql table or you need to have one string ('ABCDEF') and substring it in your code.
Right now you are supplying multiple varchar2s as constant. That is not going to work.

Hth,

Sybrand Bakker, Oracle DBA Received on Wed May 16 2001 - 20:16:57 CEST

Original text of this message