Home » Developer & Programmer » Forms » When mouse Double click (enter Query)(Execute Query) (Developer 6I, Database 10g window XP)
When mouse Double click (enter Query)(Execute Query) [message #404332] Thu, 21 May 2009 07:02 Go to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
Dear all

I have 2 Block one have no of record display = 1 (Block1) and other block contain no of record display = 10 (Block10) which column is only EMP_NO Both block table is EMP
Both have same Canvas

I write trigger when new form instance

Go_block('Block10') 
Execute_query;


Now i need when i double click the emp_no its show his all record in block1 for example i click on 7788 its show in block1
Emp_no  7788
Ename Scott
Job  Analysis 
and as on 


well i done this with this trigger

When_mouse_double_click

SELECT empno,
       ename,
       job,
       mgr,
       hiredate,
       sal,
       comm deptno
INTO   :block1.empno,:block1.ename,:block1.job,:block1.mgr,
       :block1.hiredate,:block1.sal,:block1.comm,:block1.deptno
FROM   emp
WHERE  empno = :block10.empno 



This query work fine but when i edit block1 ename and save this record then this record become dublicate i just want to update this record


Re: When mouse Double click (enter Query)(Execute Query) [message #404334 is a reply to message #404332] Thu, 21 May 2009 07:07 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Use standard Forms behaviour; if you need to display existing record(s), use Forms' querying capabilities (enter_query, enter search criteria, execute_query). Once the record is displayed, you may update it (and it will not be duplicated).

Also, having two blocks (as you've described the situation) looks like you'd want to create a master-detail relationship.

None of the above requires any additional coding - Forms will do the job by itself.
Re: When mouse Double click (enter Query)(Execute Query) [message #404365 is a reply to message #404332] Thu, 21 May 2009 08:50 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
I write relation ship but its not working the error is coming

Unable to insert record


but when i press f7 enter_query and execute query then change the record and save this record the record save without any error

any other idea

Regards


Shahzaib
Re: When mouse Double click (enter Query)(Execute Query) [message #404434 is a reply to message #404365] Thu, 21 May 2009 16:07 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As I've already said, if you let Forms do the job, everything will be OK. No additional coding needed.

As of the "unable to insert record" error, select Help - Display Error from the menu and you'll see the reason. If you can't understand what's being said, copy/paste the error message (and its code) so that someone might provide additional help.
icon6.gif  Re: When mouse Double click (enter Query)(Execute Query) [message #404475 is a reply to message #404332] Thu, 21 May 2009 22:48 Go to previous message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
I agree with Mr. LittleFoot....

Should use the default where clause of the block... or some think else but should be done by the Oracle Forms way....
Previous Topic: timer chck when insert table
Next Topic: no of records before save
Goto Forum:
  


Current Time: Fri Sep 20 15:20:08 CDT 2024