Home » Developer & Programmer » Forms » Unable To Insert Record
Unable To Insert Record [message #78453] Mon, 25 February 2002 08:06 Go to next message
Tyler
Messages: 123
Registered: January 2002
Senior Member
I am receiving this error, unable to insert record
FRM-40508, on commit. I thought that it had something to do with the PK and the sequence. so I wrote this in the save button to get a sequence PK into the column...

DECLARE
V_CODE CLASS.CLAS_CODE%TYPE;
BEGIN
SELECT CLAS_CODE_SEQ.NEXTVAL INTO V_CODE FROM DUAL where rownum = 1;
MESSAGE('The PK is'||' '||V_CODE);
:CLAS_CODE := V_CODE;
END;

But I'm still getting the error...ANY SUGGESTIONS??? PLEASE

Tyler
Re: Unable To Insert Record [message #78469 is a reply to message #78453] Tue, 26 February 2002 00:48 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
u should write the code in pre-insert trigger of the
database block

BEGIN
SELECT CLAS_CODE_SEQ.NEXTVAL INTO :block_name.pk_field_name FROM DUAL
END;
Re: Unable To Insert Record [message #78506 is a reply to message #78453] Wed, 27 February 2002 01:21 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
hi,

it is very difficult to say what is going wrong, with the error message u have provided.

when u r running the form and u r getting the error, at that time go to menu and click display error and find out what exactly the error is .

other wise, in pre-insert try to find out what the fileds values are. and also see what are the not null field in the table.

if u still have problem then send me a test case, with table structure and forms

cheers
pratap
Previous Topic: Re: inserting data in tabular form
Next Topic: Dynamic Table name problem
Goto Forum:
  


Current Time: Thu Mar 28 07:49:29 CDT 2024