Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 17th, 2003, 08:51 AM
reiterje reiterje is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 2 reiterje User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old November 18th, 2003, 05:59 PM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 10
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Trouble trying to insert new rows into a table from Forms Developer

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap