Home » Developer & Programmer » Forms » HI (oracle 10g,window xp)
HI [message #492521] Mon, 31 January 2011 22:09 Go to next message
helloworld_28
Messages: 60
Registered: October 2010
Member
hi,

i have two datablock a single arecord and another tabular data-block ,i want to insert into single record (dept) using button but it can't accept insert_record procedure in when_button_pressed trigger so i put code in on_insert , but it is not working please help me. and another one tabular records (emp) i want to insert multiple record in single insertion.please help i have attached that fmb.
  • Attachment: count1.fmb
    (Size: 112.00KB, Downloaded 973 times)
Re: HI [message #492542 is a reply to message #492521] Tue, 01 February 2011 02:04 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If blocks are "data blocks" (i.e. based on underlying tables), you don't need to code INSERT operation - simply enter data into fields and push the "Save" button. The same goes for detail records (your "emp" block).

Use Forms built-in capabilities as much as you can. Don't reinvent the wheel, don't code something Forms does by itself.
Re: HI [message #492544 is a reply to message #492521] Tue, 01 February 2011 02:11 Go to previous messageGo to next message
ranamirfan
Messages: 535
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Dear,
Quote:

FIRST - ON-INSERT
IF :DEPT.DEPTNO<>NULL AND :DEPT.DNAME<>NULL AND :DEPT.LOC<>NULL THEN
INSERT INTO DEPT (DEPTNO,DNAME,LOC) VALUES
(:DEPT.DEPTNO,:DEPT.DNAME,:DEPT.LOC);
END IF;

Quote:

SECOND - WHEN-BUTTON-PRESSED
INSERT_RECORD;

I think you are using wrong approch for Saving/Inserting data.
you created master / detail form.No need to write this code you just put one button in header form and put this code.
Commit_Form;



Regards,
Irfan
Re: HI [message #492705 is a reply to message #492542] Tue, 01 February 2011 22:19 Go to previous messageGo to next message
helloworld_28
Messages: 60
Registered: October 2010
Member
hi friend ,

it show error frm-40508
  • Attachment: count1.fmb
    (Size: 108.00KB, Downloaded 956 times)
Re: HI [message #492719 is a reply to message #492705] Wed, 02 February 2011 00:40 Go to previous messageGo to next message
ranamirfan
Messages: 535
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

FRM-40508: ORACLE error: unable to INSERT record.
Remove ON-INSERT trigger which you put on DEPT Data Block.I think you did not read my previous answer carefully just put one button in Header Form (Dept Data Block ) and write this code.
WHEN-BUTTON-PRESSED
Commit_Form;


Regards,
Irfan
Re: HI [message #492786 is a reply to message #492705] Wed, 02 February 2011 09:21 Go to previous messageGo to next message
helloworld_28
Messages: 60
Registered: October 2010
Member
thank s man,

now if i want to update any field with deptno as where clause.please me.
Re: HI [message #492816 is a reply to message #492786] Wed, 02 February 2011 14:17 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Sorry, I don't understand what you are saying.
Previous Topic: validation items
Next Topic: which trigger should I put on a text item so that when the cursor comes inside it..
Goto Forum:
  


Current Time: Tue Sep 17 16:20:01 CDT 2024