Passing Condition as lexical parameter

Hi All,
I am developing one XML report by using XML Dtata templet.
I have the require ment like to check the cdition on bassis of the USER Parameter value if the parameter is null then place the min and max value of the column.
In my data templet I declare the lexical parameter
And in my PL/SQL package I declare the function where I am building the string.
When I am submitting the cuncorrent program it is throughing me the error.
Data templet
<?xml version="1.0" encoding="UTF-8" ?>
<dataTemplate name="XXGLR005_1" defaultPackage="XXX_GL_GLSPF_XMLP_PKG" version="1.0">
<properties>
<property name="include_parameters" value="true"/>
<property name ="debug_mode" value="on" />
</properties>
<parameters>
          <parameter name="p_ledger" dataType="varchar2"/>
          <parameter name="p_balancing" dataType="varchar2"/>
          <parameter name="p_start_period" dataType="varchar2"/>     
          <parameter name="p_end_period" dataType="varchar2"/>
          <parameter name="p_start_fc" dataType="varchar2"/>
          <parameter name="p_end_fc" dataType="varchar2"/>
          <parameter name="p_start_site" dataType="varchar2"/>          
          <parameter name="p_end_site" dataType="varchar2"/>
          <parameter name="p_where" dataType="varchar2"/>
     </parameters>
<lexicals>
</lexicals>
<dataQuery>
<sqlStatement name="Q_1">
<![CDATA[
SELECT account,
account_description,
SUM (amount_period_range) amount_period_range,
SUM (fisical_ytd_amount) fisical_ytd_amount,
SUM (cumilative_found) cumilative_found,
account_type,actual_flag,period_name
FROM (SELECT gcc.segment4 ACCOUNT, ffv.description account_description,
(CASE ba.currency_code
WHEN 'CAD'
THEN (ba.period_net_dr - ba.period_net_cr)
ELSE (ba.period_net_dr_beq - ba.period_net_cr_beq)
END
) AS amount_period_range,
(CASE ba.currency_code
WHEN 'CAD'
THEN ( (ba.begin_balance_dr - ba.begin_balance_cr)
+ (ba.period_net_dr - ba.period_net_cr)
ELSE ( (ba.begin_balance_dr_beq
- ba.begin_balance_cr_beq
+ (ba.period_net_dr_beq - ba.period_net_cr_beq)
END
) AS fisical_ytd_amount,
(CASE ba.currency_code
WHEN 'CAD'
THEN ( (ba.begin_balance_dr - ba.begin_balance_cr)
+ (ba.project_to_date_dr - ba.project_to_date_cr
ELSE ( (ba.begin_balance_dr_beq
- ba.begin_balance_cr_beq
+ ( ba.project_to_date_dr_beq
- ba.project_to_date_cr_beq
END
) AS cumilative_found,
gcc.account_type account_type, ba.period_name,
ba.actual_flag
FROM gl_code_combinations gcc,
gl_balances ba,
gl_periods gp,
fnd_flex_value_sets fvs,
fnd_flex_values_vl ffv
WHERE gcc.code_combination_id = ba.code_combination_id
AND ba.period_name = gp.period_name
AND ffv.flex_value_set_id = fvs.flex_value_set_id
AND ffv.flex_value = gcc.segment4
AND fvs.flex_value_set_name = 'AHS_ACCOUNT'
AND ba.actual_flag <> 'B'
AND gcc.segment1 = '101'
&p_where
AND gcc.segment2 BETWEEN '0006' AND '0006'
AND gcc.segment4 = '31030000'
AND gp.start_date >= TO_DATE ('01/08/2010', 'DD-MM-YYYY')
AND gp.end_date <= TO_DATE ('30/11/2010', 'DD-MM-YYYY')
AND gcc.account_type IN ('E', 'R'))
GROUP BY period_name, actual_flag, ACCOUNT, account_description, account_type
]]>
</sqlStatement>
<sqlStatement name="Q_2">
<![CDATA[
SELECT NAME LEDGER_NAME
FROM gl_ledgers
WHERE ledger_id =:p_ledger
]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReportTrigger" source="XXX_GL_GLSPF_XMLP_PKG.XXX_GL_SPF_SUMMARY_REP" />
<dataStructure>
     <group name="G_1" source="Q_1">
               <element name="account" value="account"/>
               <element name="account_description" value="account_description"/>
               <element name="amount_period_range" value="amount_period_range"/>
               <element name="fisical_ytd_amount" value="fisical_ytd_amount"/>
               <element name="cumilative_found" value="cumilative_found"/>
               <element name="account_type" value="account_type"/>
     </group>
     <group name="G_2" source="Q_2">
          <element name="LEDGER_NAME" dataType="varchar2" value="LEDGER_NAME"/>
     </group>
     </dataStructure>
</dataTemplate>
Package Specification
CREATE OR REPLACE PACKAGE APPS.XXX_GL_GLSPF_XMLP_PKG AUTHID CURRENT_USER AS
-- Package Name : XXX_GL_GLSPFDETAIL_XMLP_PKG
-- Author's Name : Nihar Ranjan Panda
-- RICE Object id : GL-REP-05
-- Purpose : Package Specification
-- Program Style :
-- Maintenance History
-- Date Version# Name Remarks
-- 28-Nov-2010 1.0 Nihar Ranjan Panda Initial Devp
--Global Parameters
p_ledger varchar2(100);
p_balancing varchar2(10);
p_start_period varchar2(10);
p_end_period varchar2(10);
p_start_fc varchar2(20);
p_end_fc varchar2(20);
p_start_site varchar2(10);
p_end_site varchar2(10);
p_start_mail_id varchar2(30);
p_end_mail_id varchar2(30);
p_purge_history varchar2(10);
p_where varchar2(1000);
P_CONC_REQUEST_ID number;
type spf_ref_cursor is REF CURSOR;
type rec_spf is record
account varchar2(20),
account_description varchar2(100),
amount varchar2(20),
account_type varchar2(1),
currency varchar2(3),
gl_date varchar2(11),
je_category varchar2(50),
code_combination_id varchar2(100),
line_description gl_je_lines.description%Type,
batch_name gl_je_batches.NAME%Type,
je_line_num gl_je_lines.je_line_num%TYPE,
--transaction_date varchar2(11),
je_header_num gl_je_headers.je_header_id%Type
function XXX_GL_SPF_SUMMARY_REP return boolean;
END XXX_GL_GLSPF_XMLP_PKG;
Package body
CREATE OR REPLACE PACKAGE BODY APPS.XXX_GL_GLSPF_XMLP_PKG
AS
-- Package Name : XXX_GL_GLSPFDETAIL_XMLP_PKG
-- Author's Name : Nihar Ranjan Panda
-- RICE Object id : GL-REP-05
-- Purpose : Package Body
-- Program Style :
-- Maintenance History
-- Date Version# Name Remarks
-- 28-Nov-2010 1.0 Nihar Ranjan Panda Initial Devp
FUNCTION XXX_GL_SPF_SUMMARY_REP
RETURN BOOLEAN
IS
l_min_fc VARCHAR2 (20) := '';
l_max_fc VARCHAR2 (20) := '';
l_min_site VARCHAR2 (20) := '';
l_max_site VARCHAR2 (20) := '';
l_start_date VARCHAR2 (11) := '';
l_end_date VARCHAR2 (11) := '';
BEGIN
IF p_start_fc IS NULL
THEN
SELECT MIN (flex_value)
INTO l_min_fc
FROM fnd_flex_values_vl
WHERE flex_value_set_id =
(SELECT flex_value_set_id
FROM fnd_flex_value_sets
WHERE flex_value_set_name = 'AHS_FUNCTIONAL_CENTRE');
p_start_fc := l_min_fc;
END IF;
IF p_end_fc IS NULL
THEN
SELECT MAX (flex_value)
INTO l_max_fc
FROM fnd_flex_values_vl
WHERE flex_value_set_id =
(SELECT flex_value_set_id
FROM fnd_flex_value_sets
WHERE flex_value_set_name = 'AHS_FUNCTIONAL_CENTRE');
p_end_fc := l_max_fc ;
END IF;
IF p_start_site IS NULL
THEN
SELECT MIN (flex_value)
INTO l_min_site
FROM fnd_flex_values_vl
WHERE flex_value_set_id = (SELECT flex_value_set_id
FROM fnd_flex_value_sets
WHERE flex_value_set_name = 'AHS_SITE');
p_start_site :=l_min_site;
END IF;
IF p_end_site IS NULL
THEN
SELECT MAX (flex_value)
INTO l_max_site
FROM fnd_flex_values_vl
WHERE flex_value_set_id = (SELECT flex_value_set_id
FROM fnd_flex_value_sets
WHERE flex_value_set_name = 'AHS_SITE');
p_end_site := l_max_site;
END IF;
SELECT TO_CHAR (start_date, 'DD-MM-YYYY')
INTO l_start_date
FROM gl_periods
WHERE period_name = p_start_period;
SELECT TO_CHAR (end_date, 'DD-MM-YYYY')
INTO l_end_date
FROM gl_periods
WHERE period_name = p_end_period;*/
p_where := ('AND gcc.segment3 BETWEEN '''|| p_start_fc ||''' AND '''||p_end_fc||''
AND gcc.segment2 BETWEEN '''|| p_start_site ||''' AND '''||p_end_site||'''
AND gp.start_date >= '''||TO_DATE (l_start_date,'DD-MM-YYYY')||'''
AND gp.end_date <= '''||TO_DATE (l_end_date,'DD-MM-YYYY')||''''*/
RETURN (TRUE);
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (-20101,NULL);
NULL;
END XXX_GL_SPF_SUMMARY_REP;
END XXX_GL_GLSPF_XMLP_PKG;
Error file
Custom Extensions: Version : UNKNOWN
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
XXGLR005 module: AHS GL SPF Summary Report
Current system time is 07-DEC-2010 23:39:22
XDO Data Engine Version No: 5.6.3
Resp: 20434
Org ID : 82
Request ID: 3275555
All Parameters: p_ledger=2021:p_balancing=101:p_start_period=AUG-10:p_end_period=NOV-10:p_start_fc=71110600018:p_end_fc=71110600018:p_start_site=0006:p_end_site=0006
Data Template Code: XXGLR005
Data Template Application Short Name: XXX
Debug Flag: N
{p_end_period=NOV-10, p_end_fc=71110600018, p_end_site=0006, p_start_fc=71110600018, p_balancing=101, p_start_period=AUG-10, p_ledger=2021, p_start_site=0006}
Calling XDO Data Engine...
[120710_113928978][][STATEMENT] Start process Data
[120710_113928979][][STATEMENT] Process Data ...
[120710_113928981][][STATEMENT] Executing data triggers...
[120710_113928981][][STATEMENT] BEGIN
XXX_GL_GLSPF_XMLP_PKG.p_ledger := :p_ledger ;
XXX_GL_GLSPF_XMLP_PKG.p_balancing := :p_balancing ;
XXX_GL_GLSPF_XMLP_PKG.p_start_period := :p_start_period ;
XXX_GL_GLSPF_XMLP_PKG.p_end_period := :p_end_period ;
XXX_GL_GLSPF_XMLP_PKG.p_start_fc := :p_start_fc ;
XXX_GL_GLSPF_XMLP_PKG.p_end_fc := :p_end_fc ;
XXX_GL_GLSPF_XMLP_PKG.p_start_site := :p_start_site ;
XXX_GL_GLSPF_XMLP_PKG.p_end_site := :p_end_site ;
XXX_GL_GLSPF_XMLP_PKG.p_where := :p_where ;
:XDO_OUT_PARAMETER := 1;
END;
[120710_113928985][][STATEMENT] 1:2021 :
[120710_113928985][][STATEMENT] 2:101 :
[120710_113928985][][STATEMENT] 3:AUG-10 :
[120710_113928985][][STATEMENT] 4:NOV-10 :
[120710_113928985][][STATEMENT] 5:71110600018 :
[120710_113928985][][STATEMENT] 6:71110600018 :
[120710_113928985][][STATEMENT] 7:0006 :
[120710_113928985][][STATEMENT] 8:0006 :
[120710_113928985][][STATEMENT] 9:null :
[120710_113929388][][STATEMENT] Executing data triggers...
[120710_113929388][][STATEMENT] Declare
l_flag Boolean;
BEGIN
l_flag := XXX_GL_GLSPF_XMLP_PKG.XXX_GL_SPF_SUMMARY_REP ;
if (l_flag) then
:XDO_OUT_PARAMETER := 1;
end if;
end;
[120710_113929420][][STATEMENT] p_ledger
[120710_113929420][][STATEMENT] p_balancing
[120710_113929420][][STATEMENT] p_start_period
[120710_113929420][][STATEMENT] p_end_period
[120710_113929420][][STATEMENT] p_start_fc
[120710_113929420][][STATEMENT] p_end_fc
[120710_113929421][][STATEMENT] p_start_site
[120710_113929421][][STATEMENT] p_end_site
[120710_113929421][][STATEMENT] p_where
[120710_113929421][][STATEMENT] Writing Data ...
[120710_113929426][][STATEMENT] &p_where
java.lang.NullPointerException
     at oracle.apps.xdo.dataengine.DataTemplateParser.getObjectVlaue(DataTemplateParser.java:1754)
     at oracle.apps.xdo.dataengine.DataTemplateParser.replaceSubstituteVariables(DataTemplateParser.java:1473)
     at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:456)
     at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
     at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:308)
     at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
     at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
     at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
     at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
     at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
     at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:334)
     at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:294)
     at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
Start of log messages from FND_FILE
End of log messages from FND_FILE
Executing request completion options...
Finished executing request completion options.
Concurrent request completed
Current system time is 07-DEC-2010 23:39:29
Could any body please help me fixing this issue...

Nihaapps,
It seems like you are missing a default value for p_where. If data templates have the same requirements as RDFs, then lexicals must have a default value that will be valid when the query is verified. The query would have to be checked for validity, and to do that, it has to fill in a value where &p_where is.
Kurz

Similar Messages

  • Run Report with Pass Number and Varchar Lexical Parameter values

    Dear Sir/Madam
    Due to an urgent change required to a report I would most appreciate it if you can please advise me if it is possible to get this report working by either passing in multiple lexical parameters or one signle lexical parameter when calling the SRW.RUN_REPORT command with the following methods:
    Firstly: When calling report with a run_no and spr_cd passed in through one lexical:
    cmd_line: REPORT=D:\DEV\REMITTANCE.rdf BACKGROUND=YES BATCH=NO DESFORMAT=PDF DESTYPE=FILE DESNAME=D:\DEV\REMITTANCE.pdf
    CP_L_PARAM=RUN_NO=TO_NUMBER(28) AND SPR_CD=SUPP1
    Both with a TO_NUMBER and without, whereby I attempt to do a SUBSTR within the query of the called report to derive the RUN_NO Oracle Reports fails to accept the SUBSTR.
    Secondly: I am now trying to call the with passing two lexical parameters into the report as follows:
    cmd_line: REPORT=D:\DEV\REMITTANCE.rdf BACKGROUND=YES BATCH=NO DESFORMAT=PDF DESTYPE=FILE DESNAME=D:\DEV\REMITTANCE.pdf
    CP_L_RUN_NO=||TO_CHAR(lv_run_no)|| CP_L_SPR_CD=||lv_spr_cd;          
    NOTE: The above is an output of the actual command line and not what is passed into the command line, thus the quotes are missing. Please also note that the report is running fine with the only a hard coded RUN_NO value PASSED without the SPR_CD.
    Unfortunately this is also causing issues as the RUN_NO is a number and as you know you can only pass in strings.
    Your urgent help is required on this matter please as our client is expecting a solution this afternoon.
    Hope to hear form you soon.
    Kind regards
    Andrew Mason

    Dont Worry I've worked it out...

  • Problem when using WEB.SHOW_DOCUMENT and passing in lexical parameter

    Hi,
    I got a blank page with error "An error has occured while trying to use this document" when I tried to use web.show_document and passing a lexical parameter to 10g report on 10gAS. The URL in the web.show_document is:
    http://<srvname>:<portnum>/reports/rwservlet?server=repserver90&report=myrpt.rdf&destype=Cache&desformat=pdf&userid=<usr>/<pw>@<db>&where_clause=where%20product_type%20in%20('REPORT')
    If I change the desformat to htmlcss, it is fine to display the report. But doesn't work with desformat=pdf. The pdf file has been generated in the cache. Why can't it display on the screen.
    Also I tried to use double quote the value for where_clause. The pdf report showed up. But it ignored the where clause.
    Experts please help.
    Ying

    I use lexical parameters and they work fine, but I use a parameter list. The code is contained in a form that is called by all forms that wish to run a report. This way you only need the logic for printing in a single form. If you want the form, email me at [email protected]

  • Passing single quotes in a lexical parameter from forms11g to reports 11g

    Hi,
    We've upgraded our forms and reports from 10.1.2.3 to 11.1.2.1 and this has broken a number of reports where we pass a string of single quoted variables to reports as a lexical parameter.
    v_string := ''''||:block.item1||''''||','||''''||:block.item2||''''
    select *
    from emp
    where emp_id in (&p_string)
    where v_string is simply passed as a text parameter to the report.
    I'm not clear why this should break now (its worked since 6i) and whether anyone is aware of it and/or a solution.
    Any help much appreciated as always
    Thank you

    Hi,
    Thanks for the suggestion I will try and give it a go.
    Do you mean for example in the form:
    v_string := $$dq||:block.item1||$$dq||','||$$dq||:block.item2||$$dq
    And in the report
    Begin
    replace(p_where_string,'$q','''');
    end;
    I would say that this even if this works it will prove painful to be updating every form AND report where this is used as we have a lot! I do really appreciate anyone taking the time to reply though!
    It would appear that there are several bugs recorded against this type of problem when moving to reports 11...
    Bug 11840698 - SIMPLE QUOTE REMOVED WHEN USING RUN_REPORT_OBJECT WITH PARAMLIST
    Status 11 - Code/Hardware Bug (Response/Resolution
    I will continue to update with responses from my SR.
    Thanks

  • Packages oracle not recognized lexical parameter that passed from BIP

    Dear all,
    My name is Rizal, i've a problem when passing lexical parameter from BIP to Oracle Packages. Below is my data template in BI Publisher that call function f_where_clause on packages :
    <dataTemplate name="dtTemplate1" description="dtTemplateTest" dataSourceRef="prodin" defaultPackage="pkg_rep_bip">
    <dataTrigger name="cobaTrigReport" source="pkg_rep_bip.f_where_clause(:P_SD)"/>
    <dataQuery>
    <sqlstatement name="Q1">
    <![CDATA[SELECT CODE, SPPD_CODE FROM PRO_SPD01 &amp;v_where_clause]]>
    </sqlstatement>
    </dataQuery>
    </dataTemplate>
    and P_SD is one parameter that i created in BI Publisher.
    and below is my packages (Spec and Body) :
    SPEC :
    CREATE OR REPLACE package PRODIN.pkg_rep_bip
    as
    v_where_clause varchar2(10000);
    function f_where_clause (p_sd varchar2)return boolean;
    end pkg_rep_bip;
    BODY :
    CREATE OR REPLACE package body PRODIN.pkg_rep_bip as
    function f_where_clause (p_sd varchar2)return boolean is
    begin
    if p_sd = 'Y' then
    v_where_clause := ' where re=11';
    else
    v_where_clause := ' where re=24';
    end if;
    return true;
    end f_where_clause;
    end;
    More detail problem is when parameter P_SD = Y (i assigned in BI PUblisher) the result always go to (v_where_clause := ' where re=24'). Any help/answer really appreciate.. Many thanks..

    It seems that Reports help is wrong ( or imprecise).
    Eg. if we have:
    select &p_select
      from dept
    where &p_where
    and the initial values for the parameters are:
    p_select: deptno, dname
    p_where: 1 = 2
    and the code in the Before Reports trigger is the following:
    function BeforeReport return boolean is
    begin
      :p_select := 'deptno, ''abcde'' ';
      :p_where := '1 = 1';
      return (TRUE);
    end;
    we get all the rows (where 1 = 1) and we get the value 'abcde' in the field "dname".
    However, try to move your code from the Before Report trigger to After Parameter Form trigger.
    Regards,
    Zlatko

  • Lexical Parameter in report 10g

    i want to call a report with few fields on my form. i create 2 user parameter which works fine. now i want to create a lexical parameter so that if null no problem report should appear with 2 user parameters but if has values then report should be called according to those parameter values.
    I use this in my form:
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'PBRANCHCODE='||:txtBranchCode||' PPERIOD='||:cmbPeriod||' CLASSCONDITION='||'cla_class_id between 1 and 2'||' paramform=no');
    CLASSCONDITION is a lexical parameter which is called in report sql:
    and periodic_branch_id = :pBranchCode
    and periodic_period_from = :pPeriod
    &ClassCondition
    it says unable to run report
    when i test using paramform=no then it shows in classcondition parameter only and and nothing after space assuming parameter list ended.
    Please help me in passing a lexical parameter to report
    Thanx in advance.

    I want to append the where condition of the report. if values inputed from Form in the class ids from and to text boxes appended as a where condition in the report query otherwise excluded
    Report Query
    select *
    from ...
    where
    and .....
    and ....
    &ClassCondition
    and i want to pass &classcondition parameter the below condition
    and class_id between :fromclass and :toclass
    Hope you understand.

  • How to use lexical parameter in report

    i want to use lexical parameter in report and pass parameter from form how it is possible in detail
    A.R

    Hi,
    typically you fill your lexical paramter in the after-paramform-trigger out of the values of your bind-parameters (giving end users directly control over lexical parameters might not be a good idea). Inside PL/SQL a lexical parameter is referenced like bind parameters with ":". In the query it's referenced via "&" and represents a part of the query.
    A simple example.
    - p_deptno as bind parameter
    - p_where as lexical paramter
    - end user choose value for p_deptno (10,20,... or nothing)
    - Trigger: if :p_deptno is not null then
    :p_where := 'WHERE deptno = :p_deptno'
    else
    :p_where := null;
    end if;
    - Query select ... from emp &p_where
    Regards
    Rainer

  • Calling report from form with lexical parameter

    hi
    DECLARE
         repid REPORT_OBJECT;
         v_rep VARCHAR2(1000);
         rep_status VARCHAR2(20);
    BEGIN
              repid := FIND_REPORT_OBJECT( 'REPORT34' );
              set_report_object_property(repid,report_other,'p_SEASON_YEAR='||:SALE_ORDER.SEASON_YEAR
              ||' &sort='||:sale_order.sort1);
              --set_report_object_property(repid,report_other,'p_g_id =20');
              v_rep := RUN_REPORT_OBJECT(repid);
              rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    --Display report in the browser
    WEB.SHOW_DOCUMENT('http://127.0.0.1:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    PAUSE;
    END;i had made a lexical parameter in reports the reports code is
    SELECT s.season_year,sd.prod_id,P.PROD_NAME,sum(sd.total_qty)
    FROM sale_order s,sale_order_detail sd,PRODUCT P,CUSTOMER_MASTER cm,CUSTOMER_DETAIL cd
    where s.id=sd.id and P.PROD_ID=SD.PROD_ID AND s.season_year = :p_season_year
    AND CD.CUST_ID=CM.CUST_ID AND CD.CUST_ID=S.CUST_ID AND CD.COUNTRY NOT LIKE 'SPA%' AND Sd.PROD_ID LIKE  'CA%'
    group by s.season_year,sd.prod_id,P.PROD_NAME
    &sortthanks and regards
    vikas

    Vikas,
    So, is your code producing an error when your report is called? Also, it would be helpful to know your Forms and Reports versions. Is ":p_season_year" set up as a USER_PARAMETER (UP) in your report or is it a true lexical parameter (meaning you should reference it with '&' instead of ':')? If it is a UP, the typical way to pass a value to this UP from Forms is to use a ParamList object instead of the REPORT_OTHER parameter of the Set_Report_Object_Property built-in. For example:
    DECLARE
       pl_id    ParamList;
       pl_name  VARCHAR2(10) := 'REPORT34';
       v_rep VARCHAR2(1000);
       rep_status VARCHAR2(20);
    BEGIN
       pl_id := Get_Parameter_List(pl_name);
       IF id_null(pl_id) THEN
          pl_id := Create_Parameter_List(pl_name);
       END IF;
       Add_Parameter(pl_id, 'P_SEASON_YEAR', TEXT_PARAMETER, :SALE_ORDER.SEASON_YEAR);
       repid := FIND_REPORT_OBJECT( 'REPORT34' );
       v_rep := RUN_REPORT_OBJECT(repid, pl_id);
       ...  rest of your code here  ...
    END;Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Lexical Parameter help

    Hello,
    In my beforereport trigger, I have Lexical parameter defined as:
    :LP_CUSIP := 'WHERE F.TS_CUSIP = SUBSTR(A.FUND_CUSIP,1,9) AND F.TS_CUSIP = SUBSTR('||''||:PM_FUND||''||',1,9)
    But It gives a REP-1401 :'beforereport': Fatal PL/SQL error occured.
    ORA-06502 : PL/SQL : numeric or value error.
    But the query works fine with :
    where
    f.ts_cusip = substr(a.FUND_CUSIP,1,9)
    and f.ts_cusip = SUBSTR('351899992000',1,9)
    Any help would be appreciated.
    Thanks.

    hi,
    How are you building the query in the data model?
    I'd do this in the data model:
    select
    from
    where ...(another conditions you have or 1=1) &lp_cusip
    And in the "after parameter form",I'd put this code:
    :LP_CUSIP := 'and F.TS_CUSIP = SUBSTR(A.FUND_CUSIP,1,9) AND F.TS_CUSIP = SUBSTR('||''''||:PM_FUND||',1,9)'||'''';
    aguero
    ================
    Gives the compilation error

  • Reg: passing wdEvent as a parameter .

    Hi All,
    I have a event handler method in my view. I am calling that method in some other method in the same view based on one condition by passing wdEvent as a parameter bcozz event handler methods have wdEvent as a parameter.
    for this I did
    com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent1 = null;
    wdThis.from_Summary_to_Individual( wdEvent1 );
    Can we do like this ? But it is giving error. What could be the reason.
    Is it bcozz I set it to null or other reason?
    Thanks in advance.

    Hi,
    Do you really need this parameter wdEvent for you processing?
    If not create a custom method and call if from both the places.
    You can create this method from the methods tab of the view.
    Regards
    Ayyapparaj

  • Lexical Parameter in subquery?

    Is it possible?
    select * from ( select a,b,c from t where &p_where ) where a>1
    It doesn't seem to like this construct - is there a proper way to do this? p_where will be built based on the parameters selected at runtime.
    Thanks,
    stephan

    Did you supply an initial value for "p_where"? If it is NULL, your sub-query will be invalid because Reports Builder will see it as (note the missing where condition):
    select * from ( select a,b,c from t where  ) where a>1You could supply an initial value such as "1=1", or, you could remove the key word "where" from the subquery and put it in the lexical parameter:
    select * from ( select a,b,c from t &p_where ) where a>1Ah, I see dmars beat me to the punch.
    Message was edited by:
    Brian Hill

  • Lexical Parameter in Oracle Reports . . .

    Hi all,
    I am trying to pass a value to a query in oracle reports . . .
    the use of the parameter is to add 2 additional columns to an existing query, if a bind parameter is set to 'Yes' else the parameter carries a value NULL;
    Here is the code I have written in After Parameter Form:
    if :P_ROLL_DETAIL_PRN='Yes' then
    :P_CUSTOM_CODE:=NULL;
    :P_CUSTOM_CODE:=:P_CUSTOM_CODE||'wdd.LOT_NUMBER' ||','||'wdd.SUBLOT_NUMBER';
    else
    :P_CUSTOM_CODE:='';
    end if;
    P_Roll_detail is the bind parameter . . and P_CUSTOM_CODE is the Lexical Parameter . ..
    It works for value 'No' of P_ROLL_DETAIL .. . but for Value 'Yes' I get an error . . .
    REP-0499: Column '' selected by the query is incompatible with report defination
    Kindly help...
    Regards
    Jagan

    Lexical parameters can not be used to change the number of selected columns. Consider selecting max number of columns always, but populating last two columns with either NULL values or table columns based on the parameter. Also, manipulations can be done in the layout model using format triggers.

  • Lexical parameter in bi report

    Hi All,
    I have a requirement as below :
    I have a select query in my XML file which is returning two rows for a order
    ex: select email,fax,order_number from
    oe_order_headers_all
    hz_contact_points,
    My requirement is i need to pass 3 parameters such as order_number, email, fax to the report in that case it should take only the parameters what i am passing, and it should not take the hz_contact_points table from the query
    so i need to achieve this through lexical parameter, any one please help me on this.
    Thanks

    i think you didn't read that i'm mentioned
    in datatemplate
    <parameters>
    <parameter name="P_YOUR_PARAM" dataType = "number" defaultValue="0"></parameter>
    </parameters>
    <sqlStatement name="Q_DATA">
    <![CDATA[
    select &your_columns
    from  &your_tables
    where &your_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReportTrigger" source="XX_YOUR_PKG.BeforeReport"/>
    <dataStructure>
    ...in package
    FUNCTION BeforeReport RETURN BOOLEAN IS
    BEGIN
    IF P_YOUR_PARAM = 'some_value' THEN
      your_columns := 'column1, column2';
      your_tables := 'table1, table2';
      your_where_clause := 'table1.id = table2.id';
    ELSE
      your_columns := 'column3, column4';
      your_tables := 'table2, table3';
      your_where_clause := 'table2.id = table3.id';
    END IF;
    END;you can use another way - create your xml output by package like
    fnd_file.put_line(fnd_file.output, '<ROWSET>');
    fnd_file.put_line(fnd_file.output, '<ROW>');
    fnd_file.put_line(fnd_file.output, '<DAT>' || some_value || '</DAT>');
    fnd_file.put_line(fnd_file.output, '</ROW>');
    fnd_file.put_line(fnd_file.output, '</ROWSET>');in package you can use all that you want

  • Lexical Parameter in Reports 6i Program Unit

    A report I'm writing requires me to use the lexical parameter in a program unit rather than a query in the data model. Lexical parameters in a query have always worked with the example "WHERE &my_parameter". But using "WHERE :my_parameter" or "WHERE &my_parameter" in a program unit gave me the error "expression is of wrong type" so the code wouldn't compile in the editor.
    The parameter returns "segment1 = '8675309' AND segment2 = 'Jenny'I was able to resolve it by using the first column of the expression and the replace function on the parameter so the program unit editor thinks it's a valid expression and the resulting line is a valid predicate that gets the correct data. Here's my example:
    WHERE segment1 = replace(:my_parameter, 'segment1 = ')The replace function strips off the "segment1 = " from the lexical parameter so the resulting line that gets passed to the server is:
    WHERE segment1 = '8675309' AND segment2 = 'Jenny'This solution will not work where the parameter could return something other than "segment1 = " at the beginning of the parameter string like "segment1 BETWEEN " or a different column name to compare other than segment1. Anyway, this is working but if there are better ways to do it I'd like to try them. Using Reports 6i with EBS 11.5.10.2.

    Hello,
    You'll find explanations and examples here :
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwwhthow/whatare/dmobj/sq_a_lexical_references.htm
    This documentation is for Reports 10.1.2 but is valid for Reports 6i too ...
    Regards

  • Multiple where conditions in one parameter

    Hi,
    Is it possible to have more than one where condition in one parameter?
    For example, my WHERE_CLAUSE parameter holds the value "where id='12345' and name='john smith'"
    when i run the report, I get a [052008_033528064][][EXCEPTION] java.lang.NullPointerException at oracle.apps.xdo.dataengine.DataTemplateParser.getObjectVlaue(Unknown
    Source) Thus the sql statement did not execute.
    But if I change the WHERE_CLAUSE to "where id='12345'" or "where name='john smith'" it works fine.
    My observation is that if there are two where conditions, BI publisher wont allow it. Am I correct?
    But the report has to be open to the possibility of having more than one where clause condition. Is there a work around for this?
    Thanks,
    Shanak

    nope your mistaken. bip will handle multiple joins.
    1. make sure the where_clause parameter is defined in your package.
    2. make sure use & syntax
    3. make sure your sql is not malformed. This is probably the issue.
    4. also, read my article on bind variables. the practice of coding the actual value in a where clause should be avoided at all costs. Causes the query execution plan to be reparsed each time that particular query is executed.
    http://bipublisher.blogspot.com/2007/10/bi-publisher-what-lexical-understanding.html
    Ike Wiggins
    http://bipublisher.blogspot.com/

Maybe you are looking for

  • How Can I Search for Media files by Length?

    I want know how can I search for media files (mov, mp4, flv and movie files in general) by their length? If this search function is confirmed as definitely not possible on the OS, I would appreciate someone recommending app that might be able to perf

  • Problem in creating database instance in linux through webtool

    Dear sir i got sql erroe ,when i mam trying to creat database instance.i am decrbing steps here from point of start. Initially i invke two command 1:/opt/sdb/programs/bin/x_server 2:/etc/rc.d/init.d/maxdbweb start then i invoke web application as:htt

  • What is Multicasting?

    Grid Version: 11.2 OS : AIX 6.1 I come across articles on RAC on AIX where the term Multicasting is frequently referenced. (For eg: thread like below) NICs for Private Interconnect redundancy When I googled it , i found articles like below which hasn

  • Trouble importing from P2 card from Panasonic HPX300 camera

    I shot footage on a Panasonic HPX300 camera and when I choose Log and Transfer to get the footage from my P2 card, the warning message: "AVC-Intra codec not found" comes up. The tech support people told me over the phone that FCP isn't recognizing th

  • Tables parameters are obsolete

    hi,       i am trying to create one function module in ecc6.0 version. And after declaration under tables table like "errortable like bapiret2" i am getting the warning "tables parameters are obsolete". please help me to solve this problem.