LOV inline query
Hello,
I'm using version 2.0 and I've to create a LOV query like the following:
select kev_name d, kev_nr r from TAB1 where kev_nr in
(select event from CRMUP where crm_user = v('USER'))
This query fails with the error message "LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query."
Could please anybody help me to transform the query above to a LOV-able inline query ?
Thanks in advance - Peter
Hi Yog,
thank's, but this doesn't work too.
I've the feeling, that there is a problem in regard of the last sentence of the error message "If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query."
Any idea ?
Peter
Similar Messages
-
Hi All,
I would like to have LOV in query panel one which is created using view critiria.
Kindly let me know the best way to implement this one...............
Regards
Anandkumar S.M.Check this:
http://blogs.oracle.com/shay/2009/12/adf_query_with_parameters_and_1.html
Thanks,
Navaneeth -
How to pass parameters to a Lov's Query?
Hi friends,
[Apps R12]
I'm trying to extend the a ProjectLOVVO (for OTL, in example) and the extension would consist on modifying the Lov Query adding in the where clause a comparison with certain fields of the page....
How can I retrieve a value in the page , a field/item, form_value, or similar and put it in the Lov's query? Is there any direct way to reference it..? Is it necessary to do any special mapping? What about those "bind variables", .. I don't know exactly how to use them.. and if this could be a purpose for their use..
Thanks for any comment.Hi Prasanna,
thanks for he coment, but.. I think It really doesn't exists the LOV Region Item you mention...
I mean, the "real" case is:
In OTL, inside Create timecard page (+/oracle/apps/hxc/selfservice/timecard/webui/TcActivitiesPG+) I want to restrict the Project LOV query (ProjectLOVVO) to add the project manager in the LOV (well, it can be done adding to the from & where clauses the per_all_people_f and pa_project_players) but, for this, is necessary to check the dates.... so It's necessary to add in the where clause a check for the "period", that is a data in a poplist on the screen... [I wasn't be able to locate where is that period stored]
Also, as a Time card is for a person.. I need too to retrieve the person_id for that person (this person could not be the one who has connected... because you can create a timecard for another user) so.. I see this information on screen at the top, where it appears the "Time Entry:" label... but.. how to locate it into page? and.. are you sure it can be mapped to include it in the LOV query? (It would be necessary to use it as I've seen in others lov's queries.. where it seems to appear parameters/variables/mapping named as :1 ,:2 ... :number... , I don't know how to add it)
Any detail step would be very appreciated.
Thanks a lot.!! -
How to Enable the LOV to query for partial user entries in af:query in an ADF search form
Hi guys,
I have faced one issue in creating a search form in ADF, in that I have used af:query and table region. and I have attached an lov vo to the base vo for the list of values and given UI hint as Input values with List of values. Now the issue is that I have given auto submit property as true so when I give some value suppose "Jan-14" and tab out it gives me all the correct results. but if I give like "Jan%" and then tab out then it does not give me any value. Could you kindly help me with some solution. I am using Jdev 11.1.1.6.0.
Thanks,
TanmoyTo enable the LOV to query for partial user entries, we can trap the 'LaunchPopupListener' event and add custom code there. Within the af:query component, just wondering how can we set property the 'LaunchPopupListener' for the search criteria ?
-
Passing values dynamically Froman 'INLINE Query' to a 'SUB QUERY'
If I am using an line query which uses a SELF JOIN subquery
how can I pass the values from the Inline Query to Subquery ?
Is this possible?
SQL...Code
and Inline Queries..
(select count(*) 'PrimaryISIN'
from instrument ins,
instrument_xref insx
where ins.id_inst = insx.id_inst
and insx.flg_active = 'Y'
and ins.id_source ='MF'
and ins.flg_primary_listing = 'Y'
and ins.flg_active = 'Y'
and insx.id_inst_xref = ( select DISTINCT a.id_inst_xref
from instrument_xref a,
instrument_xref b
where b.id_inst_xref ='B0DV8Y9'
and b.id_inst = a.id_inst
and b.id_inst_xref_type in ('SE','IS')
and a.id_inst_xref = 'GB00B03MLX29'
)PISIN2
I am hardcoding the id_inst_xref is the SELF JOIN? Can these be passed dynamically from
the INLINE Query which is invoking the SUB QUERY?Hi, The hardcoded values entered in the SELF JOIN run fine.
Now,I need to pass values dynamically from the INLINE query.
How do I do that?
Thanks -
Query regarding Inline Query and a Join.Please see
I have a query regarding Inline Queries
I have 2 tables
TRADE and POSTING
TRADE has Primary Key:id_trade_ref and POSTING has Foriegn.Key: id_trade_ref
id_trade_ref 5V973781B has 5 records in POSTINGS
If i need to join these 2 tables,I use
1) Select t.id_entity,t.id_trade_ref,p.am_stock
from trade t,posting p
where t.id_trade_ref = '5V973781B'
and p.id_trade_ref = '5V973781B'
2) Now I can use the same as an Inline Query:
select
t.id_entity,
t.id_trade_ref,
( select p1.am_stock
from posting p1
where p1.id_entity = t.id_entity
and p1.id_trade_ref= t.id_trade_ref
and p1.id_posting_type in ( 'NEW', 'CAN')
from
trade t
where t.id_entity = 'DBL'
and t.id_trade_ref = '5V973781B'
My Query:
Of the two,which is a better option to use.?
Is Inline a better option or a normal join?I would rewrite the first one to:
Select t.id_entity,t.id_trade_ref,p.am_stock
from trade t,posting p
where t.id_trade_ref = '5V973781B'
and p.id_trade_ref = t.id_trade_ref
This way, you really make the join between the table.
I think the join is better because it uses less code. I do not think you will notice much performance win between one or the other, especially because it concerns only a few rows. -
Hi all,
Two tables who have no relation with each other. For example an employees table and a systemparameter table with a startworktime.
We need a query with data from both tables:
Get all employees and the startworktime (which is the same for everybody)
Which is cheaper: an inline query or a cartesian product or crossjoin?
Inine :
select name, function
, (select startworktime from systemparameter)
from employees;
Cartesian product:
select name, function, startwoime
rktfrom employees
cross join systemparameter;
Your thoughts on this.Hi,
To see which runs faster on your system, with your sub-query, there's no sibstitute for testing on your system, with your sub-query.
I predict you won't notice any difference. Scalar sub-queries (as in your first example) are cached (at least in recent versions of Oracle), so you can include a scalar sub-query in a result set of a million rows, and the sub-query can be executed once, not a million times. -
Show lov in query panel for an attribute using = = or between operators
When we use between, greater than, less than, greater than or equal to , less than or equal to in the view criteria
On an attribute which has lov
in query panel of UI the lov does not show up for that particular attribute
How to show lov for an attribute in query panel when i am using the above operatorsDoes the LOV show up in basic query state?
http://blogs.oracle.com/shay/2011/01/dependent_lovs_in_an_afquery_c.html -
Self Joining and Inline Query. A tricky report.
I am stuck with a very tricky situation.Please help.This is PROD issue.
I have written a SQL code which has 1 inline queries,and displays the right results
with the right report output
Dont get confused.Just go thru this.
select pie.id_inst_code,
ISNULL(PN.Active, 0) 'Active',
from position_master_input_event pie,
(select insx.id_inst_xref_type,insx.id_inst_xref,count(*) 'PrimaryListing'
from instrument ins, instrument_xref insx
where ins.id_inst = insx.id_inst
and insx.flg_active = 'Y'
and ins.flg_active = 'Y'
group by insx.id_inst_xref_type,insx.id_inst_xref
)PN
where id_entity = 'AGL'
and pie.id_inst_code *= PN.id_inst_xref
and pie.id_src_inst_code_type*= PN.id_inst_xref_type
group by pie.id_inst_code,PN.Active,
Table :Instrument_xref
id_inst id_inst_xref_type id_inst_xref flg_active
0372285 SE B0DV8Y9 Y
0372285 IS GB00B03MLX29 Y
Table :Instrument
id_inst id_inst_xref_type id_inst_xref flg_active flg_primary_listing
0372285 SE B0DV8Y9 Y N
OUTPUT:
id_inst_xref Active
B0DV8Y9 1
PERFECT.Works fine
2) Now comes the tricky part.:
0372285 also has GB00B03MLX29 which has flg_active to Y and which also maps to 0372285.
Am I right?
New reportOutput
id_inst_xref Active PRIMARY ISIN
B0DV8Y9 1 1
So,now I want a SELF JOIN this way built into the code:
(hardcoded values work)
(i)
select a.id_inst_xref
from instrument_xref a,
instrument_xref b
where b.id_inst_xref ='B0DV8Y9'
and b.id_inst = a.id_inst
and b.id_inst_xref_type in ('SE','IS')
and a.id_inst_xref = 'GB00B03MLX29'
(ii)
select count(*) 'PrimaryISIN'
from instrument ins,
instrument_xref insx
where ins.id_inst = insx.id_inst
and insx.flg_active = 'Y'
and ins.flg_primary_listing = 'Y'
and ins.flg_active = 'Y'
And now LINKING ALL :
select pie.id_inst_code,
ISNULL(PN.Active, 0) 'Active',
from position_master_input_event pie,
(select insx.id_inst_xref_type,insx.id_inst_xref,count(*) 'PrimaryListing'
from instrument ins, instrument_xref insx
where ins.id_inst = insx.id_inst
and insx.flg_active = 'Y'
and ins.flg_active = 'Y'
group by insx.id_inst_xref_type,insx.id_inst_xref
)PN,
(select count(*) 'PrimaryISIN'
from instrument ins,
instrument_xref insx
where ins.id_inst = insx.id_inst
and insx.flg_active = 'Y'
and ins.flg_primary_listing = 'Y'
and ins.flg_active = 'Y'
and insx.id_inst_xref = (
select DISTINCT a.id_inst_xref
from instrument_xref a,
instrument_xref b
where b.id_inst_xref = 'B0DV8Y9'
and b.id_inst = a.id_inst
and b.id_inst_xref_type in ('SE','IS')
and a.id_inst_xref = 'GB00B03MLX29'
where id_entity = 'AGL'
and pie.id_inst_code *= PN.id_inst_xref
and pie.id_src_inst_code_type*= PN.id_inst_xref_type
group by pie.id_inst_code,PN.Active,
THE Self join works fine as long as it is hardcoded.
But assume there can br multiple such situations as the above,and I dont want to
hardcode the values,how can I build the NEW REPORT by SELF JOINING.
Please can someome help.This is a tricky one.
Is there a better way to thisIsn't this the same question as:
Passing values dynamically Froman 'INLINE Query' to a 'SUB QUERY'
and
Another query regarding Inline Query and Self Join and pass Column Values -
hi,
i have to add the value in such a way from different tables, if you have any solution pls send me
SELECT ENAME, (SAL+A.SAL) FROM EMP111 C, (SELECT (SAL + B.SAL) FROM EMP1, (SELECT SAL FROM EMP11) B) A WHERE A.EMPNO = C.EMPNO AND B.EMPNO=C.EMPNO
regards
vkWithout checking or googling I think that inline query is an embedded cte, e.g.
select columns ... from (another select goes here) T1
inner join (select statement goes here) T2 on ...
You can express the above with 2 cte instead. Using CTE improves readability of the query.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Setting default value read from user session, for an LOV in Query component
I want to set the default value of a field in VO that participates in a named view criteria and thereby in Query component. That field is configured with an LOV by mean of a view accessor. The values are Y and N and the corresponding display strings obtained from view accessor are true and false respectively.
I am able to set the default value by setting the value of the criteria item corresponding to that field in view criteria. I am setting the value as either Y or N and I am able to corresponding display string as per the view accessor, on the query component when it is rendered.
I want to read the defauilt value from the ADF BC user session and set it as default value. I tried setting the values as "adf.userSession.userData.usageFlag". Iam ensuring that the attribute usageFlag is set before the view activity that has the query component is invoked. But this is ending up showing no default value in the Query component when rendered.
Can any one let me know how to go about with this?I made up your table since you didn't provide some example, but I'm sure this will give you the picture:
SQL> var run_type varchar2(1)
SQL> exec :run_type := 'A'
PL/SQL procedure successfully completed.
SQL> create table my_cycles as select level cycle_id
2 , level cycle_status
3 from dual connect by level <= 5;
Table created.
SQL> select cycle_id
2 from my_cycles
3 where case
4 when :run_type = 'D' and cycle_status = 1 then 1
5 when :run_type != 'D' and cycle_status in ( 2, 3 ) then 1
6 end = 1;
CYCLE_ID
2
3
2 rows selected.
SQL> exec :run_type := 'D';
PL/SQL procedure successfully completed.
SQL> /
CYCLE_ID
1
1 row selected.
SQL> -
Item Selection on a dynamic LOV (SQL Query)
Hi,
I've a dynamic LOV with an SQL query who return a list of data (one column). When i select a data in this LOV to be use as an item (sql query) in the same page the data is always null. In debug mode substitution string is null.
FYI : when the data is selected, a button is clik to perform an sql query for a report in another page.
Thanks. Sorry Abasolute beginner
Message was edited by:
user581765Thanks for Your help.
The date is in fact a CHAR display (not really a date) so that is not the error.
For your information when i select a row in the list (format char YYYYMMDD_HHMM) it seems that Apex do not catch my select in the Session state.
I've change the item name with P2_DATE_FLOW but the problem remain.
This is the debug log if can help
0.03: Application 114, Authentication: CUSTOM2, Page Template: 3644802034190382
0.06: ...Session ID 1868105032215374 can be used
0.06: ...Application session: 1868105032215374, user=Neop
0.06: ...Determine if user "Neop" workspace "2859608277950243" can develop application "114" in workspace "2859608277950243"
0.06: Session: Fetch session header information
0.06: ...Metadata: Fetch page attributes for application 114, page 3
0.06: Fetch session state from database
0.06: Branch point: BEFORE_HEADER
0.06: Fetch application meta data
0.08: Computation point: BEFORE_HEADER
0.08: Processing point: BEFORE_HEADER
0.08: Show page template header
0.08: Computation point: AFTER_HEADER
0.08: Processing point: AFTER_HEADER
0.08: Computation point: BEFORE_BOX_BODY
0.08: Processing point: BEFORE_BOX_BODY
0.08: Region: Report 1
Report 1
0.08: show report
0.09: determine column headings
0.09: parse query as: CFM_MDRE
0.12: binding: ":P2_DATE_FLOW"="P2_DATE_FLOW" value="0"
0.14: print column headings
0.14: rows loop: 15 row(s)
No data found. -
How to pass variable into lov sql query using like operator
hi.
i want to use a lov where i want to pass a variable using like operator.
my query is
select empno,name from table where empno like ':ed%';
my empno is A001 TO A199 AND B001 TO B199 so i want show either A% or B% empno
how can i do this ?
reagrdskindly press Shift+F1 at a time you face this error to see the exact Oracle error message.
and provide us with that detail
and its better if you start new topic for that error... because that will be new error,,,
-- Aamir Arif
Edited by: Aamiz on Apr 7, 2010 12:27 PM -
LOV with Query Bind Parameters
Hi,
I have a number of LOVs which have Query Bind Parameters. These LOVs display correctly but when I select a row they do not return values back to the fields in the calling page.
I get the following message in the OC4J servers:
DEBUG (LovItemBean) -No row selected in LOV. If you did select a row, then the LOV is probably based on a read-Only ViewObject that is not based on an EntityObject. If this is the case, make sure at least one attribute is marked as key attribute, and you have called setManageRowsByKey(true) in the create method of your ViewObjectImpl java class
The VO that the LOV is based on is based on an entity object and one of the attributes is marked as key attribute.
When I remove the Query Bind Parameters the LOV returns successfully into the field.
Thanks,
GavinGavin,
We just hit this issue ourselves and fixed it. The fix will be included in first patch release, planned for first half of september.
As a work around, you can remove the "Refresh" property (or set it to "ifNeeded") in the page definition for the applyBindParams InvokeAction, as well as the corresponding Iterator binding immediately below the InvokeAction.
Steven Davelaar,
JHeadstart Team. -
Changing LOV VO Query programmatically
Hi All,
I have a requirement where I need to change the LOV query programmatically based on another component on the page. The issue is demonstrated below where I need to change the 'Owner'
LOV query based on 'Owner Type' .
Owner Type : EMP/GRP
Owner : Based on value in 'Owner Type' which is EMP/GRP , two different queries are fired , based on which the LOV should be populated.
Query for Owner incase EMP is selected in 'Owner Type'(EmpLovVO) :
select emp_number, emp_name from emp;
Query for Owner incase GRP is selected in 'Owner Type'(GrpLovVO1) :
select grp_number, grp_name from grp;
I have created two VO EmpLovVO , GrpLovVO and added to the OwnerLovAM . I have written the below code to change the Lov VO in CO(processRequest).
if(OwnerTypeVar.equals("GRP"))
((OAListOfValuesBean)webBean).setViewUsageName("GrpLovVO1");
Can you please let me know what items are to be added to OwnerLovRN and from which VO. Please note the column names are diffent in two VO's and i am using LOV component as messageLovInput. Also let me know if i am missing any step.Eventhough the column names are different, while creating VOs for for the LOV use alias names and make sure that both VOs have same attributes.
Then in your controller, based on the owner set the VO instance. In your CO code make sure you also handles both EMP and GRP ower types.
Regards,
Peddi.
Maybe you are looking for
-
Hey every one, i hve a fix to the game center invite problem . So follow the steps:- 1- check that your push notifications are on in settings and friend invites are on in your game center account setting. 2-now install the latest version of fruit ni
-
How to delete background ?
I would like to use just the part saying "top reasons you're not making gains" when i save the file as PNG to use in another appliation, the whole picture shows us with no background as part of it how can i remove it alltogether? [img]http://i.imgur.
-
Business Objects XI 3.1 client tool installation problem
Hi Experts, When i am installing SAP Business Objects enterprise Xi 3.1 Client tool SP3 on my local desktop its throwing error as " Update installation cannot proceed because either the target product is missing or is not in the correct version for t
-
IMovie '11 shutting down in Lion. Apple Tech gave me the FIX!!!
Lion hates a Codec in Quicktime. Trash the Codec, and the iMoive crashing is FIXED. Like this: Finder to "Go" to "Computer" to "Mac HD" to "Library" to "Quicktime" At the top of the Quicktime column you see "...3ivx Codec..." THROW TH
-
Creating JMS Topic using JMX/MBeans Interface
Hello, I'm trying to create a JMS Topic using MBeans. For this, I first create a JMSTemplateMBean, then I create a JMSServerMBean (do setTemporaryTemplate() and addTarget() on the latter) and finally create JMSTopicMBean. On the JMSTopicMBean, I do s