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 PM
This 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
Similar Messages
-
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 -
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!!! -
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 -
Getting error 025036 while setting bind variable value
Hi,
I have created a view object (ViewObj) having bind variable (Bind_Val).
I am writing custom java method in AppModuleImpl.java, so that I can use that in serviceInterface.
my method is:
public void Met(String a){
ViewObjImpl vo=new ViewObjImpl();
vo.setBind_Val(a);
I tried the below method also:
public void Met(String a){
ViewObjectImpl vo=new ViewObjectImpl();
vo.setNamedWhereClauseParam("Bind_Val",a)
But when I am running the AppModuleServiceImpl.java and select the Met method and pass the value for a. It is giving me error 02036.
How to set the bind variable value in AppModuleImpl.java??
Thanks,
RohitHi Frank,
Thanks for reply. It was helpful.
Please go through the below mentioned two queries.
My sql query is:
SELECT Message.MESSAGE_ID,
MessageProp.VALUE,
MessageProp.MSG_PROP_ID
FROM MESSAGE Message, MESSAGE_PROP MessageProp
WHERE (MessageProp.Key='From' OR MessageProp.Key='To')AND Message.MESSAGE_ID = MessageProp.MESSAGE_ID And MessageProp.Value='B'
and I have created one view criteria where I am giving the condition as MessageId=:Bind_MessageId.
And then I am executing my findViewCriteria method from AppModuleServiceImpl where I am passing the value for Bind_MessageId and I am getting the output as I want.
Now I am modifying my query as:
SELECT Message.MESSAGE_ID,
MessageProp.VALUE,
MessageProp.MSG_PROP_ID
FROM MESSAGE Message, MESSAGE_PROP MessageProp
WHERE (MessageProp.Key='From' OR MessageProp.Key='To')AND Message.MESSAGE_ID = MessageProp.MESSAGE_ID And MessageProp.Value=:Bind_Value
and setting the value for :Bind_Value programatically as:
public void test(String s){
ViewObjectImpl view = this.getViewObj1();
VariableValueManager vm = view.ensureVariableManager();
vm.setVariableValue("Bind_Value",s);
**Note- I have written this custom method in AppModuleImpl.java class
Then firstly I am executing test method from AppModuleServiceImpl to set the value for :Bind_Value. After that I am executing findViewCriteria method but then I am not getting any record.
**Note-I am not getting any error.
I want to set Bind_Value programatically and then I want to execute my FindViewCriteria from serviceInterface.
Thanks,
Rohit -
Problem in setting bind variable
Hi,
I am sorry but I think I am having problem with this simple ADF BC concept.
I created a View object from HR Schema and I wanted to filter it with department id
so I created a bind variable :dept_id.
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
xmlns="http://xmlns.oracle.com/bc4j"
Name="EmployeesView"
Version="11.1.1.59.23"
SelectList="Employees.EMPLOYEE_ID,
Employees.FIRST_NAME,
Employees.LAST_NAME,
Employees.EMAIL,
Employees.PHONE_NUMBER,
Employees.HIRE_DATE,
Employees.JOB_ID,
Employees.SALARY,
Employees.COMMISSION_PCT,
Employees.MANAGER_ID,
Employees.DEPARTMENT_ID"
FromList="EMPLOYEES Employees"
BindingStyle="OracleName"
CustomQuery="false"
PageIterMode="Full"
UseGlueCode="false"
Where="Employees.DEPARTMENT_ID = :dept_id"
RowClass="com.test.view.EmployeesViewRowImpl"
ComponentClass="com.test.view.EmployeesViewImpl">
<DesignTime>
<Attr Name="_codeGenFlag2" Value="Access|Coll|VarAccess"/>
<Attr Name="_isCodegen" Value="true"/>
</DesignTime>
<Variable
Name="dept_id"
Kind="viewcriteria"
Type="oracle.jbo.domain.Number"/>
<ViewAccessor
Name="JobsView1"
ViewObjectName="com.test.view.JobsView"
RowLevelBinds="true"/>
<ViewAccessor
Name="EmployeesView1"
ViewObjectName="com.test.view.EmployeesView"
RowLevelBinds="true"/>
<ViewAccessor
Name="DepartmentsView1"
ViewObjectName="com.test.view.DepartmentsView"
RowLevelBinds="true"/>
<ListBinding
Name="LOV_JobId"
ListVOName="JobsView1"
ListRangeSize="10"
NullValueFlag="none"
NullValueId="LOV_JobId_LOVUIHints_NullValueId"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="JobId"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="JobId"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="JobTitle"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
<ListBinding
Name="LOV_ManagerId"
ListVOName="EmployeesView1"
ListRangeSize="-1"
NullValueFlag="start"
NullValueId="${adfBundle['oracle.javatools.resourcebundle.SystemBundle']['NULL_VALUE_RESID']}"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="ManagerId"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="EmployeeId"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="FirstName"/>
<Item Value="LastName"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
<ListBinding
Name="LOV_DepartmentId"
ListVOName="DepartmentsView1"
ListRangeSize="-1"
NullValueFlag="start"
NullValueId="${adfBundle['oracle.javatools.resourcebundle.SystemBundle']['NULL_VALUE_RESID']}"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="DepartmentId"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="DepartmentId"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="DepartmentName"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
<EntityUsage
Name="Employees"
Entity="com.test.Employees"/>
<ViewAttribute
Name="EmployeeId"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="EmployeeId"
EntityUsage="Employees"
AliasName="EMPLOYEE_ID"/>
<ViewAttribute
Name="FirstName"
PrecisionRule="true"
EntityAttrName="FirstName"
EntityUsage="Employees"
AliasName="FIRST_NAME"/>
<ViewAttribute
Name="LastName"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="LastName"
EntityUsage="Employees"
AliasName="LAST_NAME"/>
<ViewAttribute
Name="Email"
IsUnique="true"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="Email"
EntityUsage="Employees"
AliasName="EMAIL"/>
<ViewAttribute
Name="PhoneNumber"
PrecisionRule="true"
EntityAttrName="PhoneNumber"
EntityUsage="Employees"
AliasName="PHONE_NUMBER"/>
<ViewAttribute
Name="HireDate"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="HireDate"
EntityUsage="Employees"
AliasName="HIRE_DATE"/>
<ViewAttribute
Name="JobId"
LOVName="LOV_JobId"
IsNotNull="true"
PrecisionRule="true"
EntityAttrName="JobId"
EntityUsage="Employees"
AliasName="JOB_ID">
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="combo_lov"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
<ViewAttribute
Name="Salary"
PrecisionRule="true"
EntityAttrName="Salary"
EntityUsage="Employees"
AliasName="SALARY"/>
<ViewAttribute
Name="CommissionPct"
PrecisionRule="true"
EntityAttrName="CommissionPct"
EntityUsage="Employees"
AliasName="COMMISSION_PCT"/>
<ViewAttribute
Name="ManagerId"
LOVName="LOV_ManagerId"
PrecisionRule="true"
EntityAttrName="ManagerId"
EntityUsage="Employees"
AliasName="MANAGER_ID">
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="choice"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
<ViewAttribute
Name="DepartmentId"
LOVName="LOV_DepartmentId"
PrecisionRule="true"
EntityAttrName="DepartmentId"
EntityUsage="Employees"
AliasName="DEPARTMENT_ID">
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="choice"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
<ViewLinkAccessor
Name="EmployeesView"
ViewLink="com.test.view.EmpManagerFkLink"
Type="oracle.jbo.RowIterator"
IsUpdateable="false"/>
<ViewLinkAccessor
Name="DepartmentsView"
ViewLink="com.test.view.DeptMgrFkLink"
Type="oracle.jbo.RowIterator"
IsUpdateable="false"/>
</ViewObject>But when I ran it in my Business Component Browser, I am encountering below error
java.sql.SQLException: Missing IN or OUT parameter at index:: 1Not sure but did I miss something? Thanks
JDEV 11G PS3Hi Frank,
Thanks, I think thats the gotcha...
setting the bind variable to required causes the dialog to appear...
Not sure though if this is a bug or something.. -
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 -
About dynamically setting bind variable in LOV View
Hi,
I have a LOV VO for an af:SelectOneChoice field in the page.
The LOV is depended on an SQL statement in which there is a bind variable in the where clause.
When I open the page, I set the bind variable by using VO.setNamedWhereClauseParam in the prepareSession method in the application module, followed by VO.executeQuery();
The problem is, the af:SelectOneChoice is blank. Why?
If I do not use the bind variable in the SQL, I can see rows in the af:SelectOneChoice field.
When is the proper time to populate the LOV? And where should I put the code for populating the LOV?
I am sure that the VO is populated, because after I executeQuery, there are many rows in the VO.
Thanks
Stephen
nullHi Franky,
Yes, when I set a default value for the bind variable, everything is OK.
But I want the bind variable dynamically be set when the AM is initiated. Is there a way to do that?
Stephen -
How to set Bind variable on the action of command link
I have two tables. One is the list of processes and other one is the details of processes with process name as primary key.
I want to first display the first table which has the list of processes on one page. When I click on perticular process name this process will pass to the bind variable of another table and corresponding details will be shown on other page. can anyone help how I can do this. My code is as follows:
package model;
import model.common.BpelDetailsView;
import oracle.jbo.server.ViewObjectImpl;
public class BpelDetailsViewImpl extends ViewObjectImpl implements BpelDetailsView {
* This is the default constructor (do not remove).
public BpelDetailsViewImpl() {
* Returns the variable value for bpelnameVar.
* @return variable value for bpelnameVar
public String getbpelnameVar() {
return (String)ensureVariableManager().getVariableValue("bpelnameVar");
* Sets <code>value</code> for variable bpelnameVar.
* @param value value to bind as bpelnameVar
public void setbpelnameVar(String value) {
ensureVariableManager().setVariableValue("bpelnameVar", value);
this.executeQuery();
<af:commandLink id="ot3" text="#{row.BpelName}"
action="#{DasboardBean.ot3_action}"/>
public String ot3_action() {
BpelDetailsViewImpl bdv=new BpelDetailsViewImpl();
bdv.setbpelnameVar("#{row.BpelName}");
return "success";
but its not working at all.
Its displaying the errors on click of command link.
javax.servlet.ServletException: java.lang.NullPointerException
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:147)
at org.apache.myfaces.trinidad.component.UIXTable.broadcast(UIXTable.java:271)
at oracle.adf.view.rich.component.UIXTable.broadcast(UIXTable.java:140)
at oracle.adf.view.rich.component.rich.data.RichTable.broadcast(RichTable.java:364)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:87)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:298)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:91)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:87)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:87)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:298)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:91)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:81)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:673)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:273)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:165)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
... 34 more
Caused by: java.lang.NullPointerException
at oracle.jbo.server.ComponentObjectImpl.ensureVariableManager(ComponentObjectImpl.java:472)
at model.BpelDetailsViewImpl.setbpelnameVar(BpelDetailsViewImpl.java:32)
at portal.view.bean.DasboardBean.ot3_action(DasboardBean.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
... 54 moreHi Shay..
Thanx for your help...
I stuck in one more problem. When I run directly the first list page it works fine. I craeted one more page home.jspx where I added a golink with <af:golink id="gl1" text ="List" destination="list.jspx". When I click on link it opens the list page. Now when I clicking on first column its redirecting to list.jspx not to details.jspx.
What can be the solution for this. -
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
-
Setting bind variable to a different value if its null
Hi,
I have a report page which displays a table. One of the parameters of the sql query that generates this table is an apex bind variable.
I want the page to to run a different sql query depending on whether the bind variable is blank or not.
How can I do this in Apex without having to do use a function?
It would be good if I good reset the bind variable to another value (generated from a different sql statement) when the page loads.
Thanks
Edited by: sam on 17-Feb-2011 07:43Hi,
Thanks, that's really helpful.
I'm passing a value (:P1_VAR1) as null from page 1 to page 2. On page 2 I have a table with the first column showing primary keys that have links.
When the user clicks on the link, it refreshes page 2 and sets the value on session :P1_VAR1 to the value of the primary key of the record clicked.
However, the problem is that when the user goes from page 1 to page 2, I want the :P1_VAR1 to be initialised to the first primary key record from the first record on my table.
I have a function that gets the id of the first record on my table but I don't know how to set the :P1_VAR1 to this value by modifying the item settings in APEX.
Please can someone help and give me an example on how this is done?
Thanks
Edited by: sam on 17-Feb-2011 07:49 -
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).
-
No Signature of Method Error when trying to set Bind Variable Groovy Expr
I am trying to set a Bind variable on my view object to equal the output of a function defined in the the EntityImpl.java that corresponds to that bind variable.
I set the value of my bind variable to be = adf.object.getMyServiceType()
Where the name of the view object I am currently in is called GridSwSoftwareServiceView.xml and the Entity object is called GridSwSoftwareService.java and the EntityImpl file is called GridSwSoftwareService.java.
I am seeing this error:
No signature of method: oracle.jbo.common.VariableImpl$VariableExprValueSupplier.getMyServiceType() is applicable for argument types: () values: []
Does anyone know what this error means?
I was trying to follow an example from this doc: http://www.oracle.com/technology/products/jdev/11/how-tos/groovy/introduction_to_groovy.pdf
Edited by: user10791986 on May 21, 2010 2:50 PMLooks like a bug... :(
It works fine as a View Object attribute expression but it fails miserably once added as an expression to the bind variable. In this case, here is a work-around:
Define the method as static in your EntityImpl.java :
public static String getMyServiceType() {
return "EBSO R12";
Then access it by fully qualifying it with the package and class :
com.yourpackage.EntityImpl.getMyServiceType()
Edited:
On a second thought, I am wondering if the expression is valid since the Entity hasn't yet constructed at that point.... That explains why it works when made static.
Nick
Edited by: Nick Haralabidis on May 21, 2010 5:16 PM
Maybe you are looking for
-
How do I add a web site to my favorites
I Can't seem to find a way to enable a favorites bar on safari. What am I doing wrong
-
To check whether there is any size mismatch between columns of two tables
Hi, Here i got two tables T and M where i am going to migrate data from T to M. But before migrating i need to check whether all the data in source table fits into destination table columns. The datatypes of all columns in source table T is of Varcha
-
Is it possible to burn 2 movies on 1 DVD?
I've got a problem with Compressor 4. How can I burn two movies on one DVD? Regards, Jan
-
Artifacts around letters when uploading to Facebook
Hi people, I have an issue that has me stumped. I'm uploading a Facebook timeline photo that I've created in Illustrator and exported as a PNG. It looks fine after being exported on my Mac, but It keeps uploading to Facebook with artifacts around the
-
What is "Realm-Name" about ? How do I remove that ?
Hi When I try to run a php file locally, I get this message "To view this page, you must log in to area "Realm-Name" on localhost:8888." What is this and where can I read more about this concept ? How do I remove this message ? Any help is appreciate