Home » Developer & Programmer » Forms » PLEASE HELP ME WITH INSERT INTO TRIGGER
PLEASE HELP ME WITH INSERT INTO TRIGGER [message #78957] Sun, 07 April 2002 10:55 Go to next message
nicole
Messages: 10
Registered: January 2002
Junior Member
Hello,

I am trying to add a record into my sql database witht the following "when-button-pressed" trigger:

declare
v_ssn VARCHAR2(9);
begin
v_ssn := :patient.ssn;
insert into patient(ssn) values ('v_ssn');
commit;
end;

but i get the ERROR Message: FRM-3050: ORACLE error: unable to insert record.

Does anybody know what is wrong? please help me. Thanks! :)

Nicole
Re: PLEASE HELP ME WITH INSERT INTO TRIGGER [message #78958 is a reply to message #78957] Mon, 08 April 2002 02:51 Go to previous messageGo to next message
Ayan
Messages: 11
Registered: February 2002
Junior Member
Hey

you are entering hardcoded v_ssn value every time. look at the line with **** in it. that is your insert statement.

it shoud be

insert into patient(ssn) values (v_ssn);

declare
v_ssn VARCHAR2(9);
begin
v_ssn := :patient.ssn;
****insert into patient(ssn) values ('v_ssn'); ****
commit;
end;

Ayan
Re: PLEASE HELP ME WITH INSERT INTO TRIGGER [message #78970 is a reply to message #78957] Tue, 09 April 2002 04:48 Go to previous messageGo to next message
Mohammad Husain
Messages: 1
Registered: April 2002
Junior Member
Hi

remove the '' from v_ssn in the insert statement. Because of this the query will try to enter literal v_ssn instead of the number/variable u want. U have hardcoded the v_ssn. Also keep in mind that datatype of v_ssn and ssn. The datatype for v_ssn u r showing is VARCHAR2 and i hope that the datatype for ssn is also VARCHAR2 not NUMBER. If they are different u need to convert one from the other by using either to_char or to_number function.

I hope this helps.

Mohammad
Re: PLEASE HELP ME WITH INSERT INTO TRIGGER [message #78979 is a reply to message #78957] Wed, 10 April 2002 09:36 Go to previous message
Tyler
Messages: 123
Registered: January 2002
Senior Member
you can get the unable to insert record, one because of the last two replies, but also if you are inserting the value, but not doing anything with the pk's.
Previous Topic: My fmx do not start
Next Topic: Re: migration tool for oracle forms 4.5 to forms 6i
Goto Forum:
  


Current Time: Tue Apr 23 03:19:38 CDT 2024