Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 791
  • Last Modified:

sys_context in the view and using in oracle forms

CREATE OR REPLACE VIEW QC_DAILY_VW
(DEPT_ID, QC_TYPE_ID, QC_SUBTYPE_ID, QC_DATES, CONTROL_NO)
AS
select a.dept_id,a.qc_type_id,
      a.qc_subtype_id,b.qc_dates,b.control_no
from qc_dept_subtypes a,qc_daily b
where a.dept_id = b.dept_id(+)
and a.qc_subtype_id = b.qc_subtype_id(+)
and a.qc_type_id = b.qc_type_id(+)
--and a.dept_id = 11
and b.qc_dates(+) = to_date(sys_context('mydate','given_date'),'dd/mm/rrrr')
-------------------
In my forms I call this in the post query
my_pkg.test_context(:qc_dept_subtypes.qc_dates);
First time the form is blank. when I close it and reopen then the data displays. Why is this happening.
0
anumoses
Asked:
anumoses
  • 5
1 Solution
 
anumosesAuthor Commented:
This is the problem I have
sys-context.doc
0
 
sdstuberCommented:
it's the "POST" query that is the problem

the view is based on the value of the context,  so it must be set BEFORE you read the view.

The context won't change unless you change it, so setting it once on the form is sufficient.

to fix it, set it before the form's query executes
0
 
anumosesAuthor Commented:
should I set it in the when-validate-trigger of the date filed? or when new form instance?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
anumosesAuthor Commented:
I tried to set it in the when new block instance trigger of the view block. It still does not work. I commented tyhe line in post query and now I have it only in the when new block, but nothing works. But when I requery it brings the data.
0
 
anumosesAuthor Commented:
I set it on the date field on the first block. it works
0
 
anumosesAuthor Commented:
Thanks
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now