Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Help with triggers
I have been playing around with my old code and seem to have made some progress. I came up with almost the same solution as you except that it is giving me an error when it tries to join Temp with the 'SSCA-'.
When I use your code I get the error. When I create the trigger it asks for the value of temp. When I give it a value it gives me this error:
LINE/COL ERROR
-------- ----------------------------------------------------------------- 8/21 PLS-00103: Encountered the symbol "6" when expecting one of the following: . ( * @ % & = - + ; < / > at in mod not rem <an exponent (**)> <> or != or ~= >= <= <> and or like between is null is not || is dangling The symbol "*" was substituted for "6" to continue.
The only way I can get past this is to substitute the & with a +. When I do this the trigger is created with no errors. However, when an insert is done I get an error because the trigger is trying add the value of temp to 'SSCA' which can't be done because they are not numbers. Any suggestions?
Thanks for your help
Jeff
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
news:t6rvun98q2gm4c_at_beta-news.demon.nl...
> Corrected code
> CREATE OR REPLACE TRIGGER MY_TEST_TRG
> BEFORE INSERT on Company_reg
> FOR EACH ROW
> DECLARE
> Temp Varchar2(30);
> BEGIN
> select TEST_SEQ2.NEXTVAL
> into temp
> from dual;
>> END MY_TEST_TRG;
> Temp = 'SSCA-' & Temp
> INSERT INTO Company_Reg (Company_Id) Values (Temp);
>
>
> > >