Bind Variables with AND in String causing Issues in XML & Report Outputs

Hi all,
I'm creating a BI Publisher report (10.1.3.2) and am experiencing an issue with the interprutation of Bind Variables in the Data Template.
Here is an example of some of the Data template
<dataTemplate name="BudgetDataBU" description="BudgetDataBU" dataSourceRef="DLXN">
   <parameters> 
      <parameter name="p_Year" dataType="Integer" include_in_output="true"/>
      <parameter name="p_Measure" dataType="character" include_in_output="true"/>
      <parameter name="p_Currency" dataType="character" include_in_output="true"/>
      <parameter name="p_Version" dataType="character" include_in_output="true"/>
   </parameters>
   <dataQuery>
      <sqlStatement name="BusUnits">
           <![CDATA[SELECT DISTINCT CC.BUSINESS_UNIT as BUSINESS_UNIT
                    FROM   DLXN_FACT_DATA_DET FD,
                           DLXN.COST_CENTRE CC
                    WHERE FD.COST_CENTRE = CC.COST_CENTRE
                    AND FD.CAL_YEAR    = :p_Year
                    AND FD.Currency      = :p_Currency
                    AND FD.Measure      = :p_Measure
                    AND FD.Version        = :p_Version                                
                    AND CC.DLXN_VIEW = 'Delexian' ]]>
           </sqlStatement>
       <sqlStatement name="Details">
           <![CDATA[SELECT DLXN_FACT_DATA_DET.VERSION,
                           DLXN_FACT_DATA_DET.CURRENCY,
                           DLXN_FACT_DATA_DET.CAL_YEAR as CAL_YEAR,
                           SUM(nvl(DLXN_FACT_DATA_DET.JAN_AMT,0)) as JAN_AMT,
        </sqlStatement>
    </dataQuery>The problem is with the :p_Measure Bind Variable but it could just as easily be any of the other character parameters.
The particular string value that is causing a problem is "Travel and Expenditure". I believe it is due to the "AND" in the string but this string value cannot be changed in the database to say "Travel & Expenditure".
I have thought about using a REPLACE function in the SELECT statement but see this as an ugly solution.
Any input greatly appreciated.
Kind Regards,
Gary.

We remove this restriction ,fix included in BI Publisher July 2009 update for 10.1.3.4.x. The patch number is 8704846.

Similar Messages

  • Using bind variable with IN clause

    My application runs a limited number of straight up queries (no stored procs) using ODP.NET. For the most part, I'm able to use bind variables to help with query caching, etc... but I'm at a loss as to how to use bind variables with IN clauses. Basically, I'm looking for something like this:
    int objectId = 123;
    string[] listOfValues = { "a", "b", "c"};
    OracleCommand command = new OracleCommand();
    command.Connection = conn;
    command.BindByName = true;
    command.CommandText = @"select blah from mytable where objectId = :objectId and somevalue in (:listOfValues)";
    command.Parameters.Add("objectId", objectId);
    command.Parameters.Add("listOfValues", listOfValues);
    I haven't had much luck yet using an array as a bind variable. Do I need to pass it in as a PL/SQL associative array? Cast the values to a TABLE?
    Thanks,
    Nick

    Nevermind, found this
    How to use OracleParameter whith the IN Operator of select statement
    which contained this, which is a brilliant solution
    http://oradim.blogspot.com/2007/12/dynamically-creating-variable-in-list.html

  • Error bind variable with "like %" clause ?

    Hello everybody;
    I would like to know how to do a like clause to bind variables, with this code i obtain 'ORA-00933: SQL command not properly ended' error
    v_query:= 'UPDATE ' || collection(i) ||' SET REF_PLAN=:quatre_champ WHERE FAM_SIM like ''%'':prem_champ''%'' AND PRISE_V1P like ''%'':deux_champ''%'' AND BROCHE_V1P like ''%:trois_champ%''';
                                  EXECUTE IMMEDIATE v_query USING quatre_champ,prem_champ,deux_champ,trois_champ;Maybe my " ' " are in a bad positions ?
    Thanks for your help, regards.

    Hi,
    try this
    v_query :=
             'UPDATE '
          || collection (i)
          || ' SET REF_PLAN =:quatre_champ WHERE FAM_SIM like'|| '''%:prem_champ%'''
          || ' AND PRISE_V1P like' || ''' %:deux_champ%'''
          || ' AND BROCHE_V1P like'||''' %:trois_champ%;'''
    Of course not tested
    Any efforts to give sample data and help us recreated the problem will be appreciated.
    Cheers!!!
    Bhushan

  • How to use bind variables with XMLTABLE?

    I tried to use bind variables with xmltable statment. Here, my testcase:
    create or replace function wsdltest return xmltype as
    l_dummy xmltype;
    l_stt clob;
    l_name varchar2(500);
    l_xml clob;
    BEGIN
    l_xml :=
    '<definitions name="F1" targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" elementFormDefault="qualified">
    <xsd:element name="SVARCHAR2-F1Input">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="A-VARCHAR2-IN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="F1Output">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="RETURN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </types>
    <message name="F1InputMessage">
    <part name="parameters" element="tns:SVARCHAR2-F1Input"/>
    </message>
    <message name="F1OutputMessage">
    <part name="parameters" element="tns:F1Output"/>
    </message>
    <portType name="F1PortType">
    <operation name="F1">
    <input message="tns:F1InputMessage"/>
    <output message="tns:F1OutputMessage"/>
    </operation>
    </portType>
    <binding name="F1Binding" type="tns:F1PortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="F1">
    <soap:operation soapAction="F1"/>
    <input>
    <soap:body parts="parameters" use="literal"/>
    </input>
    <output>
    <soap:body parts="parameters" use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="F1Service">
    <documentation>Oracle Web Service</documentation>
    <port name="F1Port" binding="tns:F1Binding">
    <soap:address location="http://localhost:8080/orawsv/XFILES/F1"/>
    </port>
    </service>
    </definitions>';
    -- OK
    l_stt := 'select * from xmltable(XMLNAMESPACES(''http://www.w3.org/2001/XMLSchema'' AS "XSD", default ''http://schemas.xmlsoap.org/wsdl/''),
    ''//definitions/types/XSD:schema/XSD:element[@name="SVARCHAR2-F1Input"]''
    passing xmltype(:1)
    columns
    ab xmltype path ''.'' ) t';
    EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml;
    -- ERROR ORA-01006
    l_name := '"SVARCHAR2-F1Input"';
    l_stt := 'select * from xmltable(XMLNAMESPACES(''http://www.w3.org/2001/XMLSchema'' AS "XSD", default ''http://schemas.xmlsoap.org/wsdl/''),
    ''//definitions/types/XSD:schema/XSD:element[@name=:2]''
    passing xmltype(:1)
    columns
    ab xmltype path ''.'' ) t';
    EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml, l_name;
    return l_dummy;
    END;
    Any idea ?
    Thanks in advance
    Cyryl

    Why are you using dynamic SQL statements? Why not just use something like this instead in your PL/SQL. I also replaced the leading // in your Xpath with just / since you start from the root node.
    select *
      INTO l_dummy
      from xmltable(XMLNAMESPACES('http://www.w3.org/2001/XMLSchema' AS "XSD", default 'http://schemas.xmlsoap.org/wsdl/'),
                    '/definitions/types/XSD:schema/XSD:element'
                    passing xmltype(l_xml)
                    columns
                    ab xmltype path '.' ) t;Also, the above returns two rows, which I suspect is not what you want. Here is the pure SQL version for you to debug.
    select *
      from xmltable(XMLNAMESPACES('http://www.w3.org/2001/XMLSchema' AS "XSD", default 'http://schemas.xmlsoap.org/wsdl/'),
                   '/definitions/types/XSD:schema/XSD:element'
                   passing xmltype('<definitions name="F1" targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" elementFormDefault="qualified">
    <xsd:element name="SVARCHAR2-F1Input">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="A-VARCHAR2-IN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="F1Output">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="RETURN" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </types>
    <message name="F1InputMessage">
    <part name="parameters" element="tns:SVARCHAR2-F1Input"/>
    </message>
    <message name="F1OutputMessage">
    <part name="parameters" element="tns:F1Output"/>
    </message>
    <portType name="F1PortType">
    <operation name="F1">
    <input message="tns:F1InputMessage"/>
    <output message="tns:F1OutputMessage"/>
    </operation>
    </portType>
    <binding name="F1Binding" type="tns:F1PortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="F1">
    <soap:operation soapAction="F1"/>
    <input>
    <soap:body parts="parameters" use="literal"/>
    </input>
    <output>
    <soap:body parts="parameters" use="literal"/>
    </output>
    </operation>
    </binding>
    <service name="F1Service">
    <documentation>Oracle Web Service</documentation>
    <port name="F1Port" binding="tns:F1Binding">
    <soap:address location="http://localhost:8080/orawsv/XFILES/F1"/>
    </port>
    </service>
    </definitions>'
                   columns
                   ab xmltype path '.' ) t

  • Using collections / Bind variables with a PL/SQL functio returning a query

    I have this code, which is supposed to assign collection variables as column names
    FOR i in 1 .. Collection_count -1
    LOOP
    SELECT c002 into :P341_M1 FROM APEX_collections WHERE collection_name = 'MA_SKILLS' AND seq_id=i;
    SELECT c002 into varholder FROM APEX_collections WHERE collection_name = 'MA_SKILLS' AND seq_id=i;
    vQuery:= vQuery || 'SUM(decode(label, ''Aware'', product_'|| i || ', ''Expert'', product_' || i || ', ''Proficient'', product_' || i || ', ''Advanced(Demo)'', product_' || i || ' )) as ';
    vQuery:=vQuery || varholder || ', ' ;
    END LOOP;
    I've tried &P341_M1. , :P341_M1, ':P341_M1', varholder
    When I try '&P341_M1' it returns the whole SUM(decode... line as the label
    Basically Im having a hard time using bind variables with the PL/SQL returning a query...anybody?

    Ok so working through this problem more I have realized that the problem is using the for loop i as an index value
    This will get a value:
    SELECT c002 into :P341_M1 FROM APEX_collections WHERE collection_name = 'MA_SKILLS' AND seq_id=2;
    But this won't
    SELECT c002 into :P341_M1 FROM APEX_collections WHERE collection_name = 'MA_SKILLS' AND seq_id=i;
    I'm in the for loop, and use the i variable in other places within this loop...Is there a reason why I can't compare seq_id to i?
    My new code as follows:
    FOR i in 1 .. Collection_count -1 --apex_application.g_f01.COUNT - 1
    LOOP
    varholder:=i;
    SELECT c002 into :P341_M1 FROM APEX_collections WHERE collection_name = 'MA_SKILLS' AND seq_id=2;
    SELECT c002 into varholder FROM APEX_collections WHERE collection_name = 'MA_SKILLS' AND seq_id=4;
    vQuery:= vQuery || 'SUM(decode(label, ''Aware'', product_'|| i || ', ''Expert'', product_' || i || ', ''Proficient'', product_' || i || ', ''Advanced(Demo)'', product_' || i || ' )) as f';
    vQuery:=vQuery || :P341_M1 ||i||', ' ;
    END LOOP;

  • How to declare a bind variable with 'date' data type in command prompt?

    how to declare a bind variable with 'date' data type in command prompt?
    sql>variable q date;
    when i execute it show list of datatypes

    Hi,
    As Lokanath said, there are no DATE bind variables.
    You can use a VARCHAR2 bind variable, and convert it to a DATE in your SQL statment.
    If you're using SQL*Plus, consider a substitution variable. It won't be as efficient as a bind variable, but it will be as convenient.
    For example:
    DEFINE  first_entrry_date = "DATE '2010-06-20''
    SELECT   ...
    WHERE   entry_date >= &first_entry_date
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error using bind variables with SQL server with SQL92 mode

    I am using 2 bind variable in my VO (JDBC positional) . The mode is SQL 92 for ADF BC. I do not use the bind variable directly but in a view criteria. I see following error in the logs.
    The logs show the query executed and error.  I tried both ways - making bind variable required and not required. I have set -Djbo.SQLBuilder=SQLServer property. My other page works which has an updatable VO.
    JDEV version is - JDEVADF_11.1.1.7.0_GENERIC_130226.1400.6493
    <ViewObjectImpl> <getQueryHitCount> [4567] Estimated Row Count for ViewObject: [oracle.epm.fm.bc4j.queries.admin.UserOnSystemROVO]AdministrationAM.UserOnSystemROVO1, Query Statement:
    <ViewObjectImpl> <getQueryHitCount> [4568] "SELECT count(1) FROM (SELECT * FROM (SELECT
        TABLE1.SUSERNAME USERNAME,
        TABLE2.SMODULENAME MODULENAME,
        TABLE2.LACTIVITYCODE ACTIVITYCODE,
        TABLE2.DSTARTTIME STARTTIME,
        TABLE2.SSERVERNAME SERVERNAME,
        TABLE2.SAPPNAME APPNAME,
        TABLE2.LSESSIONID SESSIONID,
        TABLE2.LSESSIONSTATUS SESSIONSTATUS,
        TABLE2.LUSERID USERID,
        TABLE2.DSTILLALIVETS STILLALIVETS,
        TABLE2.LTASKID TASKID,
        TABLE2.SACTIVITYDESC ACTIVITYDESC,
        TABLE1.LUSERID USERID1,
        TABLE1.SUSERDESC USERDESC
    FROM
        TABLE2 TABLE2,
        TABLE1 TABLE1
    WHERE
        TABLE2.LUSERID = TABLE1.LUSERID) QRSLT  WHERE ( ( ( ( UPPER(SERVERNAME) = UPPER(?)  )  OR  ( ? IS NULL ) ) AND ( ( UPPER(APPNAME) = UPPER(?)  )  OR  ( ? IS NULL ) ) ) )) ESTCOUNT"
    <ViewObjectImpl> <getQueryHitCount> [4569] Bind params for ViewObject.getQueryHitCount: UserOnSystemROVO1
    <ViewRowSetImpl> <doSetWhereClauseParam> [4570] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(0, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4571] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(1, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4572] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(4, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4573] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(5, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4574] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(2, null, null)
    <ViewRowSetImpl> <doSetWhereClauseParam> [4575] UserOnSystemROVO1 ViewRowSetImpl.doSetWhereClause(3, null, null)
    <ADFLogger> <addContextData> Estimated row count
    <BaseSQLBuilderImpl> <bindParamValue> [4576] Binding null of type 12 for 1
    <BaseSQLBuilderImpl> <bindParamValue> [4577] Binding null of type 12 for 2
    <BaseSQLBuilderImpl> <bindParamValue> [4578] Binding null of type 12 for 3
    <BaseSQLBuilderImpl> <bindParamValue> [4579] Binding null of type 12 for 4
    <BaseSQLBuilderImpl> <bindParamValue> [4580] Binding null of type 12 for 5
    <ViewObjectImpl> <getQueryHitCount> [4581] ViewObjectImpl.getQueryHitCount failed...
    <ViewObjectImpl> <getQueryHitCount> [4582] java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver]Invalid parameter binding(s).
      at weblogic.jdbc.sqlserverbase.dda4.b(Unknown Source)
      at weblogic.jdbc.sqlserverbase.dda4.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.dda3.b(Unknown Source)
      at weblogic.jdbc.sqlserverbase.dda3.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.ddb8.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.ddb9.a(Unknown Source)
      at weblogic.jdbc.sqlserverbase.ddb9.setNull(Unknown Source)
      at weblogic.jdbc.wrapper.PreparedStatement.setNull(PreparedStatement.java:622)
      at oracle.jbo.server.BaseSQLBuilderImpl.bindParamValue(BaseSQLBuilderImpl.java:2215)
      at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3687)
      at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:22684)
      at oracle.jbo.server.ViewObjectImpl.getQueryHitCount(ViewObjectImpl.java:4944)
      at oracle.jbo.server.ViewObjectImpl.getQueryHitCount(ViewObjectImpl.java:4857)
      at oracle.jbo.server.QueryCollection.getEstimatedRowCount(QueryCollection.java:4204)
      at oracle.jbo.server.ViewRowSetImpl.getEstimatedRowCount(ViewRowSetImpl.java:2677)
      at oracle.jbo.server.ViewObjectImpl.getEstimatedRowCount(ViewObjectImpl.java:10632)

    After making all the bind variables not required, the error is no longer coming.

  • Barcode's in R12.1.1 xml report output's (English and Arabic)

    Dear Frednds,
    we are using R12.1.1 and we need to get the barcode output's (in place of numbers) in out xml report output's.
    We need it in English report and also in Arabic reports (it has seperate arabic template file)
    Please let us know the method?
    Regards,
    DB

    Desar Hussein,
    1) we have downloaded and installed the Font Code128bWinLarge.ttf on windows PC.
    2)Set the barcode font for the required field in the rtf Template.
    3) Copied the font file, Code128bWinLarge.ttf to $OA_JRE_TOP/lib/fonts
    4) Copied xdo.cfg file from our local desktop where we have BI publisher installed to
    $OA_JRE_TOP/lib Directory.
    5)added these lines locating barcode font location ($OA_JRE_TOP/lib/fonts
    /Code128bWinLarge.ttf)accordingly.
    Now For English reports we are getting the barcode
    But for Arabic reports we are getting junk characters
    so is there any other font available for Arabic barcode.Plerase suggest
    Regards,
    DB

  • How to compare the value of a binding variable with a string "HOLD" ......?

    Hi All,
    I have two tables - TABLE1 & TABLE2 and both the tables are having STATUS column. The requirement is like if the STATUS column of TABLE1 is updated as "HOLD" then the same value has to be updated to the STATUS column of TABLE2.
    create or replace trigger "TEST_TRG"
    BEFORE
    update of "STATUS" on "TABLE1"
    for each row
    begin
    if(:new.STATUS ='HOLD')then
    insert into TABLE2 (STATUS)
    value (:new.STATUS);
    end if;
    end;
    COMPILATION ERROR:
    Compilation failed, line 3 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
    PLS-00103: Encountered the symbol "{" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "{" was ignored. Compilation failed, line 7 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
    PLS-00103: Encountered the symbol "}" when expecting one of the following: ( begin case declare else elsif end exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "}" was ignored.
    I am getting the compilation errors as above when the trigger is compiled. Can anyone please help me to correct it.
    Thanks and Regards,
    Suhas

    CREATE OR REPLACE TRIGGER "TEST_TRG"
       BEFORE UPDATE OF "STATUS"
       ON "TABLE1"
       FOR EACH ROW
    BEGIN
       IF (:NEW.status = 'HOLD')
       THEN
          INSERT INTO table2
                      (status
               VALUES (:NEW.status
       END IF;
    END;You should learn how to write PL/SQL code.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Bind variable with search parameter in Oracle BI Publisher 10

    Search list for a search parameter in Oracle BI EE works fine when the query doesn't contain a bind variable (parameter identifier). But when a bind variable is introduced in the constraint of search list query, it keeps on searching endlessly. For example,
    -- this doesn't work
    select col1
    from table
    where table.col2 = :I_param_bind_var
    -- this works
    select col1
    from table
    where table.col2 = 'xyz'
    Using such bind variable in the list of values for menu parameters works fine. Is it an issue regarding publisher or am I missing something?
    Edited by: 933296 on Aug 21, 2012 1:38 AM

    <?param@begin:Show_Location;'Yes';'string';'Yes,No'?>
    it will give the Parameter Show_Loactaion with drop down Yes and No.
    and to display <?$Show_Location?>
    <?param@begin:dept;'PAY'?>
    <?$dept?>

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

  • Using a query with bind variable with columns defined as raw

    Hi,
    We are on Oracle 10.2.0.4 on Solaris 8. I have a table that has 2 columns defined as raw(18). I have a query from the front end that queries these two raw columns and it uses bind vairables. The query has a performance issue that I need to reproduce but my difficulty is that how to test the query in sqlplus using bind variables (the syntax for bind vairables fails for columns with raw datatype).
    SQL> DESC TEST
    Name                                      Null?    Type
    ID1                                                RAW(18)
    ID2                                                RAW(18)
    SQL> variable b1  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    The above is the error I get - i cant declare a variable as raw.
    SQL> variable b2  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    SQL> variable b3  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    --now the actual query below
    SQL> SELECT * FROM TEST WHERE ID1=:B1 AND ID2 BETWEEN :B2 AND :B3;
    SP2-0552: Bind variable "B3" not declared.
    (this fails due to the errors earlier)Also this is a third party app schema so that we don't have the option of modifying the data type of the columns.
    Thanks,
    Edited by: orausern on May 10, 2011 11:30 AM

    Try anonymous PL/SQL block:
    declare
    b1 RAW(18);
    b2 RAW(18);
    b3 RAW(18);
    begin
    b1:=..;
    b2:=..;
    b3:=..;
    SELECT col1, col2, ..
    INTO ...
    FROM TEST
    WHERE ID1=:B1
    AND ID2 BETWEEN :B2 AND :B3;
    end;
    /

  • Testing VOs that have positional bind variables with BC4J Tester

    Hi
    I am doing some OAF development for eBusiness 12.1.3 and would like to understand whether VOs that have positional bind variables can be tested using the BC4J Tester in JDeveloper 10.1.3 (the latest version of JDev compatible with OAF development). It looks like it should work as when you choose "Oracle Positional" in the VO wizard Binding Style it adds another text box to the to the Bind Variables page called Bind Positions, I assume that this is so you can create variables that you can populate in the Tester that will relate name to position but I get an error regarding column index when I use the BC4J Tester:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT CASE
    WHEN ph.closed_code IN ('CANCELLED', 'CLOSED','FINALLY CLOSED')
    THEN 'Expired Item'
    WHEN prl.unit_price <> pl.unit_price
    THEN 'Price Update'
    ELSE ''
    END item_status
    FROM po_lines pl,
    po_headers ph,
    po_requisition_lines prl
    WHERE ph.po_header_id = pl.po_header_id
    AND prl.blanket_po_header_id = pl.po_header_id
    AND prl.blanket_po_line_num = pl.line_num
    AND pl.po_header_id = :1
    AND pl.line_num = :2
    AND prl.requisition_line_id = :3
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:833)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4560)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:891)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:805)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:799)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3575)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:439)
         at oracle.jbo.jbotester.VariableDialog.save(VariableDialog.java:144)
         at oracle.jbo.jbotester.GenericDialog.actionPerformed(GenericDialog.java:219)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:515)
         at java.awt.Dialog.show(Dialog.java:536)
         at oracle.jbo.jbotester.JTDialog.show(JTDialog.java:121)
         at oracle.jbo.jbotester.JboTesterUtil.editBindParameters(JboTesterUtil.java:169)
         at oracle.jbo.jbotester.SimpleForm.setIterator(SimpleForm.java:65)
         at oracle.jbo.jbotester.SimpleForm.<init>(SimpleForm.java:51)
         at oracle.jbo.jbotester.VOTreeNode.showForm(VOTreeNode.java:115)
         at oracle.jbo.jbotester.BaseTree.processTreeMouseClicked(BaseTree.java:471)
         at oracle.jbo.jbotester.BaseTree.mav$processTreeMouseClicked(BaseTree.java:45)
         at oracle.jbo.jbotester.BaseTree$TreeMouseListener.mouseClicked(BaseTree.java:125)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
         at java.awt.Component.processMouseEvent(Component.java:5491)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    ## Detail 0 ##
    java.sql.SQLException: Invalid column index
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
         at oracle.jdbc.driver.OraclePreparedStatement.setNUMBERInternal(OraclePreparedStatement.java:5891)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7674)
         at oracle.jdbc.driver.OraclePreparedStatement.setCustomDatumInternal(OraclePreparedStatement.java:7410)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8178)
         at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8166)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParamValue(BaseSQLBuilderImpl.java:1847)
         at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:3890)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3335)
         at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:13759)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:801)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4560)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:891)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:805)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:799)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3575)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:439)
         at oracle.jbo.jbotester.VariableDialog.save(VariableDialog.java:144)
         at oracle.jbo.jbotester.GenericDialog.actionPerformed(GenericDialog.java:219)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:515)
         at java.awt.Dialog.show(Dialog.java:536)
         at oracle.jbo.jbotester.JTDialog.show(JTDialog.java:121)
         at oracle.jbo.jbotester.JboTesterUtil.editBindParameters(JboTesterUtil.java:169)
         at oracle.jbo.jbotester.SimpleForm.setIterator(SimpleForm.java:65)
         at oracle.jbo.jbotester.SimpleForm.<init>(SimpleForm.java:51)
         at oracle.jbo.jbotester.VOTreeNode.showForm(VOTreeNode.java:115)
         at oracle.jbo.jbotester.BaseTree.processTreeMouseClicked(BaseTree.java:471)
         at oracle.jbo.jbotester.BaseTree.mav$processTreeMouseClicked(BaseTree.java:45)
         at oracle.jbo.jbotester.BaseTree$TreeMouseListener.mouseClicked(BaseTree.java:125)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
         at java.awt.Component.processMouseEvent(Component.java:5491)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    ----- LEVEL 1: DETAIL 0 -----
    java.sql.SQLException: Invalid column index
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240)
         at oracle.jdbc.driver.OraclePreparedStatement.setNUMBERInternal(OraclePreparedStatement.java:5891)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7674)
         at oracle.jdbc.driver.OraclePreparedStatement.setCustomDatumInternal(OraclePreparedStatement.java:7410)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8178)
         at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8166)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParamValue(BaseSQLBuilderImpl.java:1847)
         at oracle.jbo.server.OracleSQLBuilderImpl.bindParamValue(OracleSQLBuilderImpl.java:3890)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindParametersForStmt(BaseSQLBuilderImpl.java:3335)
         at oracle.jbo.server.ViewObjectImpl.bindParametersForCollection(ViewObjectImpl.java:13759)
         at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:801)
         at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:666)
         at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3655)
         at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(Unknown Source)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4560)
         at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:742)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMasters(ViewRowSetImpl.java:891)
         at oracle.jbo.server.ViewRowSetImpl.executeQueryForMode(ViewRowSetImpl.java:805)
         at oracle.jbo.server.ViewRowSetImpl.executeQuery(ViewRowSetImpl.java:799)
         at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3575)
         at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:439)
         at oracle.jbo.jbotester.VariableDialog.save(VariableDialog.java:144)
         at oracle.jbo.jbotester.GenericDialog.actionPerformed(GenericDialog.java:219)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
         at java.awt.Dialog$1.run(Dialog.java:515)
         at java.awt.Dialog.show(Dialog.java:536)
         at oracle.jbo.jbotester.JTDialog.show(JTDialog.java:121)
         at oracle.jbo.jbotester.JboTesterUtil.editBindParameters(JboTesterUtil.java:169)
         at oracle.jbo.jbotester.SimpleForm.setIterator(SimpleForm.java:65)
         at oracle.jbo.jbotester.SimpleForm.<init>(SimpleForm.java:51)
         at oracle.jbo.jbotester.VOTreeNode.showForm(VOTreeNode.java:115)
         at oracle.jbo.jbotester.BaseTree.processTreeMouseClicked(BaseTree.java:471)
         at oracle.jbo.jbotester.BaseTree.mav$processTreeMouseClicked(BaseTree.java:45)
         at oracle.jbo.jbotester.BaseTree$TreeMouseListener.mouseClicked(BaseTree.java:125)
         at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
         at java.awt.Component.processMouseEvent(Component.java:5491)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Is there some other configuration I need to do when using positional Bind Variables? If I switch the query to use named parameters and replace :1 with :var1 for example it works fine in the Tester. The reason I am not using named bind variables is that Oracle recommend using positional for eBus, probably because it was predominantly built on older versions of JDev.
    Thanks in advance
    Stacy
    Edited by: Stacy Carpenter on 26-Mar-2013 06:40

    There are actually 2 issues here. The first is that bind positions start at 0 (not 1) and that will resolve the invalid column index issue above. However it seems there is a relatively unknown error in JDeveloper 10.1.3 that keeps resetting the bind position of all bind variables each time you update any of them. So if I create var1 with a position of 0 and then create var2 with a position of 1 then the position of var1 will also be overwritten with 1. I tried listing 0,1 for both to see whether the the IDE would intuitively sort out what was supposed to be where but all that happens is that var2 ends up populating positions 0 and 1, which unless the values are meant to be the same is obviously no good. It seems the only way to get around this in this version of JDeveloper is to close the IDE, edit the VO xml to put the variables against their correct positions, and then reopen. Opening the VO wizard will reset them all to the same again so do not do this (unknowingly) and simply right click the AM and run the BC4J Tester which should now let you edit the bind variables and produce the expected results.
    Cheers
    Stacy

  • What can i replace this bind variable with in function?

    Hello
    I am creating a report showing training attended by employees. I have written a function to do the following:
    Parameters 1 - 4 is hard coded for a reason. So we dont worry about them.
    5th parameter: :START_DATE represents the date training started
    6th parameter: :END_DATE represents the date training ended.
    These date parameters are correctly used inside the select statement that the function is built upon. So don't worry that my date parameters are correct/incorrect.
    The focus should be on how you use bind variables inside Discoverer Admin. The select at the bottom runs perfectly in Toad and it allows you to use the date parameters as bind variables. But it does not allow it in Discoverer Admin
    The problem is with Parameter 5 and 6. I dont want to hard code the dates as i want the user to be able to enter his own date parameters.
    Discoverer Admin gives an error is i want to use :START_DATE and :END_DATE as parameters
    Does anyone have a solution for my problem.
    This is what the code looks like.
    SELECT apps.xxhr_fsc_training_info.xxhr_fsc_training ('A', '02','M', 'N',:START_DATE, :END_DATE)category_A_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('B', '02','M', 'N',:START_DATE, :END_DATE)category_B_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('C', '02','M', 'N',:START_DATE, :END_DATE)category_C_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('D', '02','M', 'N',:START_DATE, :END_DATE)category_D_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('E', '02','M', 'N',:START_DATE, :END_DATE)category_E_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('F', '02','M', 'N',:START_DATE, :END_DATE)category_F_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('G', '02','M', 'N',:START_DATE, :END_DATE)category_G_training
    from dual
    Edited by: iandekoker on Jun 8, 2009 9:34 PM

    Rod
    I have a request. The request is based on various emails written about passing parameters in Discoverer Admin/Desktop. Now if you are experienced and work with set copntext on regular basis then it should be a walk in the park. However if you are new to it like me, then it seems a daunting task. So my request is: Can't you provide us with an example of how to complete the whole process from begin to end using an actual example? I will kick off the process and maybe you can add where i left something out?
    Example:
    SELECT ENAME, HIRE_DATE
    FROM EMP
    WHERE HIRE_DATE = :IDATE;
    We want to run this select statement in Discoverer Admin, but Admin does not like the :IDATE bind variable. So now we are gonna use SET CONTEXT to find a solution to our problem.
    Step1:
    First we have to create a context namespace in the database for the Discoverer contexts. Here is the code to create the context. It is okay to also named your function EUL_DISCO as this name would work perfectly for almost everyone. Best is to do all of this in the Apps schema. Copy and paste this code in Toad and F9 it. It should compile successfully
    CREATE OR REPLACE CONTEXT eul_disco
    USING apps.eul_disco;
    Step 2:
    Now you need to create a package to enable you to set and retrieve contexts from in Discoverer. Here is the code to create the package and package body. Just copy and paste the code into Toad and F9 (execute) it to create the package.
    --Package Spec
    CREATE OR REPLACE PACKAGE eul_disco AS
    FUNCTION set_context(p_name VARCHAR2, p_value VARCHAR2) RETURN VARCHAR2;
    FUNCTION show_context(p_name VARCHAR2) RETURN VARCHAR2;
    END eul_disco;
    --Package Body
    CREATE OR REPLACE PACKAGE BODY eul_disco IS
    FUNCTION set_context(p_name VARCHAR2, p_value VARCHAR2)
    RETURN VARCHAR2 AS
    BEGIN
    dbms_session.set_context('EUL_DISCO', p_name, p_value);
    RETURN p_value;
    END set_context;
    FUNCTION show_context(p_name VARCHAR2)
    RETURN VARCHAR2 IS
    BEGIN
    RETURN SYS_CONTEXT('EUL_DISCO', p_name);
    END show_context;
    END eul_disco;
    Step3:
    Once you have created this package successfully you need to log into Discoverer Admin. Then use the menu to navigate to Tools > Register PL/SQL Function. A window called 'PL/SQL Functions' will appear. Select the 'Import...' button. A new window called 'Import PL/SQL functions' will appear. Scroll down until you see set_context function. Once you found it click OK to import it to End User Layer. Do the same to import show_context function. Remember there are two functions and you need to import them both. When you are done, click 'Apply' button. Then click 'OK' button. You can double check to make sure your functions have been imported. Just nagivate to Tools > Register PL/SQL function again. When the window 'PL/SQL Functions' appears your function(s) should be in the list on the left hand site. Scroll down untill you find them.
    Step4:
    Now it is time to set your session parameters in a separate worksheet inside Discovere Desktop from your main reports. The following steps show you how to create a worksheet to define an effective date parameter. The parameter worksheet should be based on a folder that always returns exactly one row.
    Log into Discoverer Admin. Open the Business Area you want to use. Then create "New Custom Folder..."
    Copy and paste this code (select sydate from dual) inside the New Custom Folder and validate the code. Also rename your folder to 'Set Context Folder'
    Step 5
    Next log into Discoverer Desktop and choose 'Create New Workbook'. Then choose table layout option. In the available list choose 'Set Context Folder'. When you have highlighted 'Set Context Folder' click on '>' button. Then click then 'Finish' button. Once the workbook is created you will see 1 column called Sysdate and a row with today's date in it. Save this workbook and name this workbook XYZ. You might even rename the sheet to QWE.
    Step 6:
    Still in Desktop working on XYZ workbook on QWE sheet, click on Tools > Parameters > New. In the 'Name' field enter START_DATE. Next leave 'Create condition with operator' box unticked. Next in 'Prompt' field enter START_DATE. In 'Description' field enter START_DATE. In 'Default' field enter NULL. Click OK button when you are done.
    Step 7:
    Still in Desktop working on XYZ workbook on QWE sheet, click on Tools > Calculation > New. Click on 'Functions' radio button. Then click on 'Database' folder to expand it. Scroll down till you see 'Set Context' function in the list. Select it and click 'paste >>' button. It will now show: SET_CONTEXT(P_NAME, P_VALUE). Now you need to replace the two parameters (P_NAME, P_VALUE) of the function. Replace P_NAME with 'START_DATE'. When you are done click on Items radio button. Then click on the Parameters folder and select Start_Date.
    When you are done it should look like this: SET_CONTEXT('START_DATE',TO_CHAR(:START_DATE))
    You might want to rename this calculation to START_DATE
    Ps. If you need to create two date parameters START_DATE and END_DATE then you repeat step 7 cause you need one more calculation.
    Just replace START_DATE with END_DATE. You also might want to call this second calculation END_DATE. Thus when you are done you will have 2 calculations:
    SET_CONTEXT('START_DATE',TO_CHAR(:START_DATE))
    SET_CONTEXT('END_DATE',TO_CHAR(:END_DATE))
    This is useful when you want date parameters similar to: 'where date between :Start_date and :End_date'
    Step 8:
    When you now run the XYZ workbook (QWE sheet) it will prompt you for an START_DATE. Enter 10-Jun-2009 (make sure the format you enter the date is similar to the format you have set up in discoverer). Now your XYZ workbook have 2 columns. First column is still called Sysdate with today's date. The second column is called START_DATE with 10-JUN-2009 in it.
    Step 9:
    Now you want to remove the 'SELECT SYSDATE FROM DUAL' data stored in 'SET CONTEXT FOLDER' from your XYZ workbook (QWE sheet) as you no longer need that. Still working with Desktop inside XYZ workbook on QWE sheet > click on Sheet menu option > then Edit Sheet option. On the Select Items tab click on 'Set Context Folder' and click < button to remove the folder from workbook XYZ. Click OK when done and run the workbook XYZ (sheet QWE) again. Now the workbook XYZ (sheet QWE) should only have one column called START_DATE and 10-Jun-2009 as the only row.
    Step 10:
    Rob you might want to come in here. It is also useful to create another calculation retrieving the value of the parameter, so that the value entered for the parameter can be seen when the workbook is run. Please give step by step instruction to complete this process
    Step 11:
    Still remember your initial problem where we wanted to use :IDATE in Discoverer Admin folder, but Discoverer Admin did not like the :IDATE syntax?
    SELECT ENAME, HIRE_DATE
    FROM EMP
    WHERE HIRE_DATE = :IDATE;
    Solution:
    Well now you just replace :IDATE with TO_DATE(SYS_CONTEXT('EUL_DISCO','START_DATE'))
    Log into Discoverer Admin. Open your Business Area. Then create 'New Custom Folder..'.
    Copy the code below and paste it into the new custom folder.
    Then validate the code.
    Rename the new custom folder to 'Solution'
    --copy and paste this code into folder 'Solution'
    SELECT ENAME, HIRE_DATE
    FROM EMP
    WHERE HIRE_DATE = TO_DATE(SYS_CONTEXT('EUL_DISCO','START_DATE'))
    note: 'EUL_DISCO' is the name of the context and package you created in step1
    : 'START_DATE' is the name of the calculation you did in step7
    Then log onto Discoverer Desktop > open your workbook XYZ > open sheet QWE.
    Click on Menu item called Sheet > New Sheet > choose Table layout > click next > scroll down available folders till you find SQL folder with then name 'Solution'. Select 'Solution' folder and click > then click Finish.
    The folder named 'Solution' will be used to populate the newly created sheet with data. You might want to rename the newly created sheet to 'Finally'.
    At this point workbook XYZ should have 2 sheets (QWE and Finally).
    Sheet 'QWE' contains the parameter and nothing else.
    Sheet 'Finally' displays the code found in folder 'Solution'
    First you run sheet QWE to set parameter. When prompt for a date enter '10-JUN-2009'. Click OK button.
    Then click on sheet 'Finally' to allow the parameter to take effect and do its job. You will see that only data true of 10-JUN-2009 are displayed
    Notes:
    This is a very simple example. But if you work thru this example, then you will get the concept behind the idea and would you be able to satisfy your own need.

  • Trying to use bind variables with a list

    I have the following dynamic SQL statement which I'm trying to convert to use pure bind variables. the variable "v_list" is a string that gets filled dynamically with a list of numbers so it can be used in an expression "IN (<expr>)". The number of elements is not constant but DB driven. I cannot simply replace it with a bind variable, I get the "Invalid number" error.
    I read up on using collection/varrays but they seem to be build for other purposes. any ideas?
    BTW this query catcehs the NO_DATA and TOO_MANY exception. basically we are interested in either found at least one record, or not.
    DECLARE
         v_list     VARCHAR2(1000);
         v_P1     INTEGER;
         v_temp     INTEGER;
         v_list := '0';
         FOR <some condition>
         LOOP
              v_list := v_list || ',' || <some-number>;
         END LOOP;
         v_String := 'SELECT pID FROM t1'
              || ' WHERE pID IN (' || v_list || ')'
              || ' AND f2 = :1 '
              || ' AND f3 = 1';
         EXECUTE IMMEDIATE v_String INTO v_temp USING v_P1;

    Tom Kyte has a discussion that will probably be useful here
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:210612357425
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • OS Yosemite and Photoshop CS6 didn't work correctly

    After i have been update to Yosemite, i notified that during painting in Photoshop CS6(13.02) using brush, i can't some time use my short keys on wacom tablet and on keyboard too. After i turn another tool then back to brush, shortcuts works well. Al

  • Supersession chain not working

    Hi Gurus, i need your help on the supersession topic. I am new to this and i'm finding some problems in defining supersession chains and use them. To define a chain, I have the steps written in the guide here below: http://help.sap.com/saphelp_dimp50

  • REUSE ALV -- To make a row grey out (disable/non-editable) dynamically!!!

    Hello All, Well again a quick question... Am using REUSE ALV method to display the ALV report. There are few fields which i've made editable while building the field catalog! Now by, Dynamically by selecting a row in the list (using the checkbox) and

  • Randomly opens new window to program files

    When I open a new tab or at random times it will open a new window with 7 tabs to go to some site listed as Firefox program files. I ran a virus scan and found nothing so it must be something else

  • Seeburger Workbench access - restrict users to Message Monitor only

    Hi All Does anyone know if it's possible to restrict users to Message Monitor only access in the Seeburger Workbench?