7 Replies Latest reply on Apr 28, 2008 3:25 AM by 568388

    "Index: 0, Size: 0" error when using lexical references

    568388
      I got "Index: 0, Size: 0" when using lexical references in data template. Can any body tell me what happen? The detail error is:
      [042308_084608187][][EXCEPTION] java.lang.IndexOutOfBoundsException: Index: 0, S
      ize: 0
      at com.sun.java.util.collections.ArrayList.RangeCheck(ArrayList.java:492
      )
      at com.sun.java.util.collections.ArrayList.get(ArrayList.java:306)
      at oracle.apps.xdo.dataengine.DataTemplateParser.getParentDataSource(Dat
      aTemplateParser.java:1802)
      at oracle.apps.xdo.dataengine.XMLPGEN.writeDefaultGroup(XMLPGEN.java:329
      )
      at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:2
      84)
      at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:271)
      at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:213)
      at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:252)
      at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProc
      essor.java:390)
      at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.ja
      va:355)
      at oracle.apps.xdo.servlet.data.bind.AdvancedQueryBoundValue11.callDataP
      rocessor(AdvancedQueryBoundValue11.java:212)
      at oracle.apps.xdo.servlet.data.bind.AdvancedQueryBoundValue11.getValue(
      AdvancedQueryBoundValue11.java:101)
      at oracle.apps.xdo.servlet.ReportContextImplV11.getReportXMLData(ReportC
      ontextImplV11.java:399)
      at oracle.apps.xdo.servlet.CoreProcessor.process(CoreProcessor.java:143)
        • 1. Re: "Index: 0, Size: 0" error when using lexical references
          Rwillems-Oracle
          can you post your data template
          • 2. Re: "Index: 0, Size: 0" error when using lexical references
            568388
            Here is the data template, the lexical reference is &where_clause, thanks.

            <dataTemplate name="Tamplate" dataSourceRef="dmdb" defaultPackage="RRBY_PKG">
                 <properties>
                      <property name="debug_mode" value="on"/>
                 </properties>
                 <parameters>
                           <parameter name="BUName" dataType="character"/>
                      <parameter name="StartDate" dataType="date"/>
                      <parameter name="EndDate" dataType="date"/>
                 </parameters>
            <dataTrigger name="beforeReport" source="RRBY_PKG.dynamic_where(BUName =&gt; :BUName)"/>
                 <dataQuery>
                 <sqlstatement name="GroupByAgent">
                           <![CDATA[SELECT
              NVL(businessunit.name, 'Unassigned') UNITNAME,
              queue.name QUEUENAME,
              NVL2(businessunit.name, 'Unassigned', businessunit.name || ': ' || queue.name) FULLQUEUENAME,
              COUNT(queueEvent.requestNumber) REQNUM
            FROM((((queueevent queueevent
            INNER JOIN assignment assignment ON queueevent.assignmentkey = assignment.assignmentkey)
            INNER JOIN datedim datedim ON queueevent.datekey = datedim.datekey)
            INNER JOIN businessunit businessunit ON queueevent.businessunitkey = businessunit.businessunitkey)
            INNER JOIN queue queue ON queueevent.forwardedqueuekey = queue.queuekey)
            INNER JOIN timedim timedim ON queueevent.timekey = timedim.timekey
            WHERE dateDim.FULLDATE >= TO_DATE(:StartDate, 'yyyy-mm-dd')
            AND BW_COMMON_DATEADD('s', timeDim.SECONDOFDAY, BW_COMMON_DATEADD('s', queueEvent.EVENTDURATION, dateDim.FULLDATE)) > TO_DATE(:StartDate, 'yyyy-mm-dd')
            AND BW_COMMON_DATEADD('s', timeDim.SECONDOFDAY, BW_COMMON_DATEADD('s', queueEvent.EVENTDURATION, dateDim.FULLDATE)) &lt; TO_DATE(:EndDate, 'yyyy-mm-dd') AND &where_clause
            group by businessunit.name, queue.name]]>
                      </sqlstatement>
                 </dataQuery>
            </dataTemplate>
            • 3. Re: "Index: 0, Size: 0" error when using lexical references
              568388
              Do you have any idea? I also post the pl/sql function here:

              create or replace package RRBY_PKG
              as
              where_clause varchar2(200);
              BUName varchar2(50);
              StartDate varchar2(10);
              EndDate varchar2(10);
              function dynamic_where(
              BUName varchar2)
              return boolean;
              end RRBY_PKG;
              /
              create or replace package body RRBY_PKG
              as
              function dynamic_where(
              BUName varchar2)
              return boolean
              IS
              begin
              where_clause := 'assignment.REASSIGNEDTO=' || '' || 'Queue1' || '';
              return true;
              end;
              end RRBY_PKG;
              /
              • 4. Re: "Index: 0, Size: 0" error when using lexical references
                Rwillems-Oracle
                Hi,

                your line
                where_clause := 'assignment.REASSIGNEDTO=' || '' || 'Queue1' || '';
                is the same like
                where_clause := 'assignment.REASSIGNEDTO=Queue1';
                which creates a invalid SQL at runtime, as I assume Queue1 is not a column and you want to have
                assignment.REASSIGNEDTO='Queue1'
                as condition.
                To reach that use
                where_clause := 'assignment.REASSIGNEDTO=' || '''' || 'Queue1' || '''';
                or easier
                where_clause := 'assignment.REASSIGNEDTO=''Queue1''';

                regards
                Rainer
                • 5. Re: "Index: 0, Size: 0" error when using lexical references
                  568388
                  Hi Rainer,
                  I changed the line you mentioned to where_clause := 'assignment.REASSIGNEDTO=''Queue1''';. but I got the same error. Yes, the Queue1 is not a column but just a string literal. This is my first time using lexical references and really don't know what happened.

                  Thanks,
                  • 6. Re: "Index: 0, Size: 0" error when using lexical references
                    568388
                    Hi Rainer,
                    I found the problem, when I use something like &where_clause, there will be the error. I must use &amp; to replace & in the query, that is &amp;where_clause.
                    I was wondering why other people didn't meet the same problem...
                    Anyway, thanks for you help.
                    • 7. Re: "Index: 0, Size: 0" error when using lexical references
                      568388
                      Oops, our forum do the character entity transforming automatically. I mean "I must use & amp; to replace & in the query, that is & amp;where_clause". Pls ignore the space before amp;.