Home » Developer & Programmer » Forms » ora-40735
ora-40735 [message #669153] Thu, 05 April 2018 09:27 Go to next message
Messages: 1
Registered: April 2018
Junior Member

down vote
this is my code i wrote for when_mouse_click trigger on a button

a varchar2(20) := '&book_no';
b varchar2(20) := '&book_name';
c varchar2(20) := '&price';
d number(4) := '&no_of_books';
insert into book
values (a,b,c,d);
when VALUE_ERROR then
dbms_output.put_line('VALUE_ERROR exception raised');
it compiled sucessfully but when i run it says frm-40735:when mouse click trigger raised unhandled exception ora-06502 but when i display error it says "no errors encountered recntly " at the same time i run this query on my sqlplus it runs sucessfully. please give me a solution soon it wil b very grateful to you .
Re: ora-40735 [message #669155 is a reply to message #669153] Thu, 05 April 2018 09:39 Go to previous messageGo to next message
Messages: 13910
Registered: September 2008
Location: Rainy Manchester
Senior Member
'&' is used to represent substitution variables in sqlplus.
In forms it's just data with no special meaning.
So this:
d number(4) := '&no_of_books';
is always going to error out. You can't store those characters in a number variable.

Also the exception handler won't catch that since it's in the declare section.
Re: ora-40735 [message #669168 is a reply to message #669153] Fri, 06 April 2018 08:07 Go to previous message
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
And dbms_output is useless in Forms as you will never see he output.
And inserting into a table with values clause without naming the columns is sloppy and dangerous. What happens when the table definition changes?
Previous Topic: Open word document saved in database using forms 6i
Next Topic: Updating data Without Update command
Goto Forum:

Current Time: Tue Mar 05 05:02:22 CST 2024