Subject | Re: loop on ascci_char() |
---|---|
Author | cwkuok |
Post date | 2003-04-11T00:59:36Z |
--- In ib-support@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
i use procedure to detect return the position of substring ....
e.g. Execute Procedure Pos 'a', 'dfsfa'
will return 5 .
i use Procedure to detect the location of character '@' , ....
whether it exist or not .
> At 10:23 AM 10/04/2003 +0000, you wrote:location;
> >the following trigger throw exception when insert 'A' into field_1
> >for table_1:
> >
> >set term !! ;
> >create trigger CS_table_1 for table_1
> > before insert position 20
> >as
> > declare variable temp integer;
> > declare variable a_char char;
> > declare variable location integer;
> >begin
> > a_char = ascii_char(65)
> > Execute procedure Pos a_char, new.Field_1 RETURNING_VALUES
> > if (location <> 0) thenother
> > begin
> > exception CS_ERMG_INVALID_DATAVIEW_NAME;
> > end
> > end
> >end!!
> >set term ; !!
> >
> >but this is not what i want, i want to throw the exception when
> >insert character other than [A-Z] into field_1..Field_1 is a string of varchar(50)
> >
> >so i need some of the part have a loop such as below :
>
> Why do you need a procedure and a loop?
>
> Won't this test do what you want?
>
> if (ascii_val(new.Field_1) NOT BETWEEN 65 AND 90) then
> exception CS_ERMG_INVALID_DATAVIEW_NAME;
>
> heLen
i use procedure to detect return the position of substring ....
e.g. Execute Procedure Pos 'a', 'dfsfa'
will return 5 .
i use Procedure to detect the location of character '@' , ....
whether it exist or not .