Home » Developer & Programmer » Forms » PRE-INSERT trigger error (windows xp, forms6i with oracle 10g)
icon4.gif  PRE-INSERT trigger error [message #496224] Fri, 25 February 2011 05:49 Go to next message
mastermind444
Messages: 3
Registered: February 2011
Location: New York
Junior Member

when i click save button form give error

pre-insert trigger raised unhahandled exception ora-01722

my pre-insert trigger add some forms data to another table.

how to get rid off this error??

thanks for helping.
Re: PRE-INSERT trigger error [message #496227 is a reply to message #496224] Fri, 25 February 2011 06:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68684
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ORA-01722: invalid number

Solution: give a valid number.

Regards
Michel
Re: PRE-INSERT trigger error [message #496230 is a reply to message #496227] Fri, 25 February 2011 06:35 Go to previous messageGo to next message
mastermind444
Messages: 3
Registered: February 2011
Location: New York
Junior Member
i m giving a valid number when iserting data through pre-insert trigger

SELECT NVL(MAX(S_NO),0)+1 INTO A FROM pay_sal;
Re: PRE-INSERT trigger error [message #496231 is a reply to message #496230] Fri, 25 February 2011 06:37 Go to previous messageGo to next message
Michel Cadot
Messages: 68684
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Who can answer to this? We have no information about the table, column and variable, we have nothing that proves the error comes from this statement.

Regards
Michel
Re: PRE-INSERT trigger error [message #496233 is a reply to message #496231] Fri, 25 February 2011 07:01 Go to previous messageGo to next message
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 #496234 is a reply to message #496233] Fri, 25 February 2011 07:04 Go to previous messageGo to next message
Michel Cadot
Messages: 68684
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Are you sure the error comes from this line?
What are the type of the colums of the table?

Regards
Michel
Re: PRE-INSERT trigger error [message #496237 is a reply to message #496233] Fri, 25 February 2011 07:23 Go to previous messageGo to next message
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
Re: PRE-INSERT trigger error [message #496241 is a reply to message #496233] Fri, 25 February 2011 07:39 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
mastermind444 wrote on Fri, 25 February 2011 08:01

SELECT NVL(MAX(S_NO),0)+1 INTO A FROM pay_sal;


What is the purpose of this line?
Previous Topic: Icons in buttons
Next Topic: find procedure on more than form
Goto Forum:
  


Current Time: Mon Sep 16 13:07:51 CDT 2024