|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trouble trying to insert new rows into a table from Forms Developer
I have two datablocks (student and course_section). The premise is to update a detail table, Enrollment with a student id#(s_id), course section id#(c_sec_id) and a NULL value for Grade. I have a Save button with the following code behind it:
insert into enrollment values (:student.s_id, :course_section.c_sec_id, NULL); commit; I recieve the following error - FRM-40600: Record has already been inserted. I have tried various combinations of student id's and section id's that I know do not exist in the table and I continually recieve this message. Any thoughts? Thanks |
|
#2
|
|||
|
|||
|
I want to add a default employee in the each department if there is no employee in the department. I typed the following pl/sql behind the button and it works.
commit_form; DECLARE count integer; BEGIN SELECT count(*) INTO count FROM emp WHERE deptno = :dept.deptno; if count=0 then insert into emp (empno,ename,sal,deptno) values(9000,'Default',0,:dept.deptno)); end if; END; I dont know what is the problem in your form. can you please send me little bit more detail, like what is the relatioship beetween your table and how many constraints each table has? Regards |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Trouble trying to insert new rows into a table from Forms Developer |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|