Date Effective SDO and named bind variable

Hi.
I have a problem with named bind variable in date effective ADF Business Component (:Bind_SysEffectiveDate).
Service interface of my EmployeeHistorySDO has next methods:
getEmployeeHistoryView1
updateEmployeeHistoryView1
findEmployeeHistoryView1
createEmployeeHistoryView1
deleteEmployeeHistoryView1
If I invoke getEmployeeHistoryView1 method I'm getting next SQL statement:
[332] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
[333] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
[334] Column count: 7
[335] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
[336] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
[337] EmployeeHistoryView1 ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
[338] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
[339] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
[340] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setWhereClauseParams caused params changed
[341] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, null)
[342] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(SysEffectiveDateBindVar, null)
[343] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, null)
[344] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(fbkKy__0, 3)
[345] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.setNamedWhereClauseParam(SysEffectiveDateBindVar, 2010-10-01)
[346] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
[347] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
[348] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.execute caused params to be "un"changed
[349] Column count: 7
[350] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
[351] EmployeeHistoryView_0_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
[352] executeQueryForCollection ViewObject:EmployeeHistoryView_0_findByKey_, RowSet:EmployeeHistoryView_0_findByKey_
[353] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_ close prepared statements...
[354] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_ Created new QUERY statement
[355] EmployeeHistoryView_0_findByKey_>#q computed SQLStmtBufLen: 403, actual=380, storing=410
[356] SELECT EmployeeHistory.HISTORY_ID,         EmployeeHistory.POSITION,         EmployeeHistory.WAGE,         EmployeeHistory.EMPL_ID,         EmployeeHistory.START_DATE,         EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
[357] pStmt = conn.prepareStatement("SELECT EmployeeHistory.HISTORY_ID, EmployeeHistory.POSITION, EmployeeHistory.WAGE, EmployeeHistory.EMPL_ID, EmployeeHistory.START_DATE, EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)"); // JBO-JDBC-INTERACT
[358] Bind params for ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_0_findByKey_
[359] Binding param "SysEffectiveDateBindVar": 2010-10-01
[360] // ERROR: Unknown data type oracle.jbo.domain.Date // JBO-JDBC-INTERACT
[361] pStmt.setObjectAtName(SysEffectiveDateBindVar, "2010-10-01"); // JBO-JDBC-INTERACT
[362] Binding param "fbkKy__0": 3
[363] // ERROR: Unknown data type oracle.jbo.domain.Number // JBO-JDBC-INTERACT
[364] pStmt.setObjectAtName(fbkKy__0, "3"); // JBO-JDBC-INTERACT
Environment successfully binds today date to :SysEffectiveDateBindVar.
But if I try to invoke updateEmployeeHistoryView1 method environment binds already the variable that doesn't presents in SQL query, so I have an exception:
[606] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, SysEffectiveDateBindVar, 2010-10-01)
[607] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, Bind_SysEffectiveDate, 2010-10-01 00:00:00.0)
[608] EmployeeHistoryView_1_findByKey_ ViewRowSetImpl.doSetWhereClause(-1, fbkKy__0, 3)
[609] executeQueryForCollection ViewObject:EmployeeHistoryView_1_findByKey_, RowSet:EmployeeHistoryView_1_findByKey_
[610] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ close prepared statements...
[611] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ Created new QUERY statement
[612] EmployeeHistoryView_1_findByKey_>#q computed SQLStmtBufLen: 403, actual=380, storing=410
[613] SELECT EmployeeHistory.HISTORY_ID,         EmployeeHistory.POSITION,         EmployeeHistory.WAGE,         EmployeeHistory.EMPL_ID,         EmployeeHistory.START_DATE,         EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
[614] pStmt = conn.prepareStatement("SELECT EmployeeHistory.HISTORY_ID, EmployeeHistory.POSITION, EmployeeHistory.WAGE, EmployeeHistory.EMPL_ID, EmployeeHistory.START_DATE, EmployeeHistory.END_DATE FROM EMPLOYEE_HISTORY EmployeeHistory WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0) AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)"); // JBO-JDBC-INTERACT
[615] Bind params for ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_
[616] Binding param "SysEffectiveDateBindVar": 2010-10-01
[617] // ERROR: Unknown data type oracle.jbo.domain.Date // JBO-JDBC-INTERACT
[618] pStmt.setObjectAtName(SysEffectiveDateBindVar, "2010-10-01");  // JBO-JDBC-INTERACT
[619] Binding param "Bind_SysEffectiveDate": 2010-10-01 00:00:00.0
[620] // ERROR: Unknown data type java.sql.Timestamp // JBO-JDBC-INTERACT
[621] pStmt.setObjectAtName(Bind_SysEffectiveDate, "2010-10-01 00:00:00.0");  // JBO-JDBC-INTERACT
[622] ViewObject: [com.test.sdo.dateeffective.employee.history.EmployeeHistoryView]EmplHistoryAppModule.EmployeeHistoryView_1_findByKey_ close single-use prepared statements
[623] pStmt.close(); // JBO-JDBC-INTERACT
[624] QueryCollection.executeQuery failed...
[625] java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: Bind_SysEffectiveDate
     at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
     at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
     at oracle.jdbc.driver.OraclePreparedStatement.setObjectAtName(OraclePreparedStatement.java:11178)
     at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObjectAtName(OraclePreparedStatementWrapper.java:815)
     at weblogic.jdbc.wrapper.PreparedStatement_oracle_jdbc_driver_OraclePreparedStatementWrapper.setObjectAtName(Unknown Source)
     at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:4655)
     at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3645)
     at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:19288)
In Fusion Developer's Guide for Oracle Application Development Framework 11g Release 1 (11.1.1) at chapter 5.2 says that environmnet uses :Bind_SysEffectiveDate bind variable for passing effective date for Date Effective Business Components. But I see that in my case :SysEffectiveDateBindVar bind variabe is used for get method and both variables are used in update method.
Why environment trying to bind :Bind_SysEffectiveDate if only :SysEffectiveDateBindVar is present in the query ? How can I solve this problem ?
I'm using
Oracle JDeveloper Studio Edition Version 11.1.1.3.0
WebLogic Server Version: 10.3.3.0
Oracle SOA Suite 11.1.1.
Edited by: user2975420 on 01.10.2010 6:26

As I understood ApplicationModule.EFF_DT_PROPERTY_STR is used to pass the value of SysEffectiveDate. This means that this value will bind to variable that present in query filter (:Bind_SysEffectiveDate).
If this property is not set, the current date value binds to :Bind_SysEffectiveDate variable.
But the reason of my problem is another.
When I create date effective entity and date effective view object for this entity the query of VO is next (I see this query in query editor in JDeveloper):
SELECT EmployeeHistory.HISTORY_ID,
EmployeeHistory.POSITION,
EmployeeHistory.WAGE,
EmployeeHistory.EMPL_ID,
EmployeeHistory.START_DATE,
EmployeeHistory.END_DATE
FROM EMPLOYEE_HISTORY EmployeeHistory
WHERE (:Bind_SysEffectiveDate BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
But when I invoke getEmployeeHistoryView1 method of view object service interface, the query which I see in log is next:
SELECT EmployeeHistory.HISTORY_ID,
EmployeeHistory.POSITION,
EmployeeHistory.WAGE,
EmployeeHistory.EMPL_ID,
EmployeeHistory.START_DATE,
EmployeeHistory.END_DATE
FROM EMPLOYEE_HISTORY EmployeeHistory
WHERE (EmployeeHistory.HISTORY_ID = :fbkKy__0)
AND (:SysEffectiveDateBindVar BETWEEN EmployeeHistory.START_DATE AND EmployeeHistory.END_DATE)
Bind variable for SysEffectiveDate has *:SysEffectiveDateBindVar* name now instead of *:Bind_SysEffectiveDate*. But method invokes successfully.
When I invoke updateEmployeeHistoryView1 environmet already tryes to bind *:Bind_SysEffectiveDate* variable that doesn't present in query. So I have exception:
java.sql.SQLException: Attempt to set a parameter name that does not occur in the SQL: Bind_SysEffectiveDate
I'm not understanding why environment binds :Bind_SysEffectiveDate parameter which doesn't present in query.

Similar Messages

  • [Solved] Named Bind Variables at Runtime - SQL WHERE clause issue

    Hey 'all,
    I've been having this issue today with a Search page using Named Bind Variables at Runtime for the search parameters for the WHERE clause in the view objects SQL.
    I've got everything working except for a clearing method which I've created so that the user can clear the current WHERE clause from the SQL statment and set it as 1=2 (so that it doesn't do a blind query on load).
    The method can clear and set the WHERE clause to 1=2 only when there is already one there.
    Below are the methods: (located in my view object class)
    public void findInvoiceById(Number invoiceId){
        setWhereClause("invoice_id = :P_INVOICE_ID");
        defineNamedWhereClauseParam("P_INVOICE_ID",null,null);
        setNamedWhereClauseParam("P_INVOICE_ID",invoiceId);
        executeQuery();
    public void clearCriteria(){
        setWhereClause("1=2");
        removeNamedWhereClauseParam("P_INVOICE_ID");
        executeQuery();
    }The error which I get is the following - this happens when the button is pressed twice in a row, or when no query has been passed previously.
    1. JBO-29000: Unexpected exception caught: oracle.jbo.NoDefException, msg=JBO-25058: Definition P_INVOICE_ID of type Variable not found in SupplierInvoicesView1
    2. JBO-25058: Definition P_INVOICE_ID of type Variable not found in SupplierInvoicesView1
    Any help with this would be greatly appreciated!
    Cheers,

    Hi Bonnie,
    we have it working ok, but still feel that there is room for improvement in the design.
    For us the key factors are:
    Pages based on the same view object that can be queried multiple ways.
    We don't want to put design time bind variables in because it limits the use of the VO
    We don't wan't multiple VO's with different where clauses.
    The page is displaying the same table columns and fields, but the where clause must be dynamic.
    We only want to query on the search field entered (some of our tables are massive)
    TopLink named queries are really what we are after, but we don't want to forgo all the other ADF BC functionality. The only examples of ViewCriteria in the developer guide had literals in the where clause and no bind variables. The View Criteria may still be an option, but it appeared quite complex compaired to directly adding and removing bind variables at runtime.
    a couple of footnotes:
    the following methods are used to clear the runtime variables prior to reusing the VO (thanks to John Stegman for the pointer on the exception handler):
        public void clearBindVariable(String bindVariableName){
            try
                removeNamedWhereClauseParam(bindVariableName);
            catch (NoDefException e)
        public void clearBindVariables(){
            clearBindVariable("P_INVOICE_ID");
            clearBindVariable("P_INVOICE_NUM");
            clearBindVariable("P_SUPPLIER_NAME");
            clearBindVariable("P_INVOICE_DATE_FROM");
            clearBindVariable("P_INVOICE_DATE_TO");
            clearBindVariable("P_SUPPLIER_NUMBER");
        }We are using 1=1 and 1=2 in the where clause to supress blind querying. 1=2 is applied when ever we are not explicitely searching for something. We had a problem with using the refresh condition ${adfFacesContext.postback == true} which I posted about here:
    executeQuery called twice using ${adfFacesContext.postback == true}
    Would still gladly hear other ideas on a better reuse design.
    regards,
    Brenden

  • 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
    Chandran

    Apex listener version is 2.0.9
    Apex version is 4.2

  • Getting "Ordinal binding and Named binding cannot be combined" error

    Hello,
    I am getting following exception while calling stored produre:
    *"Ordinal binding and Named binding cannot be combined"*
    I am calling stored procedure with JDBC with 1 input parameter and 1 output parameters as mentioned below:
    CallableStatement collableStat = connection.prepareCall("{ call sp_clnt_intermed_validation(?,?) };
    // Registering In parameters          
    collableStat.setString("p_user_name", "SampleUser");                              
    // Registering Out parameters
    for(String paramKey : paramKeysSet) {                                   
    collableStat.registerOutParameter("p_success_flag", Types.VARCHAR);
    // execute stored procedure
    collableStat.execute();
    Please guide.
    Regards,
    Akshay.
    Edited by: 914678 on Feb 15, 2012 5:48 AM

    Why is the registerOutParameter in a loop?
    You don't state your DB version but as of 10g there is no support for named parameters for a PL/SQL function because there is no 'name' of the returned parameter. So use ordinal indexes for both parameters.
    Instead of
    collableStat.setString("p_user_name", "SampleUser");
    collableStat.registerOutParameter("p_success_flag", Types.VARCHAR);use
    collableStat.setString(1, "SampleUser");
    collableStat.registerOutParameter(2, Types.VARCHAR);Next time post this in the JDBC forum.
    Edited by: rp0428 on Feb 15, 2012 11:48 AM

  • Virtual KF(as Date) in Cube and pass the variable value to this VKF runtime

    Hi ,
    User would enter 1 date using date variable untime.
    My cube also has 1 Completed Date (KF).
    And i wann do comparisan based on input variable and exisitng variable.
    Can i add 1 Virtual KF(as Date) in Cube and pass the variable value to this VKF runtime and do the calculation in cube ???
    I know the same thing i can do in formula , but i have some different req.which i am unable to explain u here .
    So please let me know can i use VKF if yes how ???
    Points would be thrown for all .
    Bapu

    it's the exact posting from your last post. Please don't duplicate the postings, so that we can help you in one thread and not so many different threads

  • Creating on the fly dynamic named bind variable names.

    I have an application process which gets called by a Dynamic action and Javascript.
    Everything is working great however I'm using it to drive dynamic charts.
    I could use IF statements at the end of the application process to decide what BIND vairable to fill with the information the process has collected however I'd prefer just to create the BIND variable from the
    name of the submitted information.
    So I have an application level variable called WHICHCHART. this gets populated with text upon calling the application process...so let's say 'chart1' is what it gets filled with.
    What I"d like to have at the end of the application process is just a bind variable waiting called :chart_1.
    So no matter what the value of WHICHCHART it will create an on the fly a bind variable with the same name.

    Ok. I guess this question was more how do you do this..then OH NO there are not other ways to do this.
    So I have a page with a chart region. this chart will have 3 Y Axes which prohibits the use of the default XML.
    So..
    I have the following Javscript:
    function getdata(whichchart) {
      var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=VM_XML_GENERATION',0);
            get.add('WHICHCHART',whichchart);
            gReturn = get.get('XML');
      get = null;
    Which is called when the page loads by a dynamic action:
    getdata('production');
    When the javascript is called as you can see it fires off:
    declare
       chart_series_data VARCHAR(32767);
       type array_cols is varray(7) of varchar2(100);
       array array_cols := array_cols('VM_HOSTS_NUM','VM_NUMBER','VM_PHYS_MEM','VM_VIRT_MEM','VM_CPU_COUNT', 'VM_TOTAL_DISK','VM_PROVISIONED_DISK');
    BEGIN
    --IF :WHICHCHART IS NULL THEN
    --RAISE_APPLICATION_ERROR(-20001,'Chart variable not set');
    --END IF;
    chart_series_data := null;
    chart_series_data := '      <data>'||chr(10);
    chart_series_data := chart_series_data||  '        <series name="Hosts Number" type="Line" color="0x1D8BD1" >'||chr(10);
    for c1 in (SELECT VM_REPORT_DATE LABEL,VM_HOSTS_NUM from TABLE where VM_REPORT_DATE between add_months(SYSDATE,-24) and SYSDATE and lower(VM_DCNAME)=lower(:WHICHCHART) )
    loop
    chart_series_data := chart_series_data || '<point name="'||c1.LABEL||'" ';
    chart_series_data := chart_series_data || 'y="'||c1.VM_HOSTS_NUM||'"></point> '||chr(10);
    end loop;
    chart_series_data := chart_series_data|| '      </series>'||chr(10)||'</data>';
    :PROD_DATA := chart_series_data;
    END;
    The : production variable at the end of this I want to change the name of based on the value I'm sending of WHICHCHART from the javascript. I hope this is clearer now.
    AGAIN this is not really a need. It is a want to be able to create dynamic bind variable names going forward.
    Thanks

  • 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

  • Af:query with bind variables and Saved Search

    I have a VO and view criteria(VC).
    VC has a criteria item ObsoleteDate with range specified as bindVariables "dateFrm" and "dateTo" I dragged & dropped the named criteria as af:Query with table. Table toolbar has 2 buttons in which I set & clear the bind variables. Data is fetched as per as expected based on the VC & bind variables.
    The problem is,
    If I save my search with bind variables set and swap between the saved searches , all works fine. But the moment I clear bind variables & swap between searches.. "dateFrm" is populated and "dateTo" is null and I get an Exception oracle.jbo.AttrValException: JBO-27035: Attribute Obsolete Date: is required.
    Why is this happening?? Saved search is supposed to save the VC with all the bind values set while saving and clearing bind variables shouldn't affect the saved search, right?? Or I have understood it wrong?
    I am using JDeveloper 11.1.2.3.0
    Thanks

    Try
    like ? || '%'

  • Problems with Date bind variable

    I'm trying to use a Date as a bind variable in a View Object, and I'm running into difficulties. I've got the bind variable type set to date, and the control hints for Format Type and Format set to "Simple Date" and "yyyy-MM-dd" respectively. When I run the application module test and enter the date in the correct format, the View Object returns the expected results. However, when I try to set a Query Bind Parameters property for a JHeadstart group in my application definition in order to set the bind variable's value from an dateField input control, I get the following exception:
    30-Jan 08:49:56 ERROR (ErrorReportingUtils) -java.lang.IllegalArgumentException
    at java.sql.Date.valueOf(Date.java:104)
    at oracle.jbo.domain.Date.toDate(Date.java:348)
    at oracle.jbo.domain.Date.<init>(Date.java:279)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at oracle.jbo.domain.TypeConvMapEntry.convert(TypeConvMapEntry.java:73)
    at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:739)
    at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:90)
    at oracle.jbo.common.VariableImpl.convertToJava(VariableImpl.java:546)
    at oracle.jbo.common.VariableValueManagerImpl.doSetVariableValue(VariableValueManagerImpl.java:182)
    at oracle.jbo.common.VariableValueManagerImpl.setVariableValue(VariableValueManagerImpl.java:223)
    at oracle.jbo.common.VariableValueManagerImpl.setVariableValue(VariableValueManagerImpl.java:229)
    at oracle.jheadstart.model.adfbc.v2.JhsApplicationModuleImpl.applyBindParams(JhsApplicationModuleImpl.java:173)
    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:585)
    at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:507)
    at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:1795)
    at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:1989)
    at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:219)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1289)
    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:1802)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:627)
    at oracle.adf.model.binding.DCInvokeActionDef$DCInvokeAction.refresh(DCInvokeActionDef.java:140)
    at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:2521)
    at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2260)
    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareRender(PageLifecycleImpl.java:534)
    at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareRender(FacesPageLifecycle.java:98)
    at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.prepareRender(JhsPageLifecycle.java:1155)
    at oracle.adf.controller.v2.lifecycle.Lifecycle$1.execute(Lifecycle.java:297)
    at oracle.adf.controller.v2.lifecycle.Lifecycle.executePhase(Lifecycle.java:116)
    at oracle.adf.controller.faces.lifecycle.ADFPhaseListener.mav$executePhase(ADFPhaseListener.java:29)
    at oracle.adf.controller.faces.lifecycle.ADFPhaseListener$1.before(ADFPhaseListener.java:426)
    at oracle.adf.controller.faces.lifecycle.ADFPhaseListener.beforePhase(ADFPhaseListener.java:77)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:228)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
    at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    However, it seems that the value of the bind parameter did in fact change, according to the debug message issued by the JhsApplicationModuleImpl.applyBindParams(...) procedure:
    30-Jan 08:46:23 DEBUG (JhsApplicationModuleImpl) -ViewObject ViewObj: value of bind param move_date has changed: old value=null ,new value=Wed Jan 07 00:00:00 CST 2009
    One thing I have noticed that may be of interest - if I run the debugger into the JhsApplicationModuleImpl.applyBindParams(...) procedure, a default date in my bind variable shows up as an oracle.jbo.domain.Date object when it comes out of the following line:
    Object oldValue = vo.ensureVariableManager().getVariableValue(key);
    as opposed to the new value that gets sent from the input value of the dateField control, which shows up as a java.util.Date in the following line:
    Object value = args.get(key);
    In the string of functions leading up to the following in the stack trace:
                   at java.sql.Date.valueOf(Date.java:104)
    at oracle.jbo.domain.Date.toDate(Date.java:348)
    at oracle.jbo.domain.Date.<init>(Date.java:279)
    it looks like the value of the java.util.Date is converted to a string, then passed to these functions to be turned into a java.sql.Date object. However, according to the java.sql.Date.valueOf(...) function, it's expecting date in "yyyy-mm-dd" format, per the header comments:
    * Converts a string in JDBC date escape format to
    * a <code>Date</code> value.
    * @param s a <code>String</code> object representing a date in
    * in the format "yyyy-mm-dd"
    * @return a <code>java.sql.Date</code> object representing the
    * given date
    * @throws IllegalArgumentException if the date given is not in the
    * JDBC date escape format (yyyy-mm-dd)
    When the input value from the dateField input control is added as a java.util.Date, the toString() is producing the wrong date format, which could be seen in the debug output I included above that said the bind variable has changed.
    Has anyone done this before that can let me know what I am missing and how to fix this? I've search all over the web, and all the articles I've seen relating to bind variables only refer to those of numeric or string types, which aren't giving me any trouble. Even the Developer's Guide (http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/bcquerying009.htm) article "5.9 Using Named Bind Variables" doesn't reference using a Date type.

    I had the same problem about a year ago (using JHeadstart 10.1.3.2.52):
    15-feb 14:10:31 DEBUG (JhsApplicationModuleImpl) -Search item matches query bind param SubjectenKernPeildatum, value set to 2000-01-01
    15-feb 14:10:33 DEBUG (JhsApplicationModuleImpl) -Executing applyBindParams for BasServiceKern.AdresRollenSubjecten
    15-feb 14:10:33 DEBUG (JhsApplicationModuleImpl) -ViewObject AdresRollenSubjecten: value of bind param peildatum has changed: old value=null ,new value=Sat Jan 01 00:00:00 CET 2000
    15-feb 14:10:33 ERROR (ErrorReportingUtils) -java.lang.IllegalArgumentException
    at java.sql.Date.valueOf(Date.java:104)
    at oracle.jbo.domain.Date.toDate(Date.java:348)
    It appears a java.util.Date gets put on the criteria Map in the searchBean, this can't be used as input for a jbo.Date bindvariable.
    My ugly solution was to override public void applyBindParams(String voUsage,HashMap args)
    in MyProjectApplicationModuleImp (which extends JhsApplicationModuleImpl of course),
    check if value is a java.util.Date, and then
    value = new java.sql.Date(((java.util.Date)value).getTime());
    Greetings, HJ
    Edited by: HJHorst on Feb 6, 2009 12:22 AM

  • Creating stored outlines for date datatype bind variable

    While trying to create stored lines for a query having date datatype I get
    ORA-00932: inconsistent datatypes: expected DATE got NUMBER error:
    desc table_t1;
    col1 number,
    datecol date
    CREATE OR REPLACE OUTLINE TEST FOR CATEGORY TEST
    ON
    select * from table_t1
    WHERE T1.COL1 IS NOT NULL
                                          AND T1.DATECOL BETWEEN TRUNC (:D1)
                                                                   AND TRUNC (:D2)
                                                                       + 1Can someone please help me what am I doing wrong?
    I also tried to declare variable of date from sqlplus but it seems sqlplus doesn't have any support for date datatype var declaration as bind variable.
    Thanks
    Kev
    Edited by: Kevin_K on Jan 3, 2011 4:48 AM

    I think in this case you would have to take an approach like this:
    alter session set set create_stored_outlines=true;
    run your sql-statement (with a date bind variable), using anonymous plsql block.
    alter session set create_stored_outlines=false;
    Not sure though. It's been a while since I played around with outlines.

  • How to execute a function and return the result into a bind variable

    Hi,
    I am trying to calculate the sum of salaries of all persons with a particular JOB_ID using a function TOTAL_INCOME(v_job_id).
    create or replace function total_income
    +(v_job_id IN varchar2)+
    RETURN number IS
    v_total number(6);
    cursor get_sal is
    select salary from employees
    where job_id = v_job_id;
    BEGIN
    v_total := 0;
    for emp in get_sal
    loop
    v_total := v_total emp.salary;+
    end loop;
    dbms_output.put_line('Total salary of '||v_job_id||' is: '|| v_total);
    return v_total;
    END;
    Now I woud like to execute this function and assign the returned value into a bind variable test_sal
    variable test_sal number(6)
    SELECT total_income('AD_VP') into :test_sal FROM DUAL;
    dbms_output.put_line('Total Sal:'||:test_sal);
    This is returning the below errors:
    SELECT total_income('AD_VP') into :test_sal FROM DUAL
    *+
    Error at line 0
    ORA-01036: illegal variable name/number
    dbms_output.put_line('Total Sal:'||:test_sal);
    Error at line 3
    ORA-00900: invalid SQL statement
    Could someone help me what could be the problem?? Thanks for your time...

    Dear,
    If everything you will do will be done inside PL/SQL (stored procedure or stored function) then you don't have to care about bind variable.
    When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of your code and uses bind variables behind the scene.
    The only situation where you have to look carefully to the use of bind variables within PL/SQL is when you use Dynamic sql into stored procedures or functions.
    So, see in the light of the above comment, if you have to care about returning your function into a bind variable?
    Best regards
    Mohamed Houri

  • ManagedBean and Bind Variables in ADF applications

    Situation with Target Unreachable, 'TestBean'.
    ManagedBean: TestBean, parameter objectId
    ViewObject: sql-based: select * from someobject where id = :objectId
    Unbounded taskflow with the one page: Start.jspx
    Bounded TaskFlow "TestTaskFlow" with pagefragments: ButtonView.jsff and ObjectCard.jspx (as dialog).
    On the ButtonView there is a button with: action="dialog:OBJECT", actionListener.
    ActionListener handler I create by using the JDev Wizard. And the record was appeared in the adfc-config.xml. Is it correct? since the button is in the Taskflow. So in the taskflow there is no records about managed beans. May be it is Ok.
    Than, on the ObjectCard.jspx add ExecuteWithParams VO method, and set bind variable from the managedbean attribute. and get an error:
    SEVERE: Server Exception during PPR, #1
    javax.servlet.ServletException: Target Unreachable, 'TestBean' returned null
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
         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:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:102)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: javax.faces.el.EvaluationException: Target Unreachable, 'TestBean' returned null
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1227)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:142)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:754)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:282)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         ... 27 more
    Than I add this managedbean in the Taskflow too. There is no exception, but bind variables has not been set.

    Hi,
    most likely the managed bean got created in the adfc-config.xml file. If then it has a scope of pageFlowsScope, then it cannot be found. Move the managed bean or use it with a scope of requestScope or backingBeanScope
    Frank

  • Identify bind variable data type 121?

    Looks like the OCI forum is not popular. Reposting here with hopes of better luck... Or perhaps I wasn't specific enough for the forum? OK, this is obviously a binary data type. The problem is that I want to know exactly which of them it is. Or I'd like to know if someone has improperly coded an OCI application. Here's the original post.
    I received a level 12 SQL trace file that referenced data type 121 for a bind variable value. I have searched unsuccessfully for documentation in many places. Can anyone tell me what data type this is? Following is the relevant excerpt from the trace file.
    bind 18: dty=121 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=00 oacfl2=1 size=4000 offset=0
    bfp=022c1e80 bln=4000 avl=2196 flg=15
    value=
    Dump of memory from 0x22C1E80 to 0x22C2714
    22C1E80 01A214BC 022C1E88 022F1F88 01E0A954 [.....,.../.....T]

    Hi
    The following are the internal datatypes used by oracle related to 121.
    KOTAD, KOTMD, KOTMI, KOTTB, KOTTD
    Not sure about their exact use but these datatypes might be used internally for LOB's.
    Hope it helps.
    Diwakar

  • Undocumented bind variable data type

    I received a level 12 SQL trace file that referenced data type 121 for a bind variable value. I have searched unsuccessfully for documentation in many places. Can anyone tell me what data type this is? Following is the relevant excerpt from the trace file.
    bind 18: dty=121 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=00 oacfl2=1 size=4000 offset=0
    bfp=022c1e80 bln=4000 avl=2196 flg=15
    value=
    Dump of memory from 0x22C1E80 to 0x22C2714
    22C1E80 01A214BC 022C1E88 022F1F88 01E0A954 [.....,.../.....T]

    Hi
    The following are the internal datatypes used by oracle related to 121.
    KOTAD, KOTMD, KOTMI, KOTTB, KOTTD
    Not sure about their exact use but these datatypes might be used internally for LOB's.
    Hope it helps.
    Diwakar

  • Query and bind variable display in reports

    I have created a reports portlet using the locally built providers facility with the create a new reports. It seems to work fine except that the sql query and the bind variables show up in the report along with the report itself. How do I keep these from showing up?? I am on Portal 9.04
    Ken Rubesh

    ON the Page displayoptions tab, you can select "Show Query Conditions?..
    is that unselected?
    if you are talking about the fields from your select statement showing up in the body of the report, you can set the field type to hidden on the 2nd tab(column formatting).
    hope this helps

Maybe you are looking for

  • Continue Time Machine backup on MacBook Pro Retina

    Yesterday evening I copied my Time Machine backup from my MacBook Pro to my MacBook Pro Retina. When this was done, the icon of Time Machine was gray. When I tried to make a Time Machine backup, it wasn't possible to continue with the (old) Time Mach

  • Wishlist for app store

    Not sure if this has been brought up , but at the bottom of the pages of app descriptions where it says tell a friend and gift it, there should also be a button that says add to wishlist. I'm surprised there isn't already as it's a very simple additi

  • Too many archived logs when trying a backup

    Hello all, I'm having a bit of trouble running a backup script on an Oracle instance (10g1, on Solaris). As a normal DBA practice, I guess the backup should be scheduled and run from the very beginning of using a DB. Sometimes, from various reasons,

  • XI Message flow

    I am trying to integrate a r/3 system with XI, can someone point me to possible data flow diagrams. What can be a possible scenario here...? Can someone also point me to the message flow within IR and ID for the above scenario.. Regards Ravi

  • Default date field to today but still allow user to change date if needed.

    This is for a log that is usually accessed daily