Home » Developer & Programmer » Forms » how run query when record change and others (merged)
how run query when record change and others (merged) [message #160660] Mon, 27 February 2006 22:39 Go to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
Hi master

Sir
I use enter_query through button and give 10 in deptno textbox
But I execute_query through button no give result

An use form menu then give result easily what happen
Enter_query code
Go_block(‘emp’);
Enter_query;
execute_query code
Go_block(‘emp’);
execute_query;
and
execute_query code
execute_query;
and how use option button

please give me idea

thanking you
aamir
Upd mod: remove blanks lines and add code tags

[Updated on: Sun, 05 March 2006 23:06] by Moderator

Report message to a moderator

Re: execute_query error [message #160696 is a reply to message #160660] Tue, 28 February 2006 02:04 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Both buttons should belong to the 'emp' block. If this is, for example, master-detail form with 'dept' as master and 'emp' as detail and buttons belong to the 'dept' block, this will not work (as you've already see).

Trigger code is simple:

REM enter query button:
enter_query;

REM execute query button:
execute_query;

However, as both buttons are accessible through the default form toolbar, why would you want to additionally code such things?
Re: execute_query error [message #160880 is a reply to message #160696] Tue, 28 February 2006 20:46 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I think he mean put '10' into a field and then do the query.
Go_block(‘emp’);
Enter_query;
:emp.dept := 10;
Execute_Query;
Does this give you what you want?

David
how run query when record change or navegation & how when record change then my trigger run and [message #160932 is a reply to message #160660] Wed, 01 March 2006 01:14 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
Hi master

Sir,

I master and detail system such as dept and emp
Emp in grid format where I put code of manager name
When emp change then display his manager name
I put textbox in grid database property no

See my code
When_validate_item

begin
select managername into :emp.test from managertable
where managerid =:voudetail. managerid;
end;


I put this code on time but when I click in item then give manager name in test textbox
When I use navigation button no replace value in test textbox

Please give me idea which event I use

Thanking you
Aamir
how run query when record change or navegation [message #160942 is a reply to message #160932] Wed, 01 March 2006 01:41 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
Hi master

Sir sorry i again post my problem ,
add more detail

i select manager id by lov then lov move manager name in textbox but view time how move manager name in textbox


I master and detail system such as dept and emp
Emp in grid format where I put code of manager name

When emp change then display his manager name
I put textbox in grid database property no

See my code
When_validate_item

begin
select managername into :emp.test from managertable
where managerid =:voudetail. managerid;
end;


I put this code on time but when I click in item then give manager name in test textbox
When I use navigation button no replace value in test textbox



Please give me idea which event I use

Thanking you
Aamir
Re: how run query when record change or navegation [message #161079 is a reply to message #160942] Wed, 01 March 2006 22:39 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please tell us the names of your blocks. Also, against which item have you got the When-Validate-Item trigger? If you populate your field through the LOV then you don't need to use the WVI trigger to do another 'populate'. For an existing record, use the Post-Query trigger to do the populate.

David
execute query on option buttion as per user desire [message #161112 is a reply to message #160660] Thu, 02 March 2006 01:12 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
Hi master
Sir
I have one form and three option button

1-jv journal voucher
2-bp bank payment
3-cp cash payment

my requirement is when my user select any one option then trigger fire and fetches the related record such as

select * from vouchertable where vtype =’jv’

please give me idea and sample where I put my query or which event I use

thanking you
Aamir
Desire

see error : Frm-40105 : unable to resolve reference to item 20. [message #161122 is a reply to message #160660] Thu, 02 March 2006 02:21 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
hi master

sir when i put this code on when_button_press then give this error


go_block('emp');
enter_query;
:emp.deptno := 10;
execute_query;

error

Frm-40105 : unable to resolve reference to item 20.

sir please give me idea

Thanking you


execute query error [message #161144 is a reply to message #161079] Thu, 02 March 2006 04:27 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
thanks for your reply

sir that problem i solved by post_chage envent

now am in new problum

I have one form and three option button

1-jv journal voucher
2-bp bank payment
3-cp cash payment

my requirement is when my user select any one option then trigger fire and fetches the related record such as

select * from vouchertable where vtype =’jv’

some body gie my idea and sample code as underblow

sir when i put this code on when_button_press



go_block('emp');
enter_query;
:emp.deptno := 10;
execute_query;



then give this error

Frm-40105 : unable to resolve reference to item 20.

sir please give me idea where i put this code and which envet i use

Thanking you

urgent help : execute_query error [message #161145 is a reply to message #160880] Thu, 02 March 2006 04:29 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
hi master
thanks for your reply

sir when i put this code on when_button_press
go_block('emp');
enter_query;
:emp.deptno := 10;
execute_query;
then give this error

Frm-40105 : unable to resolve reference to item 20.

sir please give me idea where i put this code and which envet i use

Thanking you
Aamir

Upd mod: remove blanks lines and add code tags. Please stop with all the blank lines!!

[Updated on: Sun, 05 March 2006 23:08] by Moderator

Report message to a moderator

execute query not give any result [message #161428 is a reply to message #160660] Sat, 04 March 2006 00:44 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
Hi master
Sir I have emp form and I put under blow code in when button press event

When_Button_press

go_block('emp');
enter_query;
:emp.deptno := 10;
execute_query;

but when I press button then no result no data in any field and curser in first column my idea is the execute query not run or these command not run

:emp.deptno := 10;
execute_query;

system not replace data and no run execute_query

please give me idea

Thanking you

Muhammad Fahim Aamir
Re: see error : Frm-40105 : unable to resolve reference to item 20. [message #161430 is a reply to message #161122] Sat, 04 March 2006 00:54 Go to previous messageGo to next message
karan.shandilya
Messages: 64
Registered: July 2005
Location: mumbai
Member
hi,
Press Shift + F1, you will find what exactly the error is.
And from there you will solve your problem yourself.
If in any case the problem remain same then post the message which comes after pressing Shift + F1.

Karan.

Re: execute query not give any result [message #161454 is a reply to message #161428] Sat, 04 March 2006 09:02 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
try this

remmember you can not empty the Primary key. and I think empno is primay key.

DECLARE
BEGIN
GO_ITEM ('deptno');
enter_query;
:deptno :=20;
EXECUTE_QUERY;
END;
Re: execute query not give any result [message #161463 is a reply to message #161428] Sat, 04 March 2006 23:17 Go to previous messageGo to next message
makul_2004
Messages: 5
Registered: January 2006
Location: pune
Junior Member

code
go_block('emp');
set_block_property('emp',onetime_where 'empno = 10');
execute_query;



what actually happening in ur case
ur assigning values to empno.
due to which form_status cahaging
Re: execute query on option buttion as per user desire [message #161519 is a reply to message #161112] Sun, 05 March 2006 22:53 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Are these three 'things' based on the same table or different tables? If different tables then use three different blocks on three different canvases or tabs on one canvas and use the 'default_where' facility of the set_block_property to define the search and a go_block('blk') to get to the block and an execute_query to populate the list.

If same table, then use the 'default_where' facility of the set_block_property and do the execute_query. I am assuming that you are already on your data block.

David
Re: urgent help : execute_query error [message #161525 is a reply to message #161145] Sun, 05 March 2006 23:09 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What are the fields in your 'emp' block? What is the data type of your 'department' field?

David
Re: urgent help : execute_query error [message #161527 is a reply to message #161525] Sun, 05 March 2006 23:12 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please don't start new threads asking the same question.

David
Re: execute query giveon numeric data but not result string data [message #161605 is a reply to message #161463] Mon, 06 March 2006 04:33 Go to previous messageGo to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
Hi master
sir i use your code but

Sir when I use under blow code for execute query
sir when I use numeric data then run fine but when I use character data then not give any result

with numeric run fine

DECLARE
DD VARCHAR2(15);

BEGIN
DD:=10;
set_block_property('emp', default_where, 'where DEPTNO='||DD);
go_block('emp');
execute_query;
set_block_property('emp', default_where, '');
END;


With character not give any result
DECLARE
DD VARCHAR2(15);

BEGIN
DD:='SALESMAN';
set_block_property('emp', default_where, 'where RTRIM(EMPNO)='||DD);
go_block('emp');
execute_query;
set_block_property('emp', default_where, '');
END;

Please give me any idea
Re: execute query giveon numeric data but not result string data [message #161713 is a reply to message #161605] Mon, 06 March 2006 18:25 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please 'describe' the table. Does your query work in SQL*Plus?

David
Previous Topic: Oracle forms tutorial
Next Topic: help me plz
Goto Forum:
  


Current Time: Fri Sep 20 07:34:57 CDT 2024