trigger [message #868] |
Sun, 10 March 2002 09:28 |
sara
Messages: 36 Registered: February 2000
|
Member |
|
|
Hello,
trigger PRE-TEXT-ITEM
1.SELECT nvl(max(sno),0)+1 INTO :xyz.sno FROM xyz;
gives result on runtime form sno= 1,2,3 .....
Now I want to generate sno A1, A2, A3....
2.SELECT nvl(to_char(max(sno),'A'||(sno)),0)+1 INTO :xyz.sno FROM xyz;
compile successfully but on runtime gives an error
FRM-40735 TIGGER RAISED UNHANDLED EXCEPTION ORA-00937
What's wrong with this querry.please rectify?
|
|
|
|
Re: trigger [message #890 is a reply to message #868] |
Mon, 11 March 2002 07:10 |
suresh vemulapali
Messages: 6 Registered: January 2002
|
Junior Member |
|
|
Hi pratap,
U r selecting from and inserting into the same table.but thanx anyway.
i did this way at the moment
> insert into xyz (sno) values( 'A-'||SEQ1.NEXTVAL);
>SQL> SELECT * FROM XYZ;
SNO
----------
A-1
But if any one could remove the errors in the following query it would be valued .
> insert into xyz (sno) values( 'A-'||to_char(nvl(max(sno),0)+1));
|
|
|