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
Similar Messages
-
Can we use formula column in lexical parameter in sql query ...
hi
can we use formula column in lexical parameter in sql query ...
as example
i want to give
select * from & c_table
forumula
function c_table
if :p_sort = 1 then
return 'dept'
else
return 'emp'
end;
c_table formula column
is this possible ...
i have such example in oracle apps reports
if i try in ordinary report usinf emp table it show error ..
how we can give formula column...
please help me in this regard...
Edited by: 797525 on Feb 20, 2012 9:31 PMthanks sir,
iam not exactly saying select * from &c_table but some thing that like columns in select stmt also will be populated in user_parameters ,there are lot of table select.......from mtl_demand md, mtl_system_items msi, mtl_txn_source_types mtst, mtl_item_locations loc &C_source_from &C_from_cat
&c_source_from and &c_from_cat formula column and there are defined at report level only ......
pl/sql code &c_source_from is
function C_source_fromFormula return VARCHAR2 is
begin
if :P_source_type_id = 2 then return(',MTL_SALES_ORDERS mkts');
else if :P_source_type_id = 3 then return(',GL_CODE_COMBINATIONS gl');
else if :P_source_type_id = 6 then return(',MTL_GENERIC_DISPOSITIONS mdsp');
else if :P_source_type_id = 5 then
if :C_source_where is null then
return NULL;
else
return(',WIP_ENTITIES wip');
end if;
else if :P_source_type_id = 8 then return(',MTL_SALES_ORDERS mkts');
else if :P_source_type_id is null then
return(',MTL_SALES_ORDERS mkts,
MTL_GENERIC_DISPOSITIONS mdsp,
GL_CODE_COMBINATIONS gl ');
else null;
end if; end if; end if; end if; end if; end if;
RETURN NULL; end;
this is forumula column i hope that you understand what iam saying
please help me in this regard....
thanking you... -
Lexical parameter in select statement showing null or column name in xml tag instead of value
Hi,
i am using lexical parameter in report select statement as
Select &order value from oe_order_headers_all a where order_number ='7889'
and setting : order:='a.order_number'; in after parameter form trigger.
lexical parameter intial value set to null
when i run this report , its not showing order number in output ,its showing null or a.order_number as text.
Please help.try this
Select &order data_show
from oe_order_headers_all
where order_number ='7889'
and setting :order:='order_number'; in after parameter form trigger.
Hope this helps
Hamid -
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
vikasVikas,
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. -
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 -
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 MasonDont 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.
YingI 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]
-
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
JaganLexical 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.
Thanksi 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 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. -
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 -
Generation of XML Tags for columns in Lexical parameter in select query
Hi,
I have lexical parameter in my select statement of my data model in the report.
How do i generate XML tags for these columns inside a Lexical Parameter?
Simple Example: I have data model query as follows:
SELECT msi.inventory_item_id
&LP_SELECT
FROM mtl_system_items_b
Here my lexical Parameter LP_SELECT is generated in before report trigger as follows in my report:
:LP_SELECT := 'msi.segment1,msi.description';
So, the question is how to generate XML Tags for columns in Lexical Parameter(as in the example above, i need XML tags for these columns - segment1 and description)
Thanks,
Ratantry this
Select &order data_show
from oe_order_headers_all
where order_number ='7889'
and setting :order:='order_number'; in after parameter form trigger.
Hope this helps
Hamid -
Trying to use lexical parameter in ORDER BY
I'm using BIP in EBS and I have a report that needs to be sorted based on parameters selected in conc. pgm. I'm trying to use lexical parameters to accomplish this, however, it's not working. I have defined my lexical parameter in Package Spec and I'm setting it accordingly in Package Body(BeforeReport trigger). In my data template (dataQuery section) I have the following SQL
SELECT 'AP_BANK_ACCOUNTS_ALL' as "table_audit2",
a.bank_account_id,
to_char(a.audit_timestamp,'DD-MON-YYYY HH:MI P.M.'),
a.audit_transaction_type ,
a.audit_user_name,
a.bank_account_name,
a.bank_account_num,
a.account_type,
a.org_id,
a.bank_branch_id,
a.xxap_field_changed,
a.xxap_new_value,
a.xxap_old_value,
b.bank_name,
d.short_name
FROM xxap_bank_accounts_all_gtmp a,
ap_bank_branches b,
hr_organization_information c,
gl_sets_of_books d
WHERE a.bank_branch_id = b.bank_branch_id
AND a.org_id = c.organization_id
AND c.org_information_context = 'Operating Unit Information'
AND c.org_information3 = d.set_of_books_id
ORDER BY &lv_order_by
The IF statments below are being used in package to set lexical parameter
note: p_order_by_1 & 2 are from conc.pgm
IF p_order_by_1 IS NOT NULL
THEN
lv_order_by := to_char(p_order_by_1);
lv_order_1 := 'Y';
END IF;
IF p_order_by_2 IS NOT NULL
THEN
IF lv_order_1 = 'Y'
THEN
lv_order_by :=lv_order_by||','||to_char (p_order_by_2);
lv_order_2 := 'Y';
ELSE
lv_order_by := to_char(p_order_by_2);
lv_order_2 := 'Y';
END IF;
END IF;
Any help will be greatly appreciated!!!! I'm a newbie to EBS and BIP so you can probably imagine how frustrated I am.
Message was edited by:
user631051The conc. pgm completes successfully but my report is not sorted. Data Template below:
<properties>
<property name="include_parameters" value="true" />
<property name="include_null_Element" value="true" />
<property name="xml_tag_case" value="upper" />
<property name="db_fetch_size" value="500" />
<property name="scalable_mode" value="off" />
<property name="include_rowsettag" value="false" />
<property name="debug_mode" value="off" />
</properties>
<parameters>
<parameter name="p_start_date" dataType="date"/>
<parameter name="p_end_date" dataType="date"/>
<parameter name="p_org_id" dataType="number"/>
<parameter name="p_data_priority" dataType="character"/>
<parameter name="p_include" dataType="character"/>
<parameter name="p_account_type" dataType="character"/>
<parameter name="p_order_by_1" dataType="character"/>
<parameter name="p_order_by_2" dataType="character"/>
<parameter name="p_order_by_3" dataType="character"/>
</parameters>
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT 'AP_BANK_BRANCHES' as "table_audit1", a.bank_branch_id as "bank_branch_id",
to_char(a.audit_timestamp,'DD-MON-YYYY HH:MI P.M.') as "audit_timestamp",
a.audit_transaction_type as "audit_transaction_type", a.audit_user_name as "audit_user_name",
b.bank_name as "bank_name", b.bank_branch_name as "bank_branch_name",
to_char(b.bank_number) as "bank_number", a.active_date as "active_date", a.xxap_field_changed,
a.xxap_new_value, a.xxap_old_value
FROM xxap_bank_branch_gtmp a,
ap_bank_branches b
WHERE a.bank_branch_id = b.bank_branch_id
]]>
</sqlStatement
<sqlStatement name="Q2">
<![CDATA[SELECT 'AP_BANK_ACCOUNTS_ALL' as "table_audit2",
a.bank_account_id as "bank_account_id",
to_char(a.audit_timestamp,'DD-MON-YYYY HH:MI P.M.') as "audit_timestamp",
a.audit_transaction_type as "audit_transaction_type",
a.audit_user_name as "audit_user_name",
b.bank_name as "bank_name",
a.bank_account_name,
a.bank_account_num as "bank_account_num",
a.account_type as "account_type",
to_char(a.org_id) as "org_id",
a.bank_branch_id as "bank_branch_id",
a.xxap_field_changed,
a.xxap_new_value,
a.xxap_old_value,
d.short_name as "short_name"
FROM xxap_bank_accounts_all_gtmp a,
ap_bank_branches b,
hr_organization_information c,
gl_sets_of_books d
WHERE a.bank_branch_id = b.bank_branch_id
AND a.org_id = c.organization_id
AND c.org_information_context = 'Operating Unit Information'
AND c.org_information3 = d.set_of_books_id
ORDER BY &lv_order_by
]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReportTrigger" source="XXAP_RPT_BANK_AUDIT_EXT_PKG.BeforeReport"/>
<dataStructure>
<group name="G_Bank_Branches" source="Q1">
<element name="table_audit1" value="table_audit1"/>
<element name="bank_branch_id" value="bank_branch_id"/>
<element name="audit_timestamp" value="audit_timestamp"/>
<element name="audit_transaction_type" value="audit_transaction_type"/>
<element name="audit_user_name" value="audit_user_name"/>
<element name="bank_name" value="bank_name"/>
<element name="bank_branch_name" value="bank_branch_name"/>
<element name="bank_number" value="bank_number"/>
<element name="active_date" value="active_date"/>
<element name="xxap_field_changed" value="xxap_field_changed"/>
<element name="xxap_new_value" value="xxap_new_value"/>
<element name="xxap_old_value" value="xxap_old_value"/>
</group>
<group name="G_Bank_Accounts_All" source="Q2">
<element name="table_audit2" value="table_audit2"/>
<element name="account_type" value="account_type"/>
<element name="bank_account_id" value="bank_account_id"/>
<element name="audit_timestamp" value="audit_timestamp"/>
<element name="audit_transaction_type" value="audit_transaction_type"/>
<element name="audit_user_name" value="audit_user_name"/>
<element name="bank_name" value="bank_name"/>
<element name="bank_account_name" value="bank_account_name"/>
<element name="bank_account_num" value="bank_account_num"/>
<element name="org_id" value="org_id"/>
<element name="xxap_field_changed" value="xxap_field_changed"/>
<element name="xxap_new_value" value="xxap_new_value"/>
<element name="xxap_old_value" value="xxap_old_value"/>
<element name="short_name" value="short_name"/>
</group>
</dataStructure>
</dataTemplate> -
Lexical parameter in SELECT INTO (Very Urgent)
I have to write a query which takes some value & put it into a variable. but i have to use lexical parameter in my query.
e.g
select sal into v_sal
from emp
where deptno=20 &p_lexpara;
the form amd report builder do not compile this syntax & give error on &p_lexpara
Pl. help me out
ThanksIn Report Builder you can not use clause INTO.
Correct one is:
select sal
from emp
where deptno=20 &p_lexpara
In Forms you can not use lexical parameter but you can create lexical parameter in CREATE_GROUP_FROM_QUERY. So you can create record group in this way and then use lexical parameter like:
DECLARE
rg_name VARCHAR2(40) := 'Salary';
rg_id RecordGroup;
errcode NUMBER;
BEGIN
** Make sure group doesn't already exist
rg_id := Find_Group( rg_name );
** If it does not exist, create it and add the two
** necessary columns to it.
IF Id_Null(rg_id) THEN
rg_id := Create_Group_From_Query( rg_name,
'select sal from emp where deptno=20 '||p_lexpara;
END IF;
** Populate the record group
errcode := Populate_Group( rg_id );
END;
and then with Get_Group_Number_Cell you can retrive values of SAL e.g something like:
status := Populate_Group( rg_id );
*/ *** Zero status is success*** /
IF status = 0 THEN
match := Get_Group_Number_Cell('Salary.SAL',1);
Message('The Salary is '||to_CHAR(match));
ELSE
Message('Error creating query record group.');
RAISE Form_Trigger_Failure;
END IF; -
Hi all
i need to make a dynamic report using lexical parameter but in the SQL Part when I write the SQL(select name,ID from &p_where)
it gives me syntax error ....i tired to use report query builder also telling me query builder not support lexical parameter....i need help in that matter please..To use lexical parameters in Reports, use need to specify a default value. If you don4t do this, Reports will return an error. Hope that helps you.
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by wafaa ahmed:
Hi all
i need to make a dynamic report using lexical parameter but in the SQL Part when I write the SQL(select name,ID from &p_where)
it gives me syntax error ....i tired to use report query builder also telling me query builder not support lexical parameter....i need help in that matter please..<HR></BLOCKQUOTE>
null
Maybe you are looking for
-
Java not loading up in firefox 15.0.1 but says is installed
I had to re-install Firefox 15.01 because I some issues with new fire Fox 16.01. When I re-installed Firefox and kept my currents profile, I had to re-install Java. I installed both the 32 bits and 64 versions, Java show it is installed but none of t
-
Error when launch MaxDB studio for first time
Dear, Experts I faced with one issue for launch MaxDB studio for first time. It reported: Connect user failed SAP DBTech JDBC: Cannot connect to jdbc:sapdb://.../.UMDB [Restart required]. Creating default user management failed Could not create datab
-
Is there a way to improve a photocopied picture?
Hi, I would appreciate some help here. Is there a simple way to improve the look of photocopies of family pictures? Scanning did't happen and now I don't have possesion of the family album. I have started to scan in the photocopies and they look Ok,
-
Hello Everybody, My question is about workflow. I need to manage automatically the correspondence between people. Letters, Document to validate, document to be signed, document to check which are managed manually today. The actual scenario is : I nee
-
OCA Next Level Certification.
Hi, This is Udhayakumar, i have completed 1Z0-007-ENU: Introduction to Oracle9i: SQL alone. Now i would like to continue further level in this certification, so i need know the following clarifications: 1. What are the next levels after this to compl