Is it possible binding seeded vo where clause by personalizing?
I found oracle.apps.ar.hz.components.lookup.server.HzPuiLookupVO .
Query is :
SELECT *
FROM (SELECT MEANING, LOOKUP_CODE, LOOKUP_TYPE
FROM AR_LOOKUPS
WHERE ENABLED_FLAG = 'Y'
AND TRUNC(SYSDATE) BETWEEN TRUNC(NVL(START_DATE_ACTIVE, SYSDATE)) AND TRUNC(NVL(END_DATE_ACTIVE, SYSDATE))) QRSLT
WHERE (LOOKUP_TYPE = :1)
ORDER BY MEANING
I did created 'Message Choice' by personalization.
And I want to set binding value(WHERE (LOOKUP_TYPE = :1)) in Property of 'Message Choice' .
Is it possible??
Now I didn't set binding value.
So all values of AR_LOOKUPS is diplayed.
thx.
I didn't say that need to modify query.
Finally I did it.
It's work welll.
Level : Site
Item Style : Message Choice
ITEM Property
ID : PersonIdenTypeVO
Picklist Display Attribute : Meaning
Picklist Value Attribute : LookupCode
Picklist View Definition : oracle.apps.ar.hz.components.lookup.server.HzPuiLookupVO
Picklist View Instance : HzPuiPersonIdTypeVO
View Attribute : PersonIdenType
View Instance : PersonProfileVO
'HzPuiPersonIdTypeVO' is seeded VO.
I did use it.
thx.
I think it will many thing like this without modifing with OAF programming.
Similar Messages
-
hello,
we want to build an dynamic sql IR. so when a user logs into our application we have an page process that fills an application item :F_ITEM_WHERE with part of the where clause from an IR. On the page with the IR we have as region source something similiar to:
SELECT test_api_per_cus.get_per_name(id_per_cus) as Customer,
test_api_per_cus.get_per_cus_nr(id_per_cus) as "Cus.-Nr",
vtr_nr AS "VS-Nr."
id_vtr,
id_per_cus
FROM test_vtr
WHERE test_vtr.id_grp = :F_ID_GRP
AND test_vtr.id_per_cus IN
*(SELECT id_per_cus*
FROM viva_per_cus
WHERE LEVEL BETWEEN test_api_per_emo_r_tree.get_per_emp_r_tree_from(:F_ID_PER_EMP,
*:F_ID_GRP) AND*
test_api_per_emp_r_tree.get_per_mit_r_tree_to(:F_ID_PER_EMP,
*:F_ID_GRP)*
START WITH per_cus_nr =
test_api_per_emp_r_tree.get_per_emp_r_tree_tree(:F_ID_PER_EMP,
*:F_ID_GRP)*
CONNECT BY PRIOR per_cus_nr = per_cus_number
AND PRIOR id_grp = :F_ID_GRP)
AND EXISTS
so we want outsourcing the marked part of the where clause into :F_ITEM_WHERE. The result is as following:
SELECT test_api_per_cus.get_per_name(id_per_cus) as Customer,
test_api_per_cus.get_per_cus_nr(id_per_cus) as "Cus.-Nr",
vtr_nr AS "VS-Nr."
id_vtr,
id_per_cus
FROM test_vtr
WHERE test_vtr.id_grp = :F_ID_GRP
AND test_vtr.id_per_cus IN *|| :F_ITEM_WHERE ||*
AND EXISTS
Here says Apex that the Query cannot be parsed...if we fill the item plus 'AND test_vtr.id_per_cus IN' so our statement looks like this:
SELECT test_api_per_cus.get_per_name(id_per_cus) as Customer,
test_api_per_cus.get_per_cus_nr(id_per_cus) as "Cus.-Nr",
vtr_nr AS "VS-Nr."
id_vtr,
id_per_cus
FROM test_vtr
WHERE test_vtr.id_grp = :F_ID_GRP
*:F_ITEM_WHERE*
AND EXISTS
the query can parse but after that running apex says: bind :F_ITEM_WHERE not possible
Anyone got an solution for this? I think it´s only a syntax thing or something...
Thanks Daniel
Edited by: user12086353 on 14.09.2010 06:01When posting code on the forum, put {noformat}{noformat} (with the curly brackets and the word code in lowercase) above and below your code like this...
{noformat}{noformat}
SELECT *
FROM emp
{noformat}{noformat}
It will then appear like this, preserving formatting...SELECT *
FROM emp
Please post your code, properly formatted of +exactly+ what you have put in the region source. I'm not convinced that you need dynamic SQL at all.
Cheers
Ben -
Binding an SQL "where" clause to a field in the report.
Hello everybody,
I have made a crystal report that works fine. Now, I need to add a specific query to the report and drag and drop the returned fields in the report.
The problem is that I need to add a query that contains a "Where" clause that is binded to a field already existing in the report, for example :
SELECT T0.Field1,
T0.Field2,
T0.Field3
FROM Table1 T0
WHERE T0.Field4=(a field from a report)
Is it possible to do it ? if yes, how can I do it.
Thank you in advance for your further responds,
Best Regards,
- Youssef -Moved to Report Design forum
You can't do it in that specific way. It would have to be done server side or use a subreport and then link the subreport on the field from the main report.
Don -
Setting bind values in where clause in ViewObjectImpl
We want customize our views in a special manner. To look up for instance a text in the session langauge, we add a bind variable to the declared where clause of a VO:
and text.lang = :lang
Let's suppose, the actual value of the session language be known within ViewObjectImplementations. I want to set the bind value transparently within the ViewObjectImplementation rather than having to do it in every UI related client using this VO. Until now, I set the bind value whenever getViewObject or BuildWhereClause is called. This is sufficient for the AM Tester, but not for JClient forms using this VO (as a Not-all-values-bound exception is thrown), and I am not able to figure out by the documentation which methods of a VO are called when it is created and queried by a JClient form.See this web log posting on providing automatic default values for VO bind variables:
http://radio.weblogs.com/0118231/2003/08/01.html#a127 -
VO - bind variable in where clause problem
Hi
I have Jdeveloper 12. I successfully connected to mySQL database which works in Oracle mode (PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER)
Next I created EO, VO (screenshot) and finally AM.
when I run Application Module and enter bind variable value I receive error (screenshot):
oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT EO_TMP.create_date, EO_TMP.id, EO_TMP.name FROM autoid.advert EO_TMP WHERE EO_TMP.id = :var1
## Detail 0 ##
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
Doesn anybody know hot to fix this issue?
Regards.I decided to check if it is a mySQL driver so I've performed the same query using a below code and it works. This is definitely model configuration issue.
Connection con = null;
try{
Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost/sakila?user=root&password=1qaz2wsx");
String selectSQL = "SELECT actor_id,first_name,last_name,last_update FROM actor WHERE actor_id = ?";
PreparedStatement preparedStatement = con.prepareStatement(selectSQL);
preparedStatement.setInt(1, 4);
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
String userid = rs.getString("ACTOR_ID");
String username = rs.getString("FIRST_NAME");
System.out.println(userid);
System.out.println(username);
}catch (Exception e){
System.out.println(e.toString()); -
How to use sql "IN" operator with named bind variable in where clause ?
Can one bind variable be used for the "IN" list ('1','2','3') ?
rob,
No worries. Glad it helped. Glad to see also that you're doing things right and trying to use bind variables ;)
May I suggest adding "SOLVED" to the title of the original post?
Best,
John -
Where clause with Bind Variable in ViewObject
As per recomendations from Jdev team they say that using Bind varialbles in where clause will improve the performance (Option 1) But it is causing us to create more view objects.
Example : Lets say we have a View Object EmpVO
Option 1:
ViewObject vo=context.getViewObject("EmpVO");
vo.setWhereClause("EMPNO=?");
vo.setWhereClauseParam(0,st);
(or)
Option 2:
vo.setWhereClause("EMPNO="+st);
If we want to use same View Object "EmpVO" in another Action Class
ViewObject vo1=context.getViewObject("EmpVO");
vo1.setWhereClause("DEPTNO=?");
vo1.setWhereClauseParam(0,str);
It this case it throws an error saying BIND VARIABLE already exits. So we have to make another View Object.
Where as if we did not use bind variable but used Option 2 approach the same view object can be used in multiple pages.(at the expense of performance as per Jdev team)
Are we doing something wrong here or are there other ways to use the same view object when using bind variable in where clause.
ThanksI haven't been using BC4J for a while, but I seem to recall that the recommendations are that you don't set the where clause at runtime: You're supposed to define your view with the bind parameter already in it.
So you'd probably define an EmpsForEmpNoVO and type "EMPNO = ?" in the where box. (There are other ways of finding a single row/entity and one of those may well be more efficient. Perhaps a better example of where you might want a view of employees is WHERE DEPTNO = ?.)
IIRC, all instances of a particular type of view share the same definition, so you have to be careful if you alter that at runtime. However, I think everything's set up so that you can have many different (and separate) resultsets for a single view (instance) - meaning that it's possible to "run" a view for (e.g.) two different ids. (It's definitely possible to create two different instances of a view from its definition - and the resultsets will definitely be separate then. I think there's a "create" method on the application module; I remember that "find..." always returns the same instance of the view.)
Hope that's a push in the right direction (since no-one else had replied - and I hope not too much has changed since 9.0.3)....
Mike. -
JBO datasources: avoiding literal SQL in where clause
I understand that it is possible to set the where clause when defining a datasource with datatags:
e.g.
<jbo:DataSource id="ds" appid="wms_bc4j.Wms_bc4jModule" viewobject="WebUsersView" whereclause="USER_ID = 1"/>
However this results in literal SQL being sent to the database. Does anyone know of a method of using bind variables in this instance and thus avoid the literal SQL?Hi,
You need to "CAST" the bind variable to get the comma separated individual values.
Check this out article (Search for Using Comma-Separated String Bind for Variable IN List) on how to achieve this.
It has been developed on 10g. But, i think it will hold good for 11g as well.
-Arun -
How to use "where" clause in modify statement
Hi
can any1 telll me is it possible to use a where clause in a modify statemetn. I want to use modify statemetn to insert a new recoed in a database table.
Regards
Sabahuddin AhmedMODIFY itab - itab_lines
Syntax :
... itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp.
With these additions the MODIFY statement assigns the content of the comp1 comp2 ... components of the wa work area specified after TRANSPORTING to all lines in the itab table that meet the logical condition log_exp. The wa work area must be compatible with the line type of the internal table.
The TRANSPORTING addition has the same effect as changing individual lines. The WHERE addition can only be specified together with the TRANSPORTING addition. After WHERE, any logical expression can be specified in which the first operand of each individual comparison is a component of the internal table. All logical expressions are therefore possible, with the exception of IS ASSIGNED, , and IS SUPPLIED. It is not possible to dynamically specify a component using bracketed character-type data objects.
While for standard tables and hashed tables all lines in the internal table are checked for the logical expression of the WHERE statement, for sorted tables, optimized access can be achieved by checking at least one opening part of the table key for parity using AND linked queries in the logical expression.
Example
Change the contents of the planetype component for all lines in the sflight_tab internal table in which this component contains the value p_plane1 to the value p_plane2.
PARAMETERS: p_carrid TYPE sflight-carrid,
p_connid TYPE sflight-connid,
p_plane1 TYPE sflight-planetype,
p_plane2 TYPE sflight-planetype.
DATA sflight_tab TYPE SORTED TABLE OF sflight
WITH UNIQUE KEY carrid connid fldate.
DATA sflight_wa TYPE sflight.
SELECT *
FROM sflight
INTO TABLE sflight_tab
WHERE carrid = p_carrid AND
connid = p_connid.
sflight_wa-planetype = p_plane2.
MODIFY sflight_tab FROM sflight_wa
TRANSPORTING planetype WHERE planetype = p_plane1.
reward if useful -
Where clause as expression value for parameter?
Is it possible to put a where clause in a expression so I could use as a parameter? I have 3 documents I was going to make as available values, but not sure how to put all of this in the expression.
Where clause:
where document = 'doc1'
and sentdate = (Select max(sentdate) from Communication where document = 'doc1')Hi Lezgettdrunk,
According to your description, you want to specify available values for a report parameter.
In Reporting Services, if we want to specify the available values for a report parameter in Report Parameter Properties, we should get those values from specified values or a dataset. When we select the “Specify values” option, we can give each label corresponding
value. When we select the “Get values from a query” option, we should select a dataset which contains documents values. In your scenario, you could create a dataset with where clause to get document values, then specify parameter available values use this
dataset.
Reference:
Lesson 2: Adding Parameters to Create a List of Available Values (SSRS)
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support
Thank you! This worked for me. -
In Query Bean (Auto Customization Criteria) , OA FWK generate
where clause automatically .
I want to disable this criteria in some cases. Is there any way exists?
(Disable means remove some condition )
I want to see runtime query with where clause(In case of Query Bean) . Is there is any way to find out it?
Thanks, AvaneeshYou have couple of options to do this,
1. You can use getCriteria API on the queryBean which will stop the query execution by framework and it's the responsibility of the developer to use the dictionary returned by getCriteria and bind the complete where clause yourself.
2. You can use getNonViewAttrCriteria API on queryBean. This provides a dictionary of criteria on the column which are not mapped to a viewAttribute, for example if you want a poplist in the search region which has values like "Last one week", "Last 2 weeks", "Last 15 days" and so on and want to bind the criteria your self by interpreting the value selected.
In this case, framework still binds the where clause for the other criteria's which are mapped to a vo based column in the table and expects the developer to bind the criteria for these non viewattribute mappings in the controller.
I think your requirement fits in the second approach. -
Dimension Mapping in 11g. Can Where clause be used to filter source table?
Hi,
Is it possible to use a where clause filter when mapping a dimension to source table in AWM 11g
My understanding of the user guide is that filters can only be used in cube mapping?
I am using AWM 11.2.0.1.0A on db 11g R2.
I presume I could use a database view on the source table to filter down to the records for the dimension, however, I understand this would then prevent me refreshing any cube using this dimension using materialized view refresh?
ThanksYes, you can apply a where clause on a dimension map, but it is not exposed through AWM. You would need to add an attribute to the XML of the form
WhereClause='<source table condition>'For example, you could add this to a HierarchyLevelMap.
<HierarchyLevelMap
WhereClause="CUSTOMER_DIM.SHIP_TO_ID = 123"
KeyExpression="CUSTOMER_DIM.SHIP_TO_ID"
Query="CUSTOMER_DIM">
</HierarchyLevelMap>Make sure you add it to all relevant levels in a hierarchy. E.g. all levels that share the same source table. This is compatible with MV refresh. You can also map it to a view containing the where clause, and that, too, should work with MV refresh. -
Using bind variable in dynamic where clause and concatenate with query
Hi,
In my procedure i am framing where clause dynamically with bind variable,When i am concatenate this with my sql query for REF CURSOR i got sql command not properly ended exception.
Is it possible to pass values to the bind variable through the dynamic variable/value?
Please advise
Thanks in advance
Siva
IF in_applicationId IS NOT NULL THEN
optional_where := optional_where || ' AND a.APPLICATION_ID like '||':e%';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id'||',in_applicationId';
END IF;
My query is like this
open Out_Main FOR SelectQuery USING optional_usingThanks for reply,
In my procedure, i suppose to frame the where clause with bind dynamically according to the input parameters. so that i am framing the values of the bind variables also dynamically like this,
Please advise...
IF in_assignedAppFlag IS NOT NULL THEN
IF in_assignedAppFlag = 'Y' THEN
optional_where := optional_where || ' AND b.ASSIGNED_TO = :b' ;
optional_using := ' in_appFuncGroup'||',in_currentUserID';
ELSe
IF in_isSupervisor = 0 THEN
optional_where := optional_where || ' AND (b.ASSIGNED_TO = :b'||' OR b.ASSIGNED_TO = ''-1'' OR b.ASSIGNED_TO IS NULL)';
optional_using := ' in_appFuncGroup'||',in_currentUserID';
END IF;
END IF;
ELSE
IF in_isSupervisor = 0 THEN
optional_where := optional_where || ' AND (b.ASSIGNED_TO = :b'||' OR b.ASSIGNED_TO = ''-1'' OR b.ASSIGNED_TO IS NULL)';
optional_using := ' in_appFuncGroup'||',in_currentUserID';
END IF;
END IF;
IF in_appFuncGroup IS NOT NULL THEN
optional_where := optional_where || ' AND e.APP_FUNC_GROUP= :c';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup';
END IF;
IF in_queue_id IS NOT NULL THEN
optional_where := optional_where || ' AND b.QUEUE_ID = :d';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id';
END IF;
IF in_applicationId IS NOT NULL THEN
optional_where := optional_where || ' AND a.APPLICATION_ID like '||':e%';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'||',in_queue_id'||',in_applicationId';
END IF;
IF in_sourceCode IS NOT NULL THEN
optional_where := optional_where || ' AND e.APP_SOURCE_CODE like '||':f%';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
||',in_queue_id'||',in_applicationId'||',in_sourceCode';
END IF;
IF in_logo IS NOT NULL THEN
optional_where := optional_where || ' AND appProds.PRODUCT_TYPE like '||':g%';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo';
END IF;
IF in_firstName IS NOT NULL THEN
optional_where := optional_where || ' AND upper(a.FIRST_NAME) like upper(:h%)';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName';
END IF;
IF in_surName IS NOT NULL THEN
optional_where := optional_where || ' AND upper(a.SURNAME) like upper(:i%)';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName'||',in_surName';
END IF;
IF in_retreival_id IS NOT NULL THEN
optional_where := optional_where || ' AND e.RETREIVAL_ID like :j%';
optional_using := ' in_appFuncGroup'||',in_currentUserID'||',in_appFuncGroup'
||',in_queue_id'||',in_applicationId'||',in_sourceCode'||',in_logo'||',in_firstName'||',in_surName'||',in_retreival_id';
END IF; -
How to populate bind variable in view objects where clause in ADF faces
I've got a page with 2 input items.
The user manually enters the first value.
On the second input item I have created a LOV for the item which opens in a popup. How do I restrict the data returned in the LOV using the value entered in the first input item. I have created a bind variable and have included it in the where clause for the view object but how do I populated it.Here is an example:
Using the HR schema with the EMPLOYEES and DEPARTMENTS tables.
Example is using ADF BC and created an EMPLOYEES entity with an updateable view object for page,
and created a DEPARTMENTS view as a lookup
(SQL: select department_id, department_name from departments where department_name = :DeptName)
1: add method to the backing bean to filter the LOV
public void getTextValueToFilterLOV(ValueChangeEvent valueChangeEvent) {
Object value_from_form = valueChangeEvent.getNewValue();
FacesContext fctx = FacesContext.getCurrentInstance();
Application fapp = fctx.getApplication();
JUFormBinding formBinding = (JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(fctx);
DCIteratorBinding dcBinding = (DCIteratorBinding)formBinding.get("DeptLOVIterator");
ViewObject vo = dcBinding.getViewObject();
vo.setNamedWhereClauseParam("DeptName",value_from_form);
vo.executeQuery();
2. add valueChangeListener to the inputText on the page with an id and autoSubmit="true"
<af:inputText value="#{bindings.LastName.inputValue}" label="#{bindings.LastName.label}" binding="#{backing_DeptForm.inputText3}"
id="inputText3"
autoSubmit="true"
valueChangeListener="#{backing_DeptForm.getTextValueToFilterLOV}">
</af:inputText>
3. reference the LOV with the id name on the partialTriggers property
<af:selectOneChoice value="#{bindings.EmployeesUpdView1DepartmentId.inputValue}"
label="#{bindings.EmployeesUpdView1DepartmentId.label}" binding="#{backing_DeptForm.selectOneChoice1}"
id="selectOneChoice1"
partialTriggers="inputText3">
<f:selectItems value="#{bindings.EmployeesUpdView1DepartmentId.items}"
binding="#{backing_DeptForm.selectItems1}"
id="selectItems1"/>
</af:selectOneChoice>
Summary:
When you entered a text (LastName), that value is passed into the backing bean method.
The Bean method code will find the LOV Iterator and put the value into the bind variable.
Cheers,
Jim -
How to bind a VO :variable in a WHERE clause to a page parameter
Hello,
I have a VO. This VO has a variable :v in the WHERE clause of the query.
This VO is used by different UI components in a page (a table, a tree). The page already has a parameter defined in his properties #{viewScope.myparam}
What I want is to bind :v to the #{viewScope.myparam}, so that I can specify :v from a parameter in the URL, so that the table immeditaly shows the proper results.
Is there a way to Bind :v to #{viewScope.myparam} directly in the VO definition in the model project? (It seems it is not possilble)
The other alternative is to use ExecuteWithParams, but in this case I do not know how to perform the query without user actions in a trasparent way. I dont want to associate execute operations to UI components.
thanksHi,
+Is there a way to Bind :v to #{viewScope.myparam} directly in the VO definition in the model project? (It seems it is not possilble)+
No, this can't be done
The other alternative is to use ExecuteWithParams, but in this case I do not know how to perform the query without user actions in a trasparent way. I dont want to associate execute operations to UI components.
If you are within a bounded task flow or in an unbounded task flow that does not have this page as its first view (home page) then you can drag and drop executeWithParams as a method call activity. The attribute then should be saved in the pageFlowScope (not the viewScope).
In addition I would use a ViewCriteria instead of "hard wiring" the bind variable to the VO definition. You can then - in the AM data model section - associate the View Criteria with the VO instance yo use in the UI
Frank
Maybe you are looking for
-
Hello I am using Mobile Application Studio 4.0SR1 with SP8 I have some trouble with the modification of the Volumes/Trade Spends Planning. - The first thing I don't understand, running the project step by step, is how a DLL can call back functions in
-
Photo/text distorted in slide show mode in iphoto....help!
I have created a photobook in iphoto. When I view it in slideshow mode, the text and photo on both flaps are distorted. None of the other photos or text are distorted. Why is this and will it print like this when I go to buy the book?
-
Function module - convert to local currency
Dear all, I need to use a function module to convert to local currency a document that has been posted in foreign currency, which function module can I use? I tried convert_to_local_currency but I dont get any output... Else I need a function module
-
Need hlep for PGP Encryption for delimited file transfer using B2b
I have a requirement to read the PGP encrypted delimited file from partner and decrypt it to process. Can any body tell me how can I do this in b2b. I really appreciate the help
-
OWB 10gR2 on DB 11g and Workflow installation
Hi all, my customer has a data warehouse running on Oracle DB 10gR2 - 2 nodes RAC - on Linux 32 bit (Red Hat enterprise 5); ETL is developed with OWB 10gR2 and exploits Oracle Workflow (2.6.4). They are going to upgrade the database to 11.1 (still 2