|
|
|
|
Re: PRE-INSERT trigger error [message #496233 is a reply to message #496231] |
Fri, 25 February 2011 07:01 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/4dbae04997bb8b6e17dcc2e9956fee08?s=64&d=mm&r=g) |
mastermind444
Messages: 3 Registered: February 2011 Location: New York
|
Junior Member |
|
|
PRE-INSERT TRIGGER LOOK LIKE THIS.
DECLARE
A NUMBER;
B NUMBER;
BEGIN
SELECT MAX(S_NO)INTO B from PAY_SAL
WHERE CATEGORY=:C_ID
AND COMPANY=:COMPANY
AND INVOICENO=0;
IF B IS NOT NULL THEN
UPDATE PAY_SAL SET INVOICENO=:INVOICE_MASTER.INVOICENO
WHERE COMPANY=:COMPANY;
ELSE
SELECT NVL(MAX(S_NO),0)+1 INTO A FROM pay_sal;
INSERT INTO PAY_SAL (INVOICENO)
VALUES (:INVOICE_MASTER.INVOICENO);
END IF;
END;
[Updated on: Fri, 25 February 2011 07:02] Report message to a moderator
|
|
|
|
Re: PRE-INSERT trigger error [message #496237 is a reply to message #496233] |
Fri, 25 February 2011 07:23 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Dipali Vithalani
Messages: 278 Registered: March 2007 Location: India
|
Senior Member |
|
|
Check the data type of the table fields and respected form object's data type.
For eg:
PAY_SAL table's INVOICENO field is assinged value of INVOICE_MASTER form's INVOICENO object's value. It is possible that datatype of these two is not matched.. Check other such sets of table fields - form fiends..
Regards,
Dipali
|
|
|
|