Is it possible to set bind variable for picklist?? for messageChoice
we are trying to develop one new page in local JDeveloper.
we have requirement for passing a bind variable to a picklist. is it possible?
Item Type : messageChoice
Query:
SELECT DISTINCT TO_CHAR (effective_date, 'YYYY') TYPE
FROM pay_assignment_actions a, pay_payroll_actions b
WHERE a.payroll_action_id = b.payroll_action_id
AND assignment_id =
(SELECT assignment_id
FROM per_assignments_x
WHERE person_id = :person_id AND primary_flag = 'Y'
AND assignment_type = 'E')
AND a.action_status = 'C'
AND b.payroll_action_id IN (SELECT payroll_action_id
FROM pay_payroll_actions_v
WHERE action_type IN ('P'))
AND b.payroll_action_id IN (SELECT payroll_action_id
FROM xxilo_pre_payments)
ORDER BY 1 DESC
processRequest() code:
PayslipAMImpl am=(PayslipAMImpl)pageContext.getApplicationModule(webBean);
YearPicklistVOImpl yvo=(YearPicklistVOImpl)am.getYearPicklistVO1();
Number t = new Number(pageContext.getEmployeeId());
yvo.setWhereClauseParams(null);
yvo.setWhereClauseParam(0,t);
for this query & code we are getting
ERROR:
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
if we hardcoded person_id in query to some value then we are getting results without any error.
user603084 ,
In the query you have specifies bind variable as :person_id , but in your VO execution code you are setting value for bind variable :1
yvo.setWhereClauseParam(0,t);
You need to change the bind variable in query , like :1
and then execute the query of VO, as you have done. Also do executeQuery, after setting bind variables.
--Mukul
Similar Messages
-
Setting bind variable value programmatically for master and child VO's
Defined following BC:
Serv VO - Master VO, has Bind_cNum (bind variable)
ServDetail VO - Child VO, has Bind_cNum2 (bind variable)
ServViewLink VL - View link between Serv VO & ServDetail VO
in AMModule Impl have custom WS:
public List<ViewRowImpl> getMyServices(String cNum)
List<ViewRowImpl> result = new ArrayList<ViewRowImpl>();
ViewObjectImpl vo1 = getServ(); //Master VO
vo1.setNamedWhereClauseParam("Bind_cNum", cNum);
vo1.setForwardOnly(true);
ViewObjectImpl vo2 = getServDetail(); //Child VO
vo2.setNamedWhereClauseParam("Bind_cNum2", cNum);
vo1.executeQuery();
while (vo1.hasNext()) {
result.add((ViewRowImpl)vo1.next());
return result;
I am passing same cNum parameter to both Serv VO (Master VO) and ServDetail VO (child VO) as above. (this is in addition to view link bind variable :Id)
It shows in the logs that it is setting the values correctly:
<ViewRowSetImpl> <setNamedWhereClauseParam> [382] Serv ViewRowSetImpl.setNamedWhereClauseParam(Bind_cNum, 11771370)
<ViewRowSetImpl> <setNamedWhereClauseParam> [383] ServDetail ViewRowSetImpl.setNamedWhereClauseParam(Bind_cNum2, 11771370)
<ViewRowSetImpl> <doSetWhereClauseParam> [383] Serv ViewRowSetImpl.doSetWhereClause(-1, Bind_cNum, 11771370)
<ViewRowSetImpl> <execute> [385] Serv ViewRowSetImpl.execute caused params to be "un"changed
<OracleSQLBuilderImpl> <bindParamValue> [394] Binding param "Bind_cNum": 11771370
<ADFLogger> <addContextData> Execute query
-- when executing view link
<ViewRowSetImpl> <setParamValues> [425] ServViewLink_0 ViewRowSetImpl.setParamValues params changed
<ViewRowSetImpl> <doSetWhereClauseParam> [426] ServViewLink_0 ViewRowSetImpl.doSetWhereClause(-1, Bind_cNum2, null)
<ViewObjectImpl> <bindParametersForCollection> [436] For RowSet : ServViewLink_0
<OracleSQLBuilderImpl> <bindParamValue> [437] Binding null of type 12 for "Bind_cNum2"
<OracleSQLBuilderImpl> <bindParamValue> [438] Binding param "Bind_Id": 5018
from above log, when ServViewLink_0 is executed, it is changing Bind_cNum2 bind variable to null.
how can i pass same bind variable value to both Master and Child view objects from AM Impl.java
Edited by: bsrao on Oct 11, 2012 6:07 PM
Edited by: bsrao on Oct 11, 2012 6:10 PM
Edited by: bsrao on Oct 11, 2012 6:12 PMTry executing the vo1 query before setting the bind variable for vo2, then execute the vo2 query (if that's what you want to do).
-
Best Practice for setting bind variable when application loads
I am using JDeveloper 11.1.2.3.
When my application loads, the first unbounded page has a table populated by a named query.
I would like to set the parameter used by the named query when the page loads, to populate the initial data that is displayed.
What is the best practice for a solution to this issue?user6003393 wrote:
I am using JDeveloper 11.1.2.3.
When my application loads, the first unbounded page has a table populated by a named query.
I would like to set the parameter used by the named query when the page loads, to populate the initial data that is displayed.
What is the best practice for a solution to this issue?Hi,
You can set the bind variable on VO by overriding prepareSession() method in Application Module check this http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcservices.htm#sthref357
Setting bind variable on runtime http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcquerying.htm#CHDECJHD
Zeeshan -
How to set bind variable for a VO ,
Hi,
i got a requirement in which i have to set bind variable for VO , But the Bind variable is coming from payload attribute,
For example my query in VO is select * from Employee where emp_id="payload attribute"
How to set this attribute value is from the payload
Thanks Regard
RajendarHi i am getting this exception " Cannot create an object of type:java.lang.Number from type:oracle.bpel.services.datacontrol.data.DataObject with value:21159"
Actually i am getting Decimal Value from Payload of BPEl process and i am trying to set this to The bind variable
is that a type cast exception where can i typeCast Those values You should this in a new thread.Dont ask questions out of the scope of this thread.
Please mark this thread as answered or helpful if you got solution for this thread.
Thanks!!! -
How to set bind variables for child VO in hierarchy component?
Hi,
Recently I created a application with Hierarchy Component with Parent VO (Query based VO with Bind variables in it) and its Child VO along with Child-Child VO(Query based VO with bind variable in it)
I am able to set bind variable of parent VO but unable to set bind variable for Child-Child VO. Can any one help me regarding this issue?Hi i am getting this exception " Cannot create an object of type:java.lang.Number from type:oracle.bpel.services.datacontrol.data.DataObject with value:21159"
Actually i am getting Decimal Value from Payload of BPEl process and i am trying to set this to The bind variable
is that a type cast exception where can i typeCast Those values You should this in a new thread.Dont ask questions out of the scope of this thread.
Please mark this thread as answered or helpful if you got solution for this thread.
Thanks!!! -
Apex listener installed no test and set bind variables buttons
I have installed Apex listener and while creating restful service module i dont see test and set bind variables buttons in the source region.
I went through the many posts. Installed apex listener successfully.
getting http://localhost:8080/ords/ started message when i start the listener.
and using Apex URL as http://localhost:7780/pls/htmldb.
What are the possibilities for this issues?
Please help me on this.
Thanks
ChandranApex listener version is 2.0.9
Apex version is 4.2 -
Hi guys, I m facing a problem while executing below query .Query is working fine in toad i don't know what is the issue with the code
<code>
String url3 = "CREATE OR REPLACE VIEW Table2(PERIOD, YEARS, COST_CENTRE, S_DIR_PERM, S_DIR_CONT, S_INDIR_PERM, S_INDIR_CONT, O_DIR_PERM, O_DIR_CONT, O_INDIR_PERM, O_INDIR_CONT)AS select period, year, cost_center, sum(s_dir_perm), sum(s_dir_cont), sum(s_indir_perm), sum(s_indir_cont), sum(o_dir_perm), sum(o_dir_cont), sum(o_indir_perm), sum(o_indir_cont) from ( select b.period, b.year, a.cost_center, sum(a.perm_dir_hc) as s_dir_perm, sum(a.contract_dir_hc) as s_dir_cont, sum(a.perm_indir_hc) as s_indir_perm, sum(a.contract_indir_hc) as s_indir_cont, 0 as o_dir_perm, 0 as o_dir_cont, 0 as o_indir_perm, 0 as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift not in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center union select b.period, b.year, a.cost_center, 0 as s_dir_perm, 0 as s_dir_cont, 0 as s_indir_perm, 0 as s_indir_cont, sum(a.perm_dir_hc) as o_dir_perm, sum(a.contract_dir_hc) as o_dir_cont, sum(a.perm_indir_hc) as o_indir_perm, sum(a.contract_indir_hc) as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center) group by period, year, cost_center";
PreparedStatement statement3 = connection.prepareStatement(url3);
statement3.setString(1, "12/10/2008");
statement3.setString(2, "12/10/2008");
statement3.addBatch();
statement3.executeBatch();
</code>
i m getting the following error
java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for data definition operations
can any1 help me with this.Can you explain what you are trying to do from a business perspective?
If you are creating a view, it doesn't make sense to pass bind variables to that DDL statement. The view definition itself is going to have to end up with hard coded date values there. So what possible benefit is there to using bind variables?
As an aside, if you are using bind variables and you have DATE columns, you really want to pass in the proper data type (i.e. setDate or setTimestamp rather than setString). Otherwise, Oracle has to do implicit string to date conversion, which depends on the session's NLS settings, which is likely to be different on different client machines and lead to all sorts of odd errors and behaviors down the line.
Are you trying to build a view that takes parameters? If so, there are a few options for that sort of thing.
Justin -
<i>I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users?</i>
Um, there is no such thing as NAS4.1.
I'm assuming that you mean NAS4.0 (maybe NAS4.0sp1?). If so, then the session timeouts are specified in the session section of the NTV configuration files.
AFAIK, you can specify session timeouts on a per user basis. -
Is it possible to set a default music player for the music on my external while still keeping my iTunes the default player on my Mac ?
Message was edited by: PellseidonThere is no setting in the iPhone to set another default music player. The default is Music. If you are using another application, you are at the mercy of how that application operates as far as what occurs when it stops or errors out. The car is looking for music to play.
-
Is it possible to set a new default ringtone for alarm clock?
Just wondering if it is possible to set a specific ringtone to all alarms in the alarm clock without changing each alarm individually? My husband needs a MUCH louder alarm tone than the default.
Thanks.Thank you for posting.
When you say "Is it possible to set a minimum sale amount for eCommerce - $20 for example?", are you saying the customer should not be able to check out if he has less than $20 in the shopping?
If so, then it is not possible. I've not seen such kind of custom set up in BC yet. However, I'll leave this post open. If any of our partners have done it before, they might be able to help you.
Regards,
Aishvarya Raj Rastogi -
Is it possible to set a different privacy time for email?
Hi
I want to be able to get push notifications for my work emails from 8am - 5pm only. but they continue to push through after 5pm.
I have set up my personal gmail account with the gmail app.
My work email is on an exchange server, so any ideas out there to achieve this?
Thanks,<i>I am using NAS 4.1 and was wondering is it possible to set a different session timeout for different users?</i>
Um, there is no such thing as NAS4.1.
I'm assuming that you mean NAS4.0 (maybe NAS4.0sp1?). If so, then the session timeouts are specified in the session section of the NTV configuration files.
AFAIK, you can specify session timeouts on a per user basis. -
On the IPhone 5, is it possible to set up a Contact entry for a group of people?
On the IPhone 5, is it possible to set up a Contact entry for a group of people, and, if so, how?
"groups"
true... there are many basic functions in which apple loves to stay 10 years behind competitiors by design. my 2001 nokia could do that. -
Setting bind variable for a view object from the Managed Bean
Hi,
i am using JDeveloper 11g, i have to create LOV in the JSF. To show the LOV, it has to populate data using View object and its query parameter need to be sent from the Managed Bean.
For the View object i want to set the bind variable parameter from the managed bean value. bename is stored in a managed bean (session scope)
#{beantest.bename}
But it gives the following exception.
JBO-29000: Unexpected exception caught:
org.codehaus.groovy.control.MultipleCompilationErrorsException,msg=startup failed, Script1.groovy: 1: expecting '!',found '{'@ line1, column 2.
I have followed the link http://kr.forums.oracle.com/forums/thread.jspa?threadID=615474 like Frank wrote on 8.2.2008:
But steps are not clear.
How to input the VO bind parameter with Managed bean variable?
Any Help
Regards
Raj
Edited by: user9928180 on Dec 17, 2008 9:51 AMHi,
a bind variable in a VO needs to be exposed as an executeWithParams operation in the pageDef file. Just add a new action binding to the pageDef file (context menu) and select the executeWithParams operation on teh VO. Then in the argument field, reference the managed bean property for the value
Frank -
Setting bind variables for VO in JUnit test case
Hi,
I am using Jdeveloper 11.1.2.2
I have a problem while writing the test case for VO in JUnit.
For the Remove method in the Test case , I have passed variables into the VO by using a setWhereClause() .
Like this :
view.setWhereClause(null);
String whereClause = "location_id = '" + newUpdatedLocationId + "' AND organization_id = '" +newOrganizationId + "'" ;
view.setWhereClause(whereClause);
view.executeQuery();
while (view.hasNext()) {
view.next();
view.removeCurrentRow();
fixture1.getApplicationModule().getTransaction().commit();But it is showing a an error like the bind variables are not set.
So how will I access Bind variables programmatically and set the values ?
Thanks
Nigel.setNamedWhereClauseParam() is used for setting bind variables
-
Conditionally Setting Bind Variables
I need help conditionally setting some bind variables so I don't have to hard code some values. However, I get errors when I try to do this. I might just be going about it the wrong way. This is my code so far:
DECLARE
first_offset varchar2(3);
second_offset varchar2(3);
current_term varchar2(6);
BEGIN
current_term := (SELECT robinst_current_term_code
FROM robinst
WHERE robinst_aidy_code = :aidy)
CASE
WHEN current_term LIKE '%60' THEN first_offset := '40'
AND second_offset := '100'
WHEN current_term LIKE '%20' THEN first_offset := '100'
AND second_offset := '160'
END
END;
/I want to then use the offest variables in a select query afterwords. Is this possible, or what do I appear to be doing wrong?
Edited by: blackhole82 on Jan 23, 2009 2:01 PM
Edited by: blackhole82 on Jan 23, 2009 2:07 PMThis works when I run it in toad:
VARIABLE first_offset varchar2(3)
VARIABLE second_offset varchar2(3)
VARIABLE current_term varchar2(6)
BEGIN
SELECT robinst_current_term_code
INTO current_term
FROM robinst
WHERE robinst_aidy_code = :AIDY;
first_offset := CASE
WHEN current_term LIKE '%60' THEN '40'
WHEN current_term LIKE '%20' THEN '100'
END;
second_offset := CASE
WHEN current_term LIKE '%60' THEN '100'
WHEN current_term LIKE '%20' THEN '160'
END;
END;
SELECT spriden_id id, spriden_last_name||', '||spriden_first_name name
FROM spriden
WHERE spriden_pidm IN(
SELECT DISTINCT(RCRESAR_PIDM)
FROM RCRESAR A,RCRAPP1,SGBSTDN,SORLCUR, RCRAPP2, ROBINST
WHERE (RCRESAR_PELL_ELGBL = 'Y')
AND RCRAPP1_BIRTH_DATE <= (SELECT trunc(sysdate) - interval '25'year from dual)
AND RCRAPP1_CITZ_IND='1'
AND RCRAPP1_CURR_REC_IND='Y'
AND RCRAPP1_INFC_CODE = 'EDE'
AND SGBSTDN_STYP_CODE = 'C'
AND SGBSTDN_STST_CODE = 'AS'
AND SGBSTDN_LEVL_CODE = 'UG'
AND (SORLCUR_DEGC_CODE LIKE 'B%'
OR SORLCUR_DEGC_CODE LIKE 'A%')
AND SORLCUR_CACT_CODE='ACTIVE'
AND ((RCRAPP2_C_DEPEND_STATUS='2'
AND (RCRAPP1_STAT_CODE_RES='LA'
OR RCRAPP1_PAR_STAT_CODE_RES='LA'))
OR (RCRAPP2_C_DEPEND_STATUS='1'
AND RCRAPP1_STAT_CODE_RES='LA'))
AND F_ENROLLED_THIS_TERM(RCRESAR_PIDM, :current_term - :first_offset) = 'Y'
AND MSU_ENROLLED_HISTORY_TERM(RCRESAR_PIDM, :current_term - :second_offset) = 'Y'
AND NOT EXISTS (SELECT 'X'
FROM RPRAWRD
WHERE RCRESAR_PIDM = RPRAWRD_PIDM
AND RCRESAR_AIDY_CODE = RPRAWRD_AIDY_CODE
AND RPRAWRD_FUND_CODE LIKE 'GO%')
AND RCRAPP1_PIDM = RCRESAR_PIDM
AND SGBSTDN_PIDM = RCRESAR_PIDM
AND SORLCUR_PIDM = RCRESAR_PIDM
AND RCRAPP2_PIDM = RCRESAR_PIDM
AND RCRESAR_INFC_CODE = RCRAPP1_INFC_CODE
AND RCRESAR_SEQ_NO = RCRAPP1_SEQ_NO
AND RCRAPP2_INFC_CODE = RCRAPP1_INFC_CODE
AND RCRAPP2_SEQ_NO = RCRAPP1_SEQ_NO
AND RCRAPP1_AIDY_CODE = RCRESAR_AIDY_CODE
AND RCRAPP2_AIDY_CODE = RCRESAR_AIDY_CODE
AND ROBINST_AIDY_CODE = RCRESAR_AIDY_CODE
AND RCRESAR_AIDY_CODE = :AIDY
/*AND RCRESAR_PIDM = :PIDM */
INTERSECT
SELECT rprawrd_pidm
FROM rprawrd
WHERE rprawrd_fund_code = 'PELL'
AND rprawrd_offer_amt > 0
AND rprawrd_aidy_code = :AIDY
INTERSECT
SELECT rprawrd_pidm
FROM rprawrd
WHERE rprawrd_fund_code LIKE 'GO%'
AND rprawrd_paid_amt > 0
AND rprawrd_aidy_code <> :AIDY
AND spriden_change_ind IS NULL
ORDER BY nameBut it prompts me for my bind variables: current_term, first_offset, and second_offset. If I don't type in values I get no rows returned. When I type in what should be getting set in my pl/sql block it works fine. What could be the problem now? The purpose of the variables is to not to have to type anything.
Edited by: blackhole82 on Jan 23, 2009 3:28 PM
Maybe you are looking for
-
How do I make a scanned document editable?
Is there an app (or program) already on my Mac that allows me to edit a scanned document, or to scan directly into Pages or Word For Mac? I don't mind purchasing a program, if necessary, but it seems Mac has lots of functionalities built in... if yo
-
How can I retrieve my contacts?
I recently traded my iphone 4 which had 32g memory for an iPhone 5 that has 16g memory. when I tried to sync my new phone with my itunes and restore it from my recent back up from my 4s, it said I did not have enough memory and could not back up the
-
Installed themes cannot be remove
Hi, I am using N95 8GB. Installed some themes and found out that some of the themes installed do not appear under APPLICATION MANAGER, so this means I can't remove it from the phone. Sometimes reinstallation of the same theme will solve the issue whe
-
Hyperlink weirdness in iWeb 1.1.2
I'm having a strange issue (well, at least I think it is) and am hoping someone might know what I'm doing wrong or why it won't work. On my main/home page, my background image is one jpeg consisting of 9 squares of art (3 across x 3 rows). Before, I
-
Having problem with adobe - has encountered an unknown error.
When I go to adobe and open a PDF file, I try to Edit the text and I get an answer that Adobe has encountered an unknown error-please help