About ora-01006 :bind variable does not exist

Hi all of you,i have this dynamic sql :
DECLARE
v_query clob;
cpt number;
begin
v_query:='
SELECT
count(TBA.ANT_ID)
  FROM
WHERE TBA.ANT_FUT_ID = TFT.FUT_ID
       AND TBA.ANT_KATEGORIE_CODE_ID = TAKCL.ANT_KATEGORIE_CODE_ID(+)
       AND TBA.ANT_KFZ_REIHEN_ID = TKR.KFZ_REIHEN_ID(+)
       AND TBA.ANT_ID = F1.ANT_ANT_ID(+)
       AND TBA.ANT_ID = F2.ANT_ANT_ID(+)
       AND TBA.ANT_ID = F3.ANT_ANT_ID(+)
       AND TBA.ANT_ID = ERS.ers_bdk(+)
       AND TBA.ANT_ID = F1_2.ANT_ANT_ID(+)
       AND TBA.ANT_ID = F2_3.ANT_ANT_ID(+)
       AND TBA.ANT_ID = MFU.MFU_ANT_ID(+)
       AND MFU.MFU_NIETGEOMETRIE_ID = NG.NG_ID(+)
       AND MFU.MFU_MATRIZEN_BEICHNUNG_ID = MZB.MZB_ID(+)
    -- Suchkriterien: --
    --Ersteller
    AND  DECODE( ERS.ers_id, NULL, ''%'', ERS.ers_name ) LIKE DECODE('':1'',NULL,''%'','''')||''''|| :1 ||''''||DECODE('':1'',NULL,''%'','''')
     --Fahrzeug
    AND  DECODE( TKR.NAME, NULL, ''%'', TKR.NAME ) LIKE DECODE('':2'',NULL,''%'','''')||''''|| :2 ||''''|| DECODE('':2'',NULL,''%'','''')
     --BDK
    AND  DECODE( fuege_db.bdk_nummer( TBA.ANT_ID,''.'' ), NULL, ''%%'',
   fuege_db.bdk_nummer( TBA.ANT_ID,''.'' ) )   LIKE ''%''||:3||''%''
    --Technologie
    AND  TBA.ANT_FUT_ID LIKE DECODE('':4'',NULL,''%'','''')||''''|| :4 ||''''||DECODE('':4'',NULL,''%'','''')
     --Art
    AND ((TBA.ANT_WFP_ID is null and 1=DECODE('':5'',NULL,1,1,1) ) or (TBA.ANT_WFP_ID is not null and 2=DECODE('':5'',NULL,2,2,2)))
    --VTA
    AND TBA.ANT_VTA = decode('':6'',1,1,TBA.ANT_VTA)  ';
execute immediate v_query
into cpt USING
'Dominik Hussmann',
'AU736_Q7_SUV' ,
'WPS Stahl',
'0';  
end ;
In the execution,i have this error :ora-01006 :bind variable does not exist, after analyzing,i have found that the problem is with parameters :5 and :6 ,i don't understand they have the same syntax
as bind variables 1,2,3 and 4.
Than you for any suggestion.

I hope you do realise that there are 13 bind-variables in your sql, not 6?
Variables are bound by position. You cannot use the same bind variable twice, they will be 2 distinct bind variables.
For example, you use :1 three times, so you need to provide three arguments, in this case three times the same value.

Similar Messages

  • Job Lov Extension ORA-01006: bind variable does not exist

    Hello All,
    I have extended the VO and CO for USJobovVO and i am getting the error as --> ORA-01006: bind variable does not exist.
    Please let me know.
    I have extended the US Job LOV VO  as follows
    SELECT
    pj.job_id,
    pj.name job,
    pj.business_group_id,
    pj.date_from,
    pj.date_to,
    hlc.meaning flsa_status,
    pj.attribute3 xxatc_job_dff
    FROM
    per_jobs_v pj,
    hr_leg_lookups hlc
    WHERE hlc.lookup_code(+)= pj.job_information3
    and hlc.lookup_type(+)='US_EXEMPT_NON_EXEMPT'
    Extended the controller and passing the parameter to the VO
    OAApplicationModule oaapplicationmodule = pageContext.getApplicationModule(webBean);
    OAViewObject oaviewobject = (OAViewObject)oaapplicationmodule.findViewObject("UsJobLovVO");
    String s = (String)dictionary.get("HrBusinessGroupId");
    oracle.apps.fnd.framework.server.OADBTransaction oadbtransaction = oaapplicationmodule.getOADBTransaction();
    SSHRParams sshrparams = new SSHRParams(oadbtransaction);
    String s1 = sshrparams.getEffectiveDate();
    String p = pageContext.getParameter("searchText");
    pageContext.putParameter("searchText", "%" + p + "%");
    String p1 = pageContext.getParameter("searchText");
    // oaviewobject.setWhereClause("(xxatc_job_dff like :1 or job like :1)");
    oaviewobject.setWhereClause(" xxatc_job_dff like :1");
    oaviewobject.setWhereClauseParam(1, p1);
    pageContext.writeDiagnostics(this, "RS p new param:" + p1, 3);
    Standard CO is as follows
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    initVO(oapagecontext, oawebbean);
    public void initVO(OAPageContext oapagecontext, OAWebBean oawebbean)
    Dictionary dictionary = oapagecontext.getLovCriteriaItems();
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    OAViewObject oaviewobject = (OAViewObject)oaapplicationmodule.findViewObject("UsJobLovVO");
    String s = (String)dictionary.get("HrBusinessGroupId");
    oracle.apps.fnd.framework.server.OADBTransaction oadbtransaction = oaapplicationmodule.getOADBTransaction();
    SSHRParams sshrparams = new SSHRParams(oadbtransaction);
    String s1 = sshrparams.getEffectiveDate();
    oaviewobject.setWhereClause("business_group_id = :1 and to_date( :2 , 'RRRR/MM/DD') between date_from and nvl" +
    "(date_to, to_date( :3 , 'RRRR/MM/DD'))"
    oaviewobject.setOrderByClause("job");
    oaviewobject.setWhereClauseParam(0, s);
    oaviewobject.setWhereClauseParam(1, s1);
    oaviewobject.setWhereClauseParam(2, s1);
    The Log shows as follows, i am not sure where the param 4 is being picked from
    WHERE (business_group_id = :1 and to_date( :2 , 'RRRR/MM/DD') between date_from and nvl(date_to, to_date( :3 , 'RRRR/MM/DD')) AND ( UPPER(JOB) like :4 )) ORDER BY job
    I am getting the error as follows
    [488]:ERROR:[fnd.framework.about.webui.OAAboutPGCO]:oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT
    pj.job_id,
    pj.name job,
    pj.business_group_id,
    pj.date_from,
    pj.date_to,
    hlc.meaning flsa_status,
    pj.attribute3 xxatc_job_dff
    FROM
    per_jobs_v pj,
    hr_leg_lookups hlc
    WHERE hlc.lookup_code(+)= pj.job_information3
    and hlc.lookup_type(+)='US_EXEMPT_NON_EXEMPT') QRSLT WHERE (JOB like :1 AND ( UPPER(JOB) like :4 AND (JOB like :5 OR JOB like :6 OR JOB like :7 OR JOB like :8))) ORDER BY job
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2555)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1677)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01006: bind variable does not exist
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:590)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1973)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2566)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2963)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:584)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:631)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:518)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3375)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4507)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
         at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
         at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3339)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3326)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:441)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(OAViewObjectImpl.java:716)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(OAWebBeanHelper.java:2314)
         at oracle.apps.fnd.framework.webui.OAMessageLovInputHelper.handleValidateEventPrivate(OAMessageLovInputHelper.java:1229)
         at oracle.apps.fnd.framework.webui.OAMessageLovInputHelper.handleValidateEvent(OAMessageLovInputHelper.java:2546)
         at oracle.apps.fnd.framework.webui.LovUtils.handleLovValidate(LovUtils.java:250)
         at oracle.apps.fnd.framework.webui.LovUtils.handleLovEventInPFD(LovUtils.java:170)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2531)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1677)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: ORA-01006: bind variable does not exist
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:590)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1973)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2566)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2963)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:584)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:631)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:518)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3375)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4507)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
         at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
         at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3339)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3326)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:441)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.initQuery(OAViewObjectImpl.java:716)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.setCriteriaOnVO(OAWebBeanHelper.java:2314)
         at oracle.apps.fnd.framework.webui.OAMessageLovInputHelper.handleValidateEventPrivate(OAMessageLovInputHelper.java:1229)
         at oracle.apps.fnd.framework.webui.OAMessageLovInputHelper.handleValidateEvent(OAMessageLovInputHelper.java:2546)
         at oracle.apps.fnd.framework.webui.LovUtils.handleLovValidate(LovUtils.java:250)
         at oracle.apps.fnd.framework.webui.LovUtils.handleLovEventInPFD(LovUtils.java:170)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormData(OAPageBean.java:2531)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1677)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430)
         at oa_html._OA._jspService(_OA.java:84)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417)
         at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267)
         at oracle.jsp.JspServlet.internalService(JspServlet.java:186)
         at oracle.jsp.JspServlet.service(JspServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456)
         at org.apache.jserv.JServConnection.run(JServConnection.java:294)
         at java.lang.Thread.run(Thread.java:534)
    Edited by: Rakesh S on Oct 27, 2009 7:16 PM
    Edited by: Rakesh S on Oct 27, 2009 8:54 PM

    Hi Pratap,
    I think it should work now right as i am using UNION in extended VO and assigning the attribute3 to Job. As per the querybean it will create where clause based on JOB,so it should handle right.
    Seeded VO
    SELECT
    pj.job_id,
    pj.name job,
    pj.business_group_id,
    pj.date_from,
    pj.date_to,
    hlc.meaning flsa_status
    FROM
    per_jobs_v pj,
    hr_leg_lookups hlc
    WHERE hlc.lookup_code(+)= pj.job_information3
    and hlc.lookup_type(+)='US_EXEMPT_NON_EXEMPT'
    Extended VO
    SELECT
    pj.job_id,
    pj.name job,
    pj.business_group_id,
    pj.date_from,
    pj.date_to,
    hlc.meaning flsa_status,
    pj.attribute3 xxatc_job_dff
    FROM
    per_jobs_v pj,
    hr_leg_lookups hlc
    WHERE hlc.lookup_code(+)= pj.job_information3
    and hlc.lookup_type(+)='US_EXEMPT_NON_EXEMPT'
    union
    SELECT
    pj.job_id,
    pj.attribute3 job,
    pj.business_group_id,
    pj.date_from,
    pj.date_to,
    hlc.meaning flsa_status,
    pj.attribute3 xxatc_job_dff
    FROM
    per_jobs_v pj,
    hr_leg_lookups hlc
    WHERE hlc.lookup_code(+)= pj.job_information3
    and hlc.lookup_type(+)='US_EXEMPT_NON_EXEMPT'
    and pj.attribute3 is not null

  • Why an "ORA-01006: bind variable does not exist" error when no dynamic SQL?

    Hi all,
    While running PL/SQL in SQL Developer 3.2.09, I got the following error after adding a section of code. Note that nothing I'm doing has anything to do with dynamic SQL (which is what 01006 is supposedly about).
    Error report:
    ORA-01006: bind variable does not exist
    01006. 00000 - "bind variable does not exist"
    *Cause:   
    *Action:
    After commenting out the new chunk of code that caused the error, the error persisted.
    After deleting the new code, the error went away.
    What the heck!?!? If you have any ideas, please lay 'em on me.
    Thanks so much,
    Kim
    P.S. It's a few hundred lines of code, so I didn't append it to this post and I don't see how to attach a file.

    Let's review a few facts:
    1. You post a question in the sql developer forum that has no apparent relation to sql developer. You could confirm this by doing the test using sql*plus or some other tool.
    2. You provide NO information about what database you are even using. The only clue is an ORA -xxx message that means SOME version of Oracle is involved.
    3. You provide NO information about what the four digit version of Oracle DB is being used.
    4. You provide NO information about what the code in general or what that specific section of the code is even doing. The code could be doing literally anything that Oracle is capable of doing.
    That's a bit like calling a mechanic you don't know, telling them your car is making a funny noise and asking them what the problem with your car is.
    >
    While running PL/SQL in SQL Developer 3.2.09, I got the following error after adding a section of code. Note that nothing I'm doing has anything to do with dynamic SQL (which is what 01006 is supposedly about).
    Error report:
    ORA-01006: bind variable does not exist
    01006. 00000 - "bind variable does not exist"
    *Cause:
    *Action:
    The error gives no indication of where the error occurred in the code.
    >
    Your first clue that your troubleshooting method is seriously flawed is when you make statements that aren't supported by any evidence at all but appear to be nothing but your opinion.
    Your second clue is when those statements appear to directly contradict what Oracle is telling you.
    I'm talking about these two statements you make; which you state as if they were universal truths
    >
    nothing I'm doing has anything to do with dynamic SQL
    (which is what 01006 is supposedly about).
    >
    If thoe were true then your 'unstated' conclusion appears to be that Oracle is wrong in saying 'bind variable does not exist'
    Sorry - but I would place my money on Oracle.
    I'm sure the above may sound harsh - it is intended to be. My four major rules (there are more) when troubleshooting Oracle problems.
    1. Assume that Oracle is CORRECT when it tells you there is a problem.
    2. Assume that you are WRONG if your opinion conflicts with what Oracle is telling you - see rule #1.
    3. Don't make ANY other assumptions. You can form hypotheses but don't state them as facts until they are proven.
    4. Your 'opinion' is only useful to the extent that it can help you form meaningful hypotheses - see rule #3.
    >
    To reiterate, there is no dynamic SQL in the code.
    >
    To reiterate - if, as you state, that error relates to dynamic SQL and bind variables then it can not be disputed that:
    ORACLE DOESN'T AGREE WITH YOU!
    So let's try it my way and hypothesize that Oracle is correct (see rule #1 above).
    Then by definition this statement by Oracle is correct
    >
    ORA-01006: bind variable does not exist
    >
    And that should immediately raise this question:
    1. where might there be a bind variable that does not exist?
    which leads to a prerequisite question:
    2. where are ALL of the bind variables that might be being used?
    Question #2 is where you need to start your search. Here are at least five possibilities (there are more)
    1. your code - this should be easiest to check and you state that your 'anonymous' block does not have any.
    2. a table trigger - triggers that use the :NEW, :OLD or :PARENT pseudocolumns. Those psuedocolumns are BIND variables and the trigger code that uses them is, by definition, dynamic sql.
    3. a pl/sql package/function/procedure - any of these might be being called from trigger code or a view that is involved in the transaction. Any of these could take a parameter and/or use bind variables and cause your problem if that bind variable does 'not exist'.
    4. a functional index - can also trigger code from #3 above
    5. an audit trigger that logs the audit activity that your user or your code is performing. This code could be trying to use a SYS_CONTEXT environment variable that has not been created and cause a 'bind variable does not exist' error.
    See rule #1 - Oracle is CORRECT. Until you have identified and examined ALL of the code (not just your anonymous block) being executed and ruled it out you should continue with the hypotheses that Oracle is CORRECT.
    In the (extremely) unlikely event that you can show that Oracle is NOT correct you should file a SOR with Oracle.

  • I am getting this error message "ORA-01006: bind variable does not exist.

    My code works fine like this:
    DECLARE
    v_JOBTYPE varchar2(8);
    v_STATUS varchar2(8);
    v_FAILURE varchar2(8);
    v_CAUSE varchar2(8);
    v_ACTION varchar2(8);
    BEGIN
    SELECT EVT_STATUS, EVT_FAILURE, EVT_CAUSE, EVT_ACTION, EVT_JOBTYPE
    INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, v_JOBTYPE
    FROM R5EVENTS WHERE ROWID = :ROWID;
    IF NVL(v_STATUS, 'X') = 'C' AND NVL(v_JOBTYPE , 'X') IN ('BRKD','UNPLBRKD','FILTRA', 'LUB', 'FAC') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
    RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
    END IF;
    END;
    But I want to change the code to include a record (ACT_TRADE) from another table(R5ACTIVITIES). I am getting this error message "ORA-01006: bind variable does not exist - POST-UPDATE 200Before Binding". Any help would be appreciated.
    DECLARE
    v_STATUS varchar2(8);
    v_FAILURE varchar2(8);
    v_CAUSE varchar2(8);
    v_ACTION varchar2(8);
    V_CODE varchar2(8);
    V_EVENT varchar2(8);
    V_TRADE varchar2(8);
    BEGIN
    SELECT R5EVENTS.EVT_STATUS, R5EVENTS.EVT_FAILURE, R5EVENTS.EVT_CAUSE, R5EVENTS.EVT_ACTION, R5EVENTS.EVT_CODE, R5ACTIVITIES.ACT_EVENT, R5ACTIVITIES.ACT_TRADE
    INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, V_CODE, V_EVENT, V_TRADE
    FROM R5EVENTS, R5ACTIVITIES WHERE V_CODE = :V_EVENT;
    IF NVL(v_STATUS, 'X') = 'C' AND NVL(v_TRADE , 'X') IN ('MTM','MTL','MTMGT', 'FTM', 'FTL', 'FTMGT', 'R5') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
    RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
    END IF;
    END;

    Thank you for your responses. Your feedback was helpful. This is what I ended up doing for a solution:
    DECLARE
    v_JOBTYPE varchar2(8);
    v_STATUS varchar2(8);
    v_FAILURE varchar2(8);
    v_CAUSE varchar2(8);
    v_ACTION varchar2(8);
    v_GROUP varchar2(30);
    BEGIN
    SELECT EVT_STATUS, EVT_FAILURE, EVT_CAUSE, EVT_ACTION, EVT_JOBTYPE, USR_GROUP
    INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, v_JOBTYPE, v_GROUP
    FROM R5EVENTS, R5USERS WHERE R5EVENTS.ROWID = :ROWID
    AND USR_CODE = O7SESS.CUR_USER;
    IF NVL(v_STATUS, 'X') = 'C' AND NVL(V_GROUP,'X') IN ('MTM','MTL','MTMGT','FTL','FTMGTS','PLANNER','DISPATCH','PMCOOR','R5') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
    RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
    END IF;
    END;

  • Update_Task results in ORA-01006: bind variable does not exist - bug?

    Hi,
    I have successfuly created projects/tasks, and updated projects. However, when I tried to call pa_project_pub.update_task, I get an error
    U(nexpected):
    PROCEDURE_NAME update_one_task
    PKG_NAME PA_PROJECT_PVT
    FND FND_AS_UNEXPECTED_ERROR
    ERROR_TEXT ORA-01006: bind variable does not exist
    As far as I can see, this must be a bug, because the API must have created an excecute immediate/dbms_sql statement with at least one extra bind variable (i.e. execute '... :a, :b' using a, b, c)
    I've tried with different combinations of arguments to the API, all resulting in the same error:
    The id's and data are taken from a an already created project/task in my apps-instance:
    pa_project_pub.update_task(
    p_api_version_number => 1.0
    ,p_commit => xxpa_opop2pa_interface_utils.g_FALSE
    ,p_msg_count => l_msg_count
    ,p_msg_data => l_msg_data
    ,p_return_status => l_return_status
    ,p_pm_product_code => l_pm_product_code
    ,p_pm_project_reference => '100394'
    ,p_pm_task_reference => 'add_task_1.0'
    -- ,p_ref_task_id => ''
    ,p_task_number => 4
    -- ,p_pa_task_id => '19079'
    ,p_task_name => 'add_task_1.0'
    ,p_long_task_name => 'p_task_name'
    ,p_task_start_date => p_start_date
    ,p_task_completion_date => p_completion_date
    ,p_task_description => 'update-task:'||p_description
    ,p_out_pm_task_reference => l_out_pm_task_reference
    ,p_out_pa_task_id => p_task_id_out
    Am I missing anything, or this really must be a bug in the API?
    Does anyone have any other idea?
    I have looked at the API implementation, and found a use of dbms_sql, a long code constructing a statement then binding variables in if-then clauses.
    Regards,
    ps: ->
    system info
    Database Server
    RDBMS : 11.1.0.6.0
    Oracle Applications : 12.0.6
    System Date : 11-MAY-2009 10:41:50
    Forms Server
    Current Form
    Form Application : Application Object Library
    Form Name : FNDPOMPO
    Form Version : 12.0.2
    Form Last Modified : $Date: 2006/03/23 13:54 $
    Forms
    APPSTAND : 12.0.6.12000000.3
    FNDPOMPO : 12.0.2
    FNDSCSGN : 12.0.14.12000000.3
    Form Menus
    FNDMENU : 12.0.2
    Forms PL/SQL
    APPCORE : 12.0.21.12000000.13
    CUSTOM : 12.0.0
    FNDSQF : 12.0.3
    GHR : 12.0.22.12000000.26
    GLOBE : 12.0.62.12000000.13
    GMS : 12.0.42.12000000.11
    IGILUTIL2 : 12.0.24.12000000.3
    IGILUTIL : 12.0.1.12000000.3
    OPM : 12.0.7.12000000.2
    PQH_GEN : 12.0.7
    PSA : 12.0.17
    PSAC : 12.0.4.12000000.2
    PSB : 12.0.2
    VERT1 : 12.0.0
    VERT2 : 12.0.0
    VERT3 : 12.0.0
    VERT4 : 12.0.0
    VERT5 : 12.0.0
    VERT : 12.0.0
    **********************

    Hello,
    This issue is fixed in the bug 4692368. So you can get a patch from Oracle.
    Hope this helps !
    Thanks,
    Sathish
    www.projectsaccounting.com

  • Java.sql.SQLException: ORA-01006: bind variable does not exist

    The java code is given below...
    /*UPDATE D9T652_DISBRSMNT_PRMTR
                        SET
                             Stmnt_Page_Wgt_Ozs = wtStatementStockSheet,
                        Chk_Page_Wgt_Ozs = wtCheckStockSheet,
                        Flat_Envelope_Wgt_Ozs = wtFlatEnv,
                        Half_Fold_Envelope_Wgt_Ozs = wtHalfFoldEnv,
                        Last_Chngd_By = TRIM(userId),
                        Last_Chngd_Dt = sysdate
                        WHERE
                             Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass AND
                             Last_Chngd_Dt = SELECT MAX(Last_Chngd_Dt)
              FROM D9T652_DISBRSMNT_PRMTR
              WHERE Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass
    updateDbPmtr= new StringBuffer(" UPDATE ")
    .append(SqlConst.PARAM)
    .append(" SET ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_DSBRSMNT_PRMTR_ID).append(" = 100, ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_MIN_DSBRSMNT_AMT).append(" = ? ").append(",")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_OVRRD_MIN_DSBRSMNT_DT).append(" = ").append(currentTimeStamp).append(",")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_SPCL_HNDLG_AMT).append(" = ? ").append(", ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_STMNT_DT).append(" = ").append(currentTimeStamp).append(" , ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_LAST_CHNGD_BY).append(" ='?' ").append(" , ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_LAST_CHNGD_DT).append(" = ").append(currentTimeStamp)
    .append(" WHERE ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_INS_SYS_ID).append(" = ? ")
    .append(" AND ")
    .append(SqlConst.PARAM).append(".").append(SqlConst.PARAM_LAST_CHNGD_DT)
    .append(" = ")
    .append(" ( SELECT ")
    .append(" MAX( ").append(SqlConst.PARAM_LAST_CHNGD_DT).append(" ) ")
    .append(" FROM ").append(SqlConst.PARAM)
    .append(" WHERE ")
    .append(SqlConst.PARAM_INS_SYS_ID).append(" = ? )").toString();
    conn = SqlUtil.getConnection();
    conn.setAutoCommit(false);     
    prepStmtDsbrsmntPmtr = conn.prepareStatement(updateDbPmtr);                     
    prepStmtStckWght      = conn.prepareStatement(updateStkWght);
                        String minDsbrsmntAmount     = parametersListForm.getParametersForm().getMinDisbursementAmt();
                        String specialHndlAmount     = parametersListForm.getParametersForm().getSpecialHandlingAmt();
                        String statementDt               = parametersListForm.getParametersForm().getStatementDate();
                        String overrideCycleDt          = parametersListForm.getParametersForm().getOverrideCycleDate();
                        String lastMdfdBy               = parametersListForm.getParametersForm().getLastModifiedBy();
                        String lastMdfdDt               = parametersListForm.getParametersForm().getLastModifiedDate();
                        String wtStmtStkSheet          = parametersListForm.getParametersForm().getWtStatementStockSheet();
                        String wtHlfFoldEnvelope     = parametersListForm.getParametersForm().getWtHalfFoldEnv();
                        String wtFltEnvelope          = parametersListForm.getParametersForm().getWtFlatEnv();
                        String wtChkStkSheet          = parametersListForm.getParametersForm().getWtCheckStockSheet();
    prepStmtDsbrsmntPmtr.setLong(1,Integer.parseInt(minDsbrsmntAmount));
    prepStmtDsbrsmntPmtr.setLong(2, Long.parseLong(specialHndlAmount));
    prepStmtDsbrsmntPmtr.setString(3,lastMdfdBy);
    prepStmtDsbrsmntPmtr.setLong(4,1);
    prepStmtDsbrsmntPmtr.setLong(5,1);
    int rUpdtInParam = prepStmtDsbrsmntPmtr.executeUpdate();
    ========================================================================
    I am getting following errors...
    [8/6/04 19:17:14:286 GMT+05:30] 19192340 SystemErr R java.sql.SQLException: ORA-01006: bind variable does not exist
    [8/6/04 19:17:14:302 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:314)
    [8/6/04 19:17:14:317 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:117)
    [8/6/04 19:17:14:349 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:306)
    [8/6/04 19:17:14:364 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:43)
    [8/6/04 19:17:14:380 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:41)
    [8/6/04 19:17:14:411 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:941)
    [8/6/04 19:17:14:427 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:662)
    [8/6/04 19:17:14:442 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:214)
    [8/6/04 19:17:14:474 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:135)
    [8/6/04 19:17:14:489 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:227)
    [8/6/04 19:17:14:505 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:72)
    [8/6/04 19:17:14:536 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:190)
    [8/6/04 19:17:14:552 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:406)
    [8/6/04 19:17:14:567 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:57)
    [8/6/04 19:17:14:583 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:461)
    [8/6/04 19:17:14:614 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:630 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:661 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:57)
    [8/6/04 19:17:14:677 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:461)
    [8/6/04 19:17:14:692 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:708 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:739 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:755 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:770 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:802 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:817 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:414)
    [8/6/04 19:17:14:833 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    [8/6/04 19:17:14:864 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:190)
    [8/6/04 19:17:14:880 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:406)
    [8/6/04 19:17:14:896 GMT+05:30] 19192340 SystemErr R      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:614)
    ========================================================================
    Database Table:-
    Desc D9T651_DSBRSMNT_PRMTR:
    Name Null? Type
    DSBRSMNT_PRMTR_ID NOT NULL NUMBER(38)
    INS_SYS_ID NUMBER(38)
    MIN_DSBRSMNT_AMT NUMBER(15,2)
    OVRRD_MIN_DSBRSMNT_DT DATE
    SPCL_HNDLG_AMT NUMBER(15,2)
    STMNT_DT DATE
    CRTD_BY VARCHAR2(30)
    CRTD_DT DATE
    LAST_CHNGD_BY VARCHAR2(30)
    LAST_CHNGD_DT DATE

    What exactly are you trying to do? If you're trying to run an update statement, it's simpler if you do this:
    PreparedStatement pstmt = null;
    Connection conn = ?????;
    String updateStr = "UPDATE D9T652_DISBRSMNT_PRMTR " +
    "SET " +
    "Stmnt_Page_Wgt_Ozs = ?, " +
    "Chk_Page_Wgt_Ozs = ?, " +
    "Flat_Envelope_Wgt_Ozs = ?, " +
    "Half_Fold_Envelope_Wgt_Ozs = ?, " +
    "Last_Chngd_By = TRIM(?), " +
    "Last_Chngd_Dt = ? " +
    "WHERE " +
    "Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass AND " +
    "Last_Chngd_Dt = (SELECT MAX(Last_Chngd_Dt) " +
    "FROM D9T652_DISBRSMNT_PRMTR " +
    "WHERE Ins_Sys_Id = Ins_Sys_Id_Constant_For_Compass) "
    From the String constructed above, the first ? mark will be bind to 1, second to 2..... etc and you can set the appropriate types.
    pstmt = conn.prepareStatement(updateStr);
    pstmt.setString(1, request.getParameter("formValue1")); // this is assuming you want to store string value in DB field
    pstmt.setInt(2, Integer.parseInt(request.getParameter("formValue2"))); // this is assuming you want to store int value in DB field
    pstmt.setTimestamp(3, new java.sql.Timestamp(new java.util.Date().getTime())); // this is assuming you want to store current time in DB Date field
    ..... etc
    ..... etc
    ...... etc
    int rows = pstmt.executeUpdate();
    Hope this helps!!

  • ORA-01006:bind variable does not exist for the QUERY

    Dear All,
    Please help on below query :
    DECLARE
    P_ROTATION_NO GCH_VSL_REGN.ROTATION_NO%TYPE :=21;
    P_VESL_NO GCH_VSL_MASTER.VESL_NO%TYPE := NULL;
    P_VESL_NAME GCH_VSL_MASTER.VESL_NAME%TYPE:= NULL;
    P_FROM_REG_DATE GCH_VSL_MASTER.CREATED_DATE%TYPE:= NULL;
    P_TO_REG_DATE GCH_VSL_MASTER.CREATED_DATE%TYPE:= NULL;
    P_FROM_ARRIVAL_DATE GCH_VSL_REGN.ARRIVAL_DATE%TYPE:= NULL;
    P_TO_ARRIVAL_DATE GCH_VSL_REGN.ARRIVAL_DATE%TYPE:= NULL;
    P_CLOSE_TYPE GCH_VSL_CLOSE_DTLS.CLOSE_TYPE%TYPE:= NULL;
    P_RESULT_LIST SYS_REFCURSOR;
    P_TOTAL_LENGTH NUMBER;
    P_ERROR_MESSAGE VARCHAR2(1000);
    lv_sql1 VARCHAR2(5000);
    lv_sql2 VARCHAR2(5000);
    lv_whereClause VARCHAR2(5000);
    pv_text VARCHAR2(1000);
    BEGIN
    pv_text := NULL;
    lv_whereClause := ' WHERE GVM.VESL_MASTER_NUM = GVR.VESL_MASTER_NUM
    AND GVR.ROTATION_NO = GVCH.ROTATION_NO
    AND GVCH.CLOSE_HDR_ID = GVCD.CLOSE_HDR_ID(+)
    AND (:P_ROTATION_NO IS NULL OR
    (:P_ROTATION_NO IS NOT NULL AND
    GVR.ROTATION_NO LIKE % :P_ROTATION_NO %))
    AND GVM.IS_VALID = 1';
    lv_sql1 := 'SELECT COUNT(gvr.rotation_no)
    FROM gch_vsl_close_hdr gvch,
    gch_vsl_master gvm,
    gch_vsl_regn gvr,
    gch_vsl_close_dtls gvcd'||lv_whereClause;
    dbms_output.put_line (lv_sql1);
    EXECUTE IMMEDIATE lv_sql1 INTO :P_TOTAL_LENGTH
    USING P_ROTATION_NO;
    END;
    I am getting below error when running the above query
    ORA-01006:     bind variable does not exist

    why (date datatype assumed for variables with names containing DATE)
    PROCEDURE XVY(P_ROTATION_NO IN GCH_VSL_REGN.ROTATION_NO%TYPE,
                  P_VESL_NO IN GCH_VSL_MASTER.VESL_NO%TYPE,
                  P_VESL_NAME IN GCH_VSL_MASTER.VESL_NAME%TYPE,
                  P_CM_REGN_NO IN GCH_VSL_REGN.CM_REGN_NO%TYPE,
                  P_FINAL_CLOSE_STA IN GCH_VSL_CLOSE_HDR.FINAL_CLOSE_STA%TYPE,
                  P_FROM_REG_DATE IN GCH_VSL_MASTER.Created_Date%TYPE,
                  P_TO_REG_DATE IN GCH_VSL_MASTER.CREATED_DATE%TYPE,
                  P_FROM_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_TO_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_RESULT_LIST OUT SYS_REFCURSOR,
                  P_TOTAL_LENGTH OUT NUMBER,
                  P_ERROR_MESSAGE OUT VARCHAR2
                 ) AS
      lv_sql1        VARCHAR2(4000);
      lv_sql2        VARCHAR2(4000);
      lv_whereClause VARCHAR2(4000);
    BEGIN
    --  pv_text := NULL;
      lv_whereClause := ' WHERE gvm.vesl_master_num = gvr.vesl_master_num '||
                          ' AND GVR.ROTATION_NO(+) = GVCH.ROTATION_NO '||
                          ' AND (:P_ROTATION_NO IS NULL '||
                          '  OR  (:P_ROTATION_NO IS NOT NULL '||
                          ' AND   gvch.rotation_no LIKE ''%'' || :P_ROTATION_NO || ''%'' ' ||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_CM_REGN_NO IS NULL '||
                          '  OR  (:P_CM_REGN_NO IS NOT NULL '||
                          ' AND   gvr.cm_regn_no LIKE ''%'' || :P_CM_REGN_NO || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_VESL_NAME IS NULL '||
                          '  OR  (:P_VESL_NAME IS NOT NULL '||
                          ' AND   gvm.vesl_name LIKE ''%'' || :P_VESL_NAME || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_VESL_NO IS NULL '||
                          '  OR  (:P_VESL_NO IS NOT NULL '||
                          ' AND   GVM.vesl_no LIKE ''%'' || :P_VESL_NO || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_FINAL_CLOSE_STA IS NULL '||
                          '  OR  (:P_FINAL_CLOSE_STA IS NOT NULL '||
                          ' AND   gvch.imp_close_sta LIKE ''%'' || :P_FINAL_CLOSE_STA || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_FROM_REG_DATE IS NULL '||
                          '  OR  (:P_FROM_REG_DATE IS NOT NULL '||
                          ' AND   gvch.created_date >= :P_FROM_REG_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_TO_REG_DATE IS NULL '||
                          '  OR  (:P_TO_REG_DATE IS NOT NULL '||
                          ' AND   gvch.created_date <= :P_TO_REG_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_FROM_ARRIVAL_DATE IS NULL '||
                          '  OR  (:P_FROM_ARRIVAL_DATE IS NOT NULL '||
                          ' AND   gvch.arrival_date >= :P_P_FROM_ARRIVAL_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_TO_ARRIVAL_DATE IS NULL '||
                          '  OR  (:P_TO_ARRIVAL_DATE IS NOT NULL '||
                          ' AND   gvch.arrival_date <= :P_TO_ARRIVAL_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND gvm.is_valid = 10 ';
      lv_sql1 := 'SELECT COUNT(gvr.rotation_no) '||
                 '  FROM xvz gvch, '||
                 '       zxsc gvm, '||
                 '       dsae gvr, '||
                 '       vvsd gvcd '|| lv_whereClause;
      lv_sql2 := ' SELECT gvch.close_hdr_id, '||
                 '        gvch.rotation_no, '||
                 '        gvr.cm_regn_no, '||
                 '        gvm.vesl_no, '||
                 '        gvm.vesl_name, '||
                 '        gvch.final_close_sta, '||
                 '        gvr.arrival_date, '||
                 '        gvch.close_date, '||
                 '        gvr.created_date '||
                 '   FROM xvz gvch, '||
                 '        zxsc gvm, '||
                 '        dsze gvr '|| lv_whereClause || 'ORDER BY gvch.rotation_no';
      EXECUTE IMMEDIATE lv_sql1 INTO P_TOTAL_LENGTH
                  USING P_ROTATION_NO,P_ROTATION_NO,P_ROTATION_NO,
                        P_CM_REGN_NO,P_CM_REGN_NO,P_CM_REGN_NO,
                        P_VESL_NAME,P_VESL_NAME,P_VESL_NAME,
                        P_VESL_NO,P_VESL_NO,P_VESL_NO,
                        P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,
                        P_FROM_REG_DATE,P_FROM_REG_DATE,P_FROM_REG_DATE,
                        P_TO_REG_DATE,P_TO_REG_DATE,P_TO_REG_DATE,
                        P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,
                        P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE;
      OPEN P_RESULT_LIST
       FOR lv_sql2 USING P_ROTATION_NO,P_ROTATION_NO,P_ROTATION_NO,
                         P_CM_REGN_NO,P_CM_REGN_NO,P_CM_REGN_NO,
                         P_VESL_NAME,P_VESL_NAME,P_VESL_NAME,
                         P_VESL_NO,P_VESL_NO,P_VESL_NO,
                         P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,
                         P_FROM_REG_DATE,P_FROM_REG_DATE,P_FROM_REG_DATE,
                         P_TO_REG_DATE,P_TO_REG_DATE,P_TO_REG_DATE,
                         P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,
                         P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE;
    END;instead of (the where clauses should be equivalent)
    PROCEDURE XVY(P_ROTATION_NO IN GCH_VSL_REGN.ROTATION_NO%TYPE,
                  P_VESL_NO IN GCH_VSL_MASTER.VESL_NO%TYPE,
                  P_VESL_NAME IN GCH_VSL_MASTER.VESL_NAME%TYPE,
                  P_CM_REGN_NO IN GCH_VSL_REGN.CM_REGN_NO%TYPE,
                  P_FINAL_CLOSE_STA IN GCH_VSL_CLOSE_HDR.FINAL_CLOSE_STA%TYPE,
                  P_FROM_REG_DATE IN GCH_VSL_MASTER.Created_Date%TYPE,
                  P_TO_REG_DATE IN GCH_VSL_MASTER.CREATED_DATE%TYPE,
                  P_FROM_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_TO_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_RESULT_LIST OUT SYS_REFCURSOR,
                  P_TOTAL_LENGTH OUT NUMBER,
                  P_ERROR_MESSAGE OUT VARCHAR2
                 ) AS
      lv_sql1        VARCHAR2(4000);
      lv_sql2        VARCHAR2(4000);
      lv_whereClause VARCHAR2(4000);
    BEGIN
      SELECT COUNT(gvr.rotation_no)
        INTO P_TOTAL_LENGTH
        FROM xvz gvch,
             zxsc gvm,
             dsae gvr,
             vvsd gvcd
       WHERE gvm.vesl_master_num = gvr.vesl_master_num
         AND GVR.ROTATION_NO(+) = GVCH.ROTATION_NO
         AND (P_ROTATION_NO IS NULL
          OR  (P_ROTATION_NO IS NOT NULL
         AND   gvch.rotation_no LIKE '%' || P_ROTATION_NO || '%'
         AND (P_CM_REGN_NO IS NULL
          OR  (P_CM_REGN_NO IS NOT NULL
         AND   gvr.cm_regn_no LIKE '%' || P_CM_REGN_NO || '%'
         AND (P_VESL_NAME IS NULL
          OR  (P_VESL_NAME IS NOT NULL
         AND   gvm.vesl_name LIKE '%' || P_VESL_NAME || '%'
         AND (P_VESL_NO IS NULL
          OR  (P_VESL_NO IS NOT NULL
         AND   GVM.vesl_no LIKE '%' || P_VESL_NO || '%'
         AND (P_FINAL_CLOSE_STA IS NULL
          OR  (P_FINAL_CLOSE_STA IS NOT NULL
         AND   gvch.imp_close_sta LIKE '%' || P_FINAL_CLOSE_STA || '%'
         AND (P_FROM_REG_DATE IS NULL
          OR  (P_FROM_REG_DATE IS NOT NULL
         AND   gvch.created_date >= P_FROM_REG_DATE
         AND (P_TO_REG_DATE IS NULL
          OR  (P_TO_REG_DATE IS NOT NULL
         AND   gvch.created_date <= P_TO_REG_DATE
         AND (P_FROM_ARRIVAL_DATE IS NULL
          OR  (P_FROM_ARRIVAL_DATE IS NOT NULL
         AND   gvch.arrival_date >= P_P_FROM_ARRIVAL_DATE
         AND (P_TO_ARRIVAL_DATE IS NULL
          OR  (P_TO_ARRIVAL_DATE IS NOT NULL
         AND   gvch.arrival_date <= P_TO_ARRIVAL_DATE
         AND gvm.is_valid = 10;
      OPEN P_RESULT_LIST
       FOR SELECT gvch.close_hdr_id, 
                  gvch.rotation_no, 
                  gvr.cm_regn_no, 
                  gvm.vesl_no, 
                  gvm.vesl_name, 
                  gvch.final_close_sta, 
                  gvr.arrival_date, 
                  gvch.close_date, 
                  gvr.created_date 
             FROM xvz gvch, 
                  zxsc gvm, 
                  dsze gvr
            WHERE gvm.vesl_master_num = gvr.vesl_master_num
              AND GVR.ROTATION_NO(+) = GVCH.ROTATION_NO
              AND gvch.rotation_no LIKE '%' || nvl(P_ROTATION_NO,gvch.rotation_no) || '%'
              AND gvr.cm_regn_no LIKE '%' || nvl(P_CM_REGN_NO,gvr.cm_regn_no) || '%'
              AND gvm.vesl_name LIKE '%' || nvl(P_VESL_NAME,gvm.vesl_name) || '%'
              AND gvm.vesl_no LIKE '%' || nvl(P_VESL_NO,gvm.vesl_no) || '%'
              AND gvch.imp_close_sta LIKE '%' || nvl(P_FINAL_CLOSE_STA,gvch.imp_close_sta) || '%'
              AND gvch.created_date BETWEEN nvl(P_FROM_REG_DATE,gvch.created_date) AND nvl(P_TO_REG_DATE,gvch.created_date)
              AND gvch.arrival_date BETWEEN nvl(P_FROM_ARRIVAL_DATE,gvch.arrival_date) AND nvl(P_TO_ARRIVAL_DATE,gvch.arrival_date)
              AND gvm.is_valid = 10;
            ORDER BY gvch.rotation_no;
    END;Regards
    Etbin
    Edited by: Etbin on 8.4.2012 14:37
    In order not to waste your time in the future:
    Don't execute dynamic SQL until it works !!!
    Write out what you managed to put together using dbms_output.
    Paste that into the SQL window of your client tool (SQL Developer ...)
    Convert parameters to bind variables (replace p_ with :p_)
    Try to run it.
    If errors are thrown correct them, adjust the procedure/function set up to write your dynamic SQL accordingly
    Repeat the cycle until no errors are thrown
    Comment out the dbms_output. ... line
    Uncomment the execute immediate ... line

  • ORA-01006: bind variable does not exist

    Plz, if any body is able to handle this tell me the solution
    SELECT job_ticket_mst.N_LINENUMB, job_ticket_mst.V_CVDPL_NO, JOB_TICKET_MST.V_STAMP,Common_mst.V_DESCRIPTION, JOB_TICKET_MST.D_JOB_DATE, JOB_TICKET_MST.V_JOB_TYPE_CODE, JOB_TICKET_MST.V_CUSTOMER_CODE,CUSTOMER_MST.V_CUST_THREAD_GROUP, CUSTOMER_MST.V_NAME, JOB_TICKET_MST.V_CATEGORY, JOB_TICKET_MST.N_PRIORITY,V_STATUS, JOB_TICKET_MST.D_MAX_RET_PERIOD, JOB_TICKET_MST.D_UPLOAD_DATE, JOB_TICKET_MST.N_TURN_TIME, JOB_TICKET_MST.V_CREATED_BY, JOB_TICKET_MST.D_CREATED_DATE, JOB_TICKET_MST.D_SERVER_IN, JOB_TICKET_MST.D_CUSTOMER_DUE, JOB_TICKET_MST.D_PROMISE , JOB_TICKET_DTL.V_BORDER_SR_NO, JOB_TICKET_MST.D_PROB_OUT_TIME PROB_OUT_TIME, JOB_TICKET_MST.D_OLD_MAX_RET_PERIOD, JOB_TICKET_DTL.V_ART_QUALITY,CMM1.V_DESCRIPTION LEVEL1, JOB_TICKET_DTL.V_DESIGN, JOB_TICKET_DTL.V_CUST_REF_NO,JOB_TICKET_DTL.V_PO_NUMBER, JOB_TICKET_DTL.V_GAR_COLOR, JOB_TICKET_DTL.V_FILE_FORMAT, JOB_TICKET_DTL.V_CUST_COMMENT, JOB_TICKET_DTL.V_CVDPL_COMMENT, JOB_TICKET_DTL.V_EDIT_COMMENT, JOB_PROBLEM.V_PROBLEM_DESC, JOB_PROBLEM.V_PROBLEM_SOL,(TimeDiff (sysDate,D_SERVER_IN)/24) dtDiff FROM JOB_TICKET_MST, CUSTOMER_MST, JOB_TICKET_DTL,common_mst, JOB_PROBLEM,Common_mst CMM1 Where upper(JOB_TICKET_MST.V_CVDPL_NO) like 'EM060904419%' AND JOB_TICKET_MST.V_CVDPL_NO = JOB_PROBLEM.V_CVDPL_NO(+) and JOB_TICKET_MST.N_LINENUMB = JOB_PROBLEM.N_LINENUMB(+) and JOB_TICKET_MST.V_CVDPL_NO = JOB_TICKET_DTL.V_CVDPL_NO and JOB_TICKET_MST.V_STAMP=common_mst.V_CODE AND customer_mst.V_CODE = V_CUSTOMER_CODE AND CMM1.V_CODE(+)=JOB_TICKET_DTL.V_ART_QUALITY this is my query in log file it gives me required answer but when jsp page is accessed it gives me null pointer exception and bind varible does not exist is occurs in log file of tomcat ...whts wrong in query???

    Nothing strange jumps out.
    In general, a bind variable is one that's resolved within the SQL statement at runtime by "?" or ":var" parameters.
    Eg.
    "select * from customer where id = ?"
    That would have 1 bind variable.
    It would also need to be run with a PreparedStatement, eg.
        PreparedStatement ps = connection.prepareStatement("select * from customer where id = ?");
       int custId = 12345;
       ps.setInt ( 1, custId );
       ResultSet rs = ps.execute();Can you run your SQL statement as it is, in Toad, DB Visualiser, or any other oracle client software. Just to prove it works ?
    Ps. since this is a db specific question, it would've made more sense to post in the JDBC section.
    regards,
    Owen

  • ORA-01006: bind variable does not exist Error

    Hi All
    I am trying to dynamically call a stored proc using the syntax:
    plsql_block := 'BEGIN PKG_TEST.SP_GET_USERDETAILS(a, :b, :c); END;';
    EXECUTE IMMEDIATE plsql_block USING OUT lt_metadatasummary, pv_acctnum, pv_reportdate;
    But I am getting an ORA-01006 exception and I do not understand what its means exactly.
    Here pv_acctnum is of type VARCHAR2(30)
    pv_reporttype of type VARCHAR2(30)
    and
    lt_metadatasummary of type CVIM_REPORT_METADATASUMMARY_TB
    My called Procedure defintion looks like:
    PROCEDURE SP_GET_USERDETAILS
    pt_metadatasummary OUT CVIM_REPORT_METADATASUMMARY_TB
    , pv_acctnum IN VARCHAR2
    , pv_reportdate IN VARCHAR2
    -- CVIM_REPORT_METADATASUMMARY_TB is my custom table type

    yes. you may write for IN variables as following with concatenation. but for OUT variables there is no other option(s):
    plsql_block := 'BEGIN PKG_TEST.SP_GET_USERDETAILS(:a, '' '|| b ||' '', '' '|| c ||' ''); END;';ps. but it is recommended use BİND variables - for increase performance of repeated calls and for accurately use.

  • When  do we get ORA-01006 bind variable does not exist

    I am updating data base taking data from client to data base through a session bean. The data is being updated but this error message is also coming.what could be the reason.

    I had the same error and was using the incorrect number of parameters for my prepared statement. I had too many. Could it be that you are using the wrong prepared statement?

  • Bind variable does not exist after processFormRequest

    Hello. I recieve the following stacktrace after doing a forward page immediately:
    pageContext.forwardImmediately("CAOADownload.jsp?transactionid=" + pageContext.getTransactionId() + "&retainAM=N",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    false,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    java.sql.SQLException: ORA-01006: bind variable does not exist
    The error is happening because of this line in the where clause:
    WHERE (PO_LINE_ID = :1)
    After the page forward it obviously looses what PO_LINE_ID contained. Is there a way to completely load the page from the JSP? Or a way to reload the VO in the processFormAction?
    Thanks, Graeme.

    Graeme.,
    Y don't u pass a page parameter say XXX with the value of line id when you redirect to same page? In that case u can execute query of the VO with the value of XXX, in process request, when u redirect to same page.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error: Bind Variable Does not Exist

    Hello,
    I am getting a bind error, Although I have only one bind variable, the debug output shows three bind parameters exist. Please let me know why this happens ?
    04/08/11 17:02:50 [5341] SELECT Property.PID, Property.CID, Property.REO, Property.MLS, Property.ADDRESS, Property.CITY, Property.STATE, Property.ZIP, Property.FAX, Property.TEL, Property.STYLE, Property.NROOMS, Property.NBEDS, Property.NBATHS, Property.SQFT, Property.AGE, Property.LPRICE, Property.LDATE, Property.EXPDATE, Property.FCDATE, Property.REDEMPTIONDATE, Property.MORTGAUGER, Property.FNAME, Property.FID, Property.BPOVALUE, Property.BPODATE, Property.WDATE, Property.TRASHOUT, Property.LAWNCARE, Property.REKEYED, Property.VACANCYSTATUS, Property.LOCKBOX, Property.PROPSTATUS, Property.LAGENT, Property.ENTRY, Property.USERID, Property.CONTACTID, Property.TAXID, Property.COBORR, Property.BORCONTACT FROM PROPERTY Property WHERE (Property.USERID = :1)
    04/08/11 17:02:50 [5342] Bind params for ViewObject: PropertyView1
    04/08/11 17:02:50 [5343] Binding param 1: 10097
    04/08/11 17:02:50 [5344] Binding param 2: 10097
    04/08/11 17:02:50 [5345] Binding param 3: 10097
    04/08/11 17:02:50 [5346] ViewObject: PropertyView1 close single-use prepared statements
    04/08/11 17:02:50 [5347] QueryCollection.executeQuery failed...
    04/08/11 17:02:50 [5348] java.sql.SQLException: ORA-01006: bind variable does not exist

    setWhereClauseParams must have been called on this VO to set more than required number of parameters. Could you check for that possibility?

  • Bind variable does not exist...

    Hi,
    I have an Access UI which is calling an Oracle package. The package has a simple command:
    INSERT INTO Table1 SELECT * from Table2
    The above query runs fine in Oracle directly, but when I run it through the package, I get the error "Bind variable does not exist". What does that mean? The query does not have any parameters. Similar queries running thgough the package that insert into other tables work fine.
    Something with structure of Table2 (this is a new table)?
    Thanks.
    Edited by: markk2 on Jan 12, 2009 9:59 PM
    Edited by: markk2 on Jan 12, 2009 10:10 PM

    I am not sure what's package you were talking about. Is it a package designed in Access?
    Access to Oracle is using ODBC, some of the SQL syntax specific to Oracle may not work. You might also check how table1 and table2 defined in Access. Are they all linked Oracle tables or one of them is Access table?
    Do you have any Oracle error message like ORA-xxxx ?

  • Bind variable does not exist error

    Guys,
    I have the following function in one of my packages.
    FUNCTION "UPDATE_SITE_TEMPLATE"
    INROW MYTABLE%ROWTYPE,
    blah VARCHAR2
    ) RETURN MYTABLE%ROWTYPE AS
    AROW MYTABLE%ROWTYPE;
    BEGIN
    AROW := GET_MYTABLE(INROW, blah);
    STMT := 'UPDATE TABLE1 SET ';
    IF (AROW.field1 IS NOT NULL OR AROW.field1 <> 0) THEN
    STMT := STMT || 'field1 =:P1 ';
    END IF;
    IF (AROW.field2 IS NOT NULL OR AROW.field2 <> 0) THEN
    STMT := STMT || ', field2 =:P2 ';
    END IF;
    IF (AROW.field3 IS NOT NULL OR field3.SIDE <> 0) THEN
    STMT := STMT || ', field3 =:P3 ';
    END IF;
    IF (AROW.field4 IS NOT NULL OR AROW.field4 <> 0) THEN
    STMT := STMT || ', field4 =:P4 ';
    END IF;
    STMT := STMT || ' WHERE field5 =:P5 ';
    IF (SUBSTR(STMT, 19,1)=',') THEN
    STMT := SUBSTR(STMT, 1, 18) || SUBSTR(STMT, 19);
    END IF;
    EXECUTE IMMEDIATE STMT USING AROW.field1, AROW.field2,
    AROW.field3, ARow.field4,
    Arow.field5;
    RETURN AROW;
    END;
    what i am trying to do here is... exclude the field from the update query if it is null, but i am getting the above error. What am I doing wrong here.
    Any suggestions...thanks

    Not sure what you are trying to do here
    yes it is wrong, if you have only two IF conditions satisfied so your statement will have only two bind variable :P1 and :P2 and in execute immediate you are giving all five variable for :p1 to :p5 so that it donen't find the bind variables. you can take out bind varible and use the variable values ther it self.
    can you explain what you are trying to do.
    Message was edited by:
    devmiral

  • JBO-27122:SQL error during statement preparation + ORA-01006:bind variable not exists

    (1) I have built a BC4J View called CallFunctionView which acts as a view i used to call existing PL/SQL functions. My implementation servlet code is presented with the following structure:
    public class MyServlet extends HttpServlet {
    // Get vector element to perform validation for rule 1 and rule 2
    for (int i = 0; i < MyVector.size(); i++) {
    MyVectorRow MyRow = (MyVectorRow) MyVector.elementAt(i);
    MyRow.checkRule1(am, i);
    MyRow.checkRule2(am, i);
    (2) Both checkRule1 and checkRule2 will call the ViewObject CallFunctionView. Related codes for checkRule1 and checkRule2 are listed as follows:
    public void checkRule1(ApplicationModule am, int intRowIndex)
    throws JboException, Exception {
    ViewCdCallFunctionImpl vo = (CallFunctionViewImpl) am.findViewObject("CallFunctionView");
    if (vo == null) {             
    throw new JboException("View Object is null!");
    vo.setQuery("SELECT PKG1.MyFunctionOne(?,?,?,?) FROM DUAL");
    vo.setWhereClauseParam(0, param1); // param1 is string
    vo.setWhereClauseParam(1, param2); // param2 is string
    vo.setWhereClauseParam(2, param3); // param3 is String.valueOf(int)
    vo.setWhereClauseParam(3, param4)); // param4 is String.value Of(int)
    vo.executeQuery(); <- Point of exit where my mentioned error occurs at the second loop
    public void checkRule2(ApplicationModule am, int intRowIndex)
    throws JboException, Exception {
    ViewCdCallFunctionImpl vo = (CallFunctionViewImpl) am.findViewObject("CallFunctionView");
    if (vo == null) {             
    throw new JboException("View Object is null!");
    vo.setQuery("SELECT PKG2.MyFunctionTwo(?,?,?,?) FROM DUAL");
    vo.setWhereClauseParam(0, param1); // param1 is string
    vo.setWhereClauseParam(1, param2); // param2 is string
    vo.setWhereClauseParam(2, param3); // param3 is String.valueOf(int)
    vo.setWhereClauseParam(3, param4)); // param3 is String.valueOf(int)
    vo.setWhereClauseParam(4, (blnYes)?"Y":null);
    vo.setWhereClauseParam(5, (blnYes)?"Y":null));
    vo.executeQuery();
    (3)The called functions are from different package and with different parameters. For the loop i = 0, no error occurs and both functions generates expected result. For execution of the first function in the second loop (when i = 1), error occurs with the following messages(JBO-27122: SQL error during statement preparation. + java.sql.SQLException: ORA-01006: bind variable does not exist):
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT PKG1.MyFunctionOne(?,?,?,?) FROM DUAL
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
         void oracle.jbo.server.ViewRowSetImpl.executeQuery()
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
         void MyPkg.objects.MyVectorRow.checkRule1(oracle.jbo.ApplicationModule, int)
         void MyPkg.servlet.MyServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
         boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
         void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
         void com.evermind.util.ThreadPoolThread.run()
    ## Detail 0 ##
    java.sql.SQLException: ORA-01006: bind variable does not exist
         void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
         void oracle.jdbc.ttc7.TTIoer.processError()
         void oracle.jdbc.ttc7.Oall7.receive()
         void oracle.jdbc.ttc7.TTC7Protocol.doOall7(byte, byte, int, byte[], oracle.jdbc.dbaccess.DBType[], oracle.jdbc.dbaccess.DBData[], int, oracle.jdbc.dbaccess.DBType[], oracle.jdbc.dbaccess.DBData[], int)
         int oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(oracle.jdbc.dbaccess.DBStatement, byte, byte[], oracle.jdbc.dbaccess.DBDataSet, int, oracle.jdbc.dbaccess.DBDataSet, int)
         void oracle.jdbc.driver.OracleStatement.doExecuteQuery()
         void oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()
         int oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()
         java.sql.ResultSet oracle.jdbc.driver.OraclePreparedStatement.executeQuery()
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
         void oracle.jbo.server.ViewRowSetImpl.executeQuery()
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
         void MyPkg.objects.MyVectorRow.checkRule1(oracle.jbo.ApplicationModule, int)
         void MyPkg.servlet.MyServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
         boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
         void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
         void com.evermind.util.ThreadPoolThread.run()
    I have tried commented either MyRow.checkRule1 or MyRow.checkRule2 for execution. No error occurs for that. The problem occurs when i put the two together in a loop ... the parameter number for Pkg1.MyFunctionOne is less than Pkg2.MyFunctionTwo, which corresponds to the error message 'Bind variable does not exist' ... any cache for calling the function that causes the error at running the vo.executeQuery statement?
    Question: Does anyone has any ideas about the error origin and solution? (It is very important to me because i still have several check rules in addition to those mentioned 2 rules.)
    Thanks for replying!

    Oic ... thanks for your help, but i find a strange thing. No error message is prompted when i break the loop as follows:
    // Get vector element to perform validation for rule 1 and rule 2
    for (int i = 0; i < MyVector.size(); i++) {
    MyVectorRow MyRow = (MyVectorRow) MyVector.elementAt(i);
    MyRow.checkRule1(am, i);
    // Get vector element to perform validation for rule 1 and rule 2
    for (int i = 0; i < MyVector.size(); i++) {
    MyVectorRow MyRow = (MyVectorRow) MyVector.elementAt(i);
    MyRow.checkRule2(am, i);
    It works, but quite strange ... is it a bug for calling the interface setWhereClauseParam(int, object)? As long as all the bind variables have value (your bind-var array is filled perhaps due to previous setWhereClauseParam, the query will work. What's critical is you get the right query every time :)

Maybe you are looking for

  • Download & upload of an excel file

    Hi,       I have a requirement where the data needs to be downloaded into an excel file and user will upload the same excel file after making required changes in the data. I have used 'GUI_DOWNLOAD' to download the data to excel file. I have tried to

  • Alv get list

    hi all, i am getting values in alv table using select-options. if there are multiple line items for 1 PR no, its displaying all the line items(all the 16 line items with the same PR no) but i want PR no  to be displayed only once .In alv  i have used

  • What is the serial number that I need to install this new photoshop product I just bought?

    I need help. I purchased a new Adobe photoshop elements 11 from Best Buy and I have all the boxes. I try and install this using the numbers on the back of the inner liner but it keeps saying invalid serial number go back and try again. What am I doin

  • Objectstreams... how do they work???

    Hi, I am trying to write a program that uses objectstreams but i can't get it to work properly. I have found about the initialisation-sequence but i still get a streamcoprruptedexception. I am wondering if I should do something extra for it to work?

  • RFC and PI Scenario

    Hi PI Guru, I want to count number of message, which was send from SAP R/3 to SAP PI and the SAP PI send back the number of message and information like send system name, date which will be save in table in sap R/3 and those information coul be read