Home » Developer & Programmer » Forms » Execute Query with Non database Block (Windows Xp Forms 6i)
Execute Query with Non database Block [message #415000] Fri, 24 July 2009 06:17 Go to next message
kame
Messages: 69
Registered: July 2009
Member
I want to execute query with non database block.

Re: Execute Query with Non database Block [message #415002 is a reply to message #415000] Fri, 24 July 2009 06:24 Go to previous messageGo to next message
shaz
Messages: 182
Registered: June 2009
Senior Member
just code at the execute query trigger.
Re: Execute Query with Non database Block [message #415004 is a reply to message #415002] Fri, 24 July 2009 06:25 Go to previous messageGo to next message
kame
Messages: 69
Registered: July 2009
Member
can u give here any example
in
When New form Instance

[Updated on: Fri, 24 July 2009 06:26]

Report message to a moderator

Re: Execute Query with Non database Block [message #415005 is a reply to message #415000] Fri, 24 July 2009 06:27 Go to previous messageGo to next message
shaz
Messages: 182
Registered: June 2009
Senior Member
No problem just give me some hint what u really want to perform on that form.
Re: Execute Query with Non database Block [message #415006 is a reply to message #415005] Fri, 24 July 2009 06:31 Go to previous messageGo to next message
kame
Messages: 69
Registered: July 2009
Member
I have 2 block in a form
one is view non database block
2nd is personnel database block

I defined a crusor when_new_form_instance
DECLARE
	 	CURSOR chk
	IS
  select perscode,persname,commission,conversion,netrate from personnel order by to_number(perscode);
 
vcode					personnel.perscode%type;
vName					personnel.persname%type;
vcomm					personnel.commission%type;
vconv					personnel.conversion%type;
vnrate				personnel.netrate%type;
 
	BEGIN
   OPEN chk;
    LOOP
   FETCH chk INTO vcode, vname, vcomm, vconv,vnrate;
     EXIT WHEN chk%NOTFOUND;
   						
	create_record;
		go_block('view');
 		:view.vpercode			:= vcode;
 		:view.vpersname			:= vname;
 		:view.vcomm					:= vcomm;
 		:view.vcon					:= vconv;
 		:view.vnet					:= vnrate;
 		
 		--Message('DOC...'||vname);
				
    END LOOP;
--    commit;
	   CLOSE chk;
				
	END;

when I run the form all the records I can see in the view datablock

I write a code at item view.persname when-button-press
:personnel.perscode := :view.vpercode;
:personnel.persname := :view.vpersname;
:personnel.commission := :view.vcomm;
:personnel.conversion := :view.vcon;
:personnel.netrate := :view.vnet;



when I click on any record value I can see in personnel datablock one by one with help of click.

when I insert new record in personnel datablock it save new record and also that record which click in last.

why it is happening ?

or there is any other way to execute the query
Re: Execute Query with Non database Block [message #415019 is a reply to message #415000] Fri, 24 July 2009 07:30 Go to previous messageGo to next message
cookiemonster
Messages: 13950
Registered: September 2008
Location: Rainy Manchester
Senior Member
If you set values in a record that hasn't been queried from the database oracle will assume it's a new record and try and insert it.

Seems to me both blocks should be database blocks and you should use standard forms query functionality to populate them.
You don't need this custom code.
Re: Execute Query with Non database Block [message #415032 is a reply to message #415000] Fri, 24 July 2009 07:57 Go to previous message
TonyJaa
Messages: 50
Registered: May 2009
Member
Does only one record of view correspond to only one record of personnel ?

If yes, I think you've better do only one block with some based item named personnel_itemX and some non-based item named view_itemX.

In When new form instance, Execute query on the block and in POST-QUERY populate the VIEW_ITEM.

but in the layout separate the view_item from the personnel_item.
Previous Topic: record group with concatination
Next Topic: How to set item value to a default value on form
Goto Forum:
  


Current Time: Sun Nov 03 01:41:32 CDT 2024