Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute query

Status
Not open for further replies.

anju123

Programmer
Jun 6, 2003
33
CA
Hi Friends,
I need a help.
I am trying to execute a query based on my criteria.
Like in new-form-instance trigger I have written:

select start_time into p_stime from time_sheet
where END_TIME is null
and employee_id = (select employee_id from employee_detail
where user_id = user);

:time_sheet.start_time := p_stime;
--(time_sheet is a database block and start_time is database clolumn)
execute_query;

Basically I want to execute my query based on p_stime but it isn’t doing. It simply pulls up p_stime in start_time column and doesn’t populate the other columns and says FRM; 40202 fields must be entered. I have also tried by assigning a where close in database block but no luck. Where am I doing wrong? How can I make it work?

Thanks in advance,
Anju
 
Your mistake is that, when you assign a value , the form is in NORMAL mode, thus it's treated as entering a new record. Try to issue ENTER_QUERY before specifying criteria.

Regards, Dima
 
I have the same thing, I do it like this:
In When-new-form-instance:

SELECT ...
INTO :CTRL.p_stime -- CTRL is a control block
FROM.....

GO_BLOCK('TIME_SHEET');
EXECUTE_QUERY;

IN THE PRE_QUERY OF THE 'TIME_SHEET' BLOCK:

:time_sheet.start_time := :CTRL.p_stime;

It works and you don't bother with changing block status.

Good luck...

Christian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top