Solved

sys_context in the view and using in oracle forms

Posted on 2010-08-13
6
756 Views
Last Modified: 2013-12-19
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
Comment
Question by:anumoses
  • 5
6 Comments
 
LVL 6

Author Comment

by:anumoses
Comment Utility
This is the problem I have
sys-context.doc
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
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
 
LVL 6

Author Comment

by:anumoses
Comment Utility
should I set it in the when-validate-trigger of the date filed? or when new form instance?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Author Comment

by:anumoses
Comment Utility
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
 
LVL 6

Author Comment

by:anumoses
Comment Utility
I set it on the date field on the first block. it works
0
 
LVL 6

Author Closing Comment

by:anumoses
Comment Utility
Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now