Passing multiple values to a parameter in report
Can anyone help me how to pass multiple parameters to a parameter in my report.
As user is able to select multiple values from list of values , can I pass the selected values to calling function.
Suppose if User selects Value1,Value2,Value3 from list of values of a parameter P_Org,
I need to pass all these values to parameter P_Org in my Before Trigger Function in Discoverer reproting tool.
Thanks in advance
I have a Before trigger Function to which the parameters will be passed.
Suppose if User selects multiple values for a parameter then how to pass these multiple Values to that parameter?
eg:In first Workbook Before Trigger is fired and the paramters for the trigger are
'par1','par2','par3' etc.
If User selects multiple values for a parameter 'par1' from the list of values displayed then how to pass all these values to 'par1' in Function?
After firing the trigger rows are inserted in a temp_table .My second Workbook will
fetch the rows inserted in this Temp Table.
I hope u understood what my requirement is...
Thanks in advance
Similar Messages
-
How to passing multiple values for a parameter of discoverer(url parameters
Hi All,
I am trying to pass multiple values for a parameter of disco report. I am trying to include my url for discoverer viewer report. the values has the following
'jeff,mark'
'sfophiee,angela'
Thanks and Regards
VenkatHello Venkat,
I know there are some problems with 10.1.2.0.2, maybe if you haven't done yet you can try with 10.1.2.2, assuming this version should be working for multiple parameter values :
OracleAS Discoverer 10.1.2.2 is installed with the following patch :
Patch 4960210 PLACEHOLDER BUG FOR AS/DS 10G R2 PATCH SET 2 10.1.2.2
So, once installed you can try adding your parameter as param_<parameter_name>='sfophiee,angela'
Hope this helps, otherwise feel free to log a Service Request to Support.
Best Regards,
Gianluca -
Passing multiple values in a parameter through IN operator
hello everyone,
i want to know wheather it is possible to pass multiple values to a report parameter and use the parameter in the query with the IN operator.
I feel this should be possible but dont know the way.
Pls helpi have also suffered from this problem. you can solve it by creating a table like
create table abc
id number,
value number;
then follow the steps.
1) insert all the values in this table by incrementing id and values
2) then pass lowest id and larget id to the report
3) now in report use the select statement like
SELECT * FROM AAA WHERE ABC IN (SELECT VALUE FROM ABC WHERE ID BETWEEN V_MAX AND V_MIN)
4) IN THE REPORT'S AFTER TRIGGER, YOU HAVE TO DELETE
THESE TEMPORARILY CREATED ROWS
LIKE
DELETE ABC
WHERE ID BETWEEN V_MAX AND V_MIN;
SO THIS WILL SOLVE YOUR PROBLEM. -
How to pass multiple values from master to child report
Hello,
How would I pass multiple prompts from the master to child report? So for example, say I want to pass a 'Country' value along with a 'City' value
Would it be?
="<a href=\"../../opendoc/openDocument.jsp?iDocID=ASQlgCemIOlEid1HHUlzyPs&sDocName=DocTest&sIDType=CUID&sType=wid&sWindow=Same&lsSCountry="+[Country]+"&lsSCity="+[City]+"\</a>"
Thanks,
CarterCarter,
what is the syntax for this?
It is exactly how you have posted in your original note.
"&lsSCountry="+[Country]+"&lsSCity="[City]
This will work providing the target report has a prompt called "Country" and another prompt called "City". Note that your prompt and what you pass between the &lsS and the equal (=) must match exactly, otherwise OpenDocument will not communicate the prompt title to InfoView properly and InfoView will stop and execute the prompt to get the info it needs before running the report. Have you tried what you've posted originally to see if it executes without a problem?
Thanks,
John -
Pass multiple values with IN parameter in stored procedure
CREATE TABLE VTEST_INSERT (
MY_ID NUMBER,
COLUMN1 VARCHAR2(50)
--SELECT * FROM VTEST_INSERT;
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (1,'TEST1');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (2,'TEST2');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (3,'TEST3');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (4,'TEST4');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (5,'TEST5');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (1,'TEST6');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (2,'TEST7');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (3,'TEST8');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (4,'TEST9');
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (5,'TEST10');
CREATE OR REPLACE
PROCEDURE VTEST_INSERT_SP(vid IN VARCHAR2,vname IN VARCHAR2)
AS
BEGIN
DELETE FROM VTEST_INSERT WHERE MY_ID IN (vid);
INSERT INTO VTEST_INSERT (MY_ID,COLUMN1) VALUES (vid,vname);
END;
EXEC VTEST_INSERT_SP(1,'TEST999');
This all works fine above. But I want to be able to pass in multiple vname values. so something like:
EXEC VTEST_INSERT_SP(1,'TEST999','TEST888','TEST777');
all help appreciated. thank you.
This would do multiple inserts each with the same vid and the different vname values.Try something like this
SET SQLBLANKLINES ON;
ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL';
DROP TABLE vtest_insert;
CREATE TABLE vtest_insert(vid NUMBER, vname VARCHAR2(20));
INSERT ALL
INTO vtest_insert(vid, vname) VALUES(1, 'aaaa')
INTO vtest_insert(vid, vname) VALUES(1, 'bb')
INTO vtest_insert(vid, vname) VALUES(1, 'cccccc')
INTO vtest_insert(vid, vname) VALUES(2, 'ddd')
INTO vtest_insert(vid, vname) VALUES(2, 'ee')
SELECT * FROM "PUBLIC".dual;
SELECT * FROM vtest_insert;
CREATE OR REPLACE TYPE vnames_tab_ty IS TABLE OF VARCHAR2(20)
SHOW ERRORS;
CREATE OR REPLACE PROCEDURE vtest_insert_sp
p_vid IN vtest_insert.vid%TYPE,
p_vnames IN vnames_tab_ty
AUTHID DEFINER
IS
BEGIN
DELETE FROM vtest_insert WHERE vid = p_vid;
FORALL idx IN p_vnames.FIRST .. p_vnames.LAST
INSERT INTO vtest_insert(vid, vname) VALUES(p_vid, p_vnames(idx));
END vtest_insert_sp;
SHOW ERRORS;
<<bk>>
DECLARE
vnames vnames_tab_ty;
vid vtest_insert.vid%TYPE;
BEGIN
bk.vid := 1;
bk.vnames := vnames_tab_ty('vn-01', 'vn-02', 'vn-03');
vtest_insert_sp(p_vid=>bk.vid, p_vnames=>bk.vnames);
COMMIT;
bk.vid := 2;
bk.vnames := vnames_tab_ty('vn-04', 'vn-05', 'vn-06', 'vn-07');
vtest_insert_sp(p_vid=>bk.vid, p_vnames=>bk.vnames);
COMMIT;
END;
SELECT * FROM vtest_insert;
Which produces the following output
Table created.
5 rows created.
VID VNAME
1 aaaa
1 bb
1 cccccc
2 ddd
2 ee
Type created.
No errors.
Procedure created.
No errors.
PL/SQL procedure successfully completed.
VID VNAME
1 vn-01
1 vn-02
1 vn-03
2 vn-04
2 vn-05
2 vn-06
2 vn-07
7 rows selected.
SQL>
Regards,
Dariyoosh -
Post Author: ckwizard77
CA Forum: Crystal Reports
HELP!!
I have been knocking my head against a wall trying to figure out how to pass multiple values to 1 parameter and how to add it to the parameter collection. I have code so if I pass single values for each parameter it works fine. I am passing the parmeters and values in a pipe delimited string through a url where it gets parsed and pass in here.
Any help would be greatly appreciated.
Here is the single param code:
Public Sub SetParamValues(ReportName, strParamName, ParamValue) Dim i,reportInterface, ParamName,strSubReprotName,CurrentValues Set reportInterface = reportObject.PluginInterface("") Set reportParameters = result.Item(1).PluginInterface("Report").ReportParameters For i=1 to reportParameters.Count if ReportName <>"" then strSubReprotName=reportInterface.ReportParameters.Item(i).ReportName if strSubReprotName=ReportName then ParamName = reportInterface.ReportParameters.Item(i).ParameterName if ucase(ParamName)=Ucase(strParamName) then Set CurrentValues = reportInterface.ReportParameters.Item(i).CurrentValues CurrentValues.Clear() Dim newSingleParameter Set newSingleParameter = ReportInterface.ReportParameters.Item(i).CreateSingleValue newSingleParameter.Value = ParamValue reportInterface.ReportParameters.Item(i).CurrentValues.Add newSingleParameter reportInterface.ReportParameters.Item(i).PromptOnDemandViewing=false iStore.Commit result End if End if Else ParamName = reportInterface.ReportParameters.Item(i).ParameterName Set param1 = reportInterface.ReportParameters.Item(i) if Ucase(ParamName)=UCase(strParamName) then Set CurrentValues = reportInterface.ReportParameters.Item(i).CurrentValues CurrentValues.Clear() Set newSingleParameter = ReportInterface.ReportParameters.Item(i).CreateSingleValue newSingleParameter.Value = ParamValue reportInterface.ReportParameters.Item(i).CurrentValues.Add newSingleParameter reportInterface.ReportParameters.Item(i).PromptOnDemandViewing=false iStore.Commit result End if End if NextEnd SubThat Makes sense.
thanks a lot !
Well now are at it, mind if I ask you another quick question:
If I make an option in the multiselect list called ALL which should return all the results:
as should act like this
select * from dept;
you solution was:
select * from dept
where INSTR(':'||:P1_EMPNO||':', ':'||empno ||':') > 0
Can I modify this to return all the rows ? -
Passing a value to a Parameter Field From a VB Form
Post Author: as1971
CA Forum: General
Hello everyone
I'm using Visual Basic 6.0 and Crystal Report 9.0
I built a report using Crystal Report and named it Player_Statement.rpt. I then included it to my VB project and named it Player_Statement.Dsr
In this report I have a Parameter Field called P_Player_ID which I'm using in Record Selection Formula.
I'm using the following code to pass a value to the parameter:
Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue CLng(cmbPlayerNB.BoundText)
When I execute the application I get the error message "The value or range you are adding has already existed" at the last line of code (Where I'm assigning the parameter a value)
Could anybody help me pleasePost Author: VinoTinto
CA Forum: General
Dim Report As CRAXDRT.ReportSet Report = New Player_StatementReport.GetItemByName("P_Player_ID").ClearCurrentValueAndRange Report.ParameterFields.GetItemByName("P_Player_ID").AddCurrentValue = CLng(cmbPlayerNB.Boundtext) -
Passing multiple values to a parmeters in SQL Query
Hi friends,
I have the following requirement -
I need to pass multiple values to the parameter 'WHERE hou.name = (:id1)' and the query is copied below for your reference .
SELECT partno part_num,
customer customer_name,
hou.name op_name
FROM hr_organization_units hou,
oe_transaction_types_all sot,
ra_customers rc,
ra_addresses_all ra,
ra_site_uses_all rsu,
oe_order_headers_all h,
oe_order_lines_all l,pwr_sod50 ps
WHERE hou.name = (:id1)
-- and hou.name = (:id4)
--hou.name in ('CPS FRANCE','CPS GERMANY')
--and hou.name = (:id1,hou.name)
and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
and ps.group_id = 9999999
and hou.organization_id=h.org_id
and ps.line_id =l.line_id
and l.header_id =h.header_id
and h.invoice_to_org_id=rsu.site_use_id
and rsu.address_id =ra.address_id
and ra.customer_id =rc.customer_id
and h.order_type_id =sot.transaction_type_id
Looking for your help on this.
Thanks In Advance.
Thanks & Regards
Ramya NomulaHi karthik,
I am sorry for the wrong updation of my anonymus block.
My requirement is to pass a multiple values to the parameter in SQL query, and here is the code which is working now for the multiple values with ourt single quotes to the values -
SELECT partno part_num,
customer customer_name,
ps.customer_id customer_id,
avail_qty avail_qty,
sch_ship_date schedule_Ship_date,
so_num order_no,
h.header_id header_id,
line_num line_no,
l.ordered_quantity ordered_quantity,
scd_qty qty_open,
s_price unit_price,
part_flag flag,
sub_inv subinv,
sbu,
hold,
qoh,
line_detail_id detail_id,
picking_line_id,
picking_line_detail_id,
rc.customer_name cust_name,
rc.customer_number customer_number,
rsu.location location,
sot.attribute5 order_type,
ps.line_id line_id,
h.transactional_curr_code transactional_curr_code,
hou.name op_name
FROM hr_organization_units hou,
oe_transaction_types_all sot,
ra_customers rc,
ra_addresses_all ra,
ra_site_uses_all rsu,
oe_order_headers_all h,
oe_order_lines_all l,pwr_sod50 ps
WHERE ','||:id1||',' like '%,'||hou.name||',%'
and trunc(ps.sch_ship_date) between nvl(:id2,trunc(ps.sch_ship_date)) and nvl(to_date(:id3)+.99999,trunc(ps.sch_ship_date))
and ps.group_id = 9999999
and hou.organization_id=h.org_id
and ps.line_id =l.line_id
and l.header_id =h.header_id
and h.invoice_to_org_id=rsu.site_use_id
and rsu.address_id =ra.address_id
and ra.customer_id =rc.customer_id
and h.order_type_id =sot.transaction_type_id;
Condition for sending multiple Oprtaing Units -
WHERE ','||:id1||',' like '%,'||hou.name||',%'
This above condition is working when i am passing multiple values with out single quotes...but not working for multiple values with single quotes.
Sample queries tested -
select 1 from dual where ',aa,bb,cc,' like '%,bb,%' (This is working)
select 1 from dual where ','aa','bb','cc',' like '%,'bb',%'(This is not working).
Thanks In Advance!
Looking for Your Great Help.
Thanks & Regards
Ramya Nomula -
About passing multiple values in parameter for oracle report
https://docs.google.com/file/d/0B0dx7wf68mD0QzdpbWU4UGNURTQ/edit
Hi all,
i want to pass multiple value using , to separate them 1,2,3....
here is my query
SELECT DISTINCT
oh.header_id
,oh.org_id
,to_char(oh.ordered_date,'DD-MON-YYYY') d_date
,to_char(oh.ordered_date+31,'DD-MON-YYYY') d_validity
,oh.ship_to_org_id
,oh.invoice_to_org_id
,oh.cust_po_number d_po_num
,rcust.customer_id AS customer_id
,oh.order_number d_salesorder_no
,oh.cust_po_number d_project
,oh.attribute1 second_addr
,oh.attribute2 remark1
,oh.attribute3 remark2
,substr(oh.transactional_curr_code,1,3) as currency
,tyl.name ordertype
,oh.salesrep_id
,rat.name as d_payment_term
,rat.description d_payment_desc
,rsa.name
,rsa.email_address as sales_phone
,rcust.customer_name||' - #'||rcust.customer_number d_to_custname
,rcust.customer_name d_cust_sign
,rcust.attribute1
,rcust.customer_number
-- ,raddr.ship_to_flag
,oh.sold_to_contact_id AS attn_id
,rcust.party_id
,tyl.name AS SO_type
-- ,net_org.ORG_LOGO
FROM
oe_order_headers_all oh
,ra_customers rcust
,ra_addresses_all raddr
,ra_site_uses_all rsite --double_line
,ra_terms rat
,hz_party_sites hps
,hz_contact_points hcp
,ra_salesreps_all rsa
,oe_transaction_types_tl tyl
-- ,apps.ar_contacts_v acv
-- ,net_org
WHERE oh.sold_to_org_id = rcust.customer_id
AND oh.payment_term_id = rat.term_id(+)
--AND rcust.customer_id = acv.customer_id(+)
AND oh.salesrep_id = rsa.salesrep_id
AND oh.order_type_id = tyl.transaction_type_id
AND rcust.party_id = raddr.party_id
AND raddr.address_id = rsite.address_id
AND rcust.party_id = hps.party_id
AND hps.party_site_id = hcp.owner_table_id(+)
AND hcp.owner_table_name(+) = 'HZ_PARTY'
--AND hcp.contact_point_type (+)='PHONE'
AND tyl.LANGUAGE = userenv('LANG')
--AND raddr.ship_to_flag IS NULL
AND upper(tyl.name) in ('SW SALES CONTRACT','SW-NSC SALES CONTRACT','TILES SALES CONTRACT','VBP SAMPLE ORDER', 'VBP INTERNAL ORDER')
AND oh.order_number =:P_CONTRACT_NO
and oh.org_id = :P_ORG_ID
--and net_org.org_id = :P_ORG_ID
&CP_Param
and after para form
function AfterPForm return boolean is
begin
:CP_Param := 'where oh.order_number in ('||:P_CONTRACT_NO||')';
return (TRUE);
end;
it said ora-00933 but my query can run i dont need the multiple values para, can anyone help me how to modify the report so it can pass multipel values thanksHI I tried changing the parameter width to a larger value, it can output , and the field where I show the order_number i used source P_CONTRACT_NO,
it will display as 102005000,102005001 and I also tried using the column from the query directly, it will be separated , it has some other problem
I have the header part and main part,
and also there are page numbering, with the order number field set as order_number it will output single number , but the page order is wrong
102005000,102005001 will be like header page: 102005000 1/4 102005001 2/4, main page 102005000 3/4, 102005001 3/4
DO you have any idea how I can set the page numbering setting so it will output as header page:102005000 1/2 102005000 2/2
header page:102005001 1/2 102005001 2/2
?? thanks -
Any way to pass Multiple Values for a single Label in the Parameter?
I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"
One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter.
PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.
Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.
QUESTION:
Any way to pass Multiple Values for a single Label in the Parameter?
I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting
it correct.
I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….
Note: We are using Report Builder 3.0Based on my experience, there's no way to 'intercept' the query that gets passed back to SQL Server, so a Split wouldn't work.
Try creating either a function or stored procedure using the code below (compliments to
http://www.dotnetspider.com/resources/4680-Parse-comma-separated-string-SQL.aspx) to parse the string:
CREATE FUNCTION dbo.Parse(@Array VARCHAR(1000), @Separator VARCHAR(10))
RETURNS @ResultTable TABLE (ParseValue VARCHAR(100))AS
BEGIN
DECLARE @SeparatorPosition INT
DECLARE @ArrayValue VARCHAR(1000)
SET @Array = @Array + @Separator
WHILE PATINDEX('%' + @Separator + '%' , @Array) <> 0
BEGIN
SELECT @SeparatorPosition = PATINDEX('%' + @Separator + '%', @Array)
SELECT @ArrayValue = LEFT(@Array, @SeparatorPosition - 1)
INSERT @ResultTable VALUES (CAST(@ArrayValue AS VARCHAR))
SELECT @Array = STUFF(@Array, 1, @SeparatorPosition, '')
END
RETURN
END
Once created you can do things like this:
SELECT * FROM Parse('John,Bill,David,Thomas', ',')
SELECT * FROM (SELECT 'John' AS TestName union select 'David' AS TestName) AS Main
WHERE TestName IN (SELECT ParseValue FROM dbo.Parse('John,Bill,David,Thomas', ','))
This is what your SQL query would probably look like:
SELECT OperationID, OperationName FROM dbo.Operations
WHERE AreaID IN (SELECT ParseValue FROM dbo.Parse(@Area, ','))
You may need to fiddle around with the Separator depending on whether SQL Server inserts a space between the comma and next value. -
Passing multiple values to report
Hi,
I have a parameter form. One of the field will have at least one value. When it have more than one value, the values will be separate by a comma and pass to the report. Please tell me how separate them and put them in quotation in the report query.
EX: the values are: PO, DR
There will be in the where condition as: where code in ('PO', 'DR');
Thank you in advance.
ps. I am using 10g
Edited by: 945599 on Jul 10, 2012 2:04 PMHello,
Forms does not allow user to select multiple values from a list item!
The purpose of the LIST ITEM is to provide a list of values for data entry. Since data entry is for a single row of data, the LIST ITEM allows a single value to be selected. Selecting multiple values in the LIST ITEM for a single value item on a single record is not the function of a LIST ITEM.
So, if you need to select multiple values from a field and pass them through a single parameter to report, i will present you two methods to achieve this!
First Method is the text item Method:
Stept 1:
Create the text item with the values you need to send to reports.
Step 2:
Create 2 visual attributes.One visual attribute is for selected values and the other one is for deselected values
Step 3:
Create a parameter, in forms parameter layouts which will hold the selected value.This parameter will be used to set the report query clause.
Step 4:
Create a trriger for the item which you created at step 1. An example is when-mouse-click trriger.In the body of the trriger,if the item instance is clicked you will modify its visual attribute and the parameter created at step 3 will receive the item instance value.
Step 5:
In reports create a user lexical parameter(which is a large text parameter ex 2000).Ex. P_Clause.The value of this parameter is the value recrived for the form parameter you created at step 3. You report query will be like this: select * from table where &P_Clause!
Second Method is the checkbox Method:
Stept 1:
Create a checkbox item near the text item with the values you need to send to reports.
Step 2:
Create a parameter, in forms parameter layouts which will hold the selected value.This parameter will be used to set the report query clause.
Step 3:
Before you call run_report_object proc, you will need to loop through records and build you parameter with the selected checkbox instances!
Step 4:
In reports create a user lexical parameter(which is a large text parameter ex 2000).Ex. P_Clause.The value of this parameter is the value recrived for the form parameter you created at step 3. You report query will be like this: select * from table where &P_Clause!
Hope this helps.
Regards,
Alex -
Passing multiple values to a single input parameter
Hi folks,
I have a Microstrategy query successfully passing input parameter to a calculation view. For example I can pass a movement type to a material movements calculation view input parameter. However if I try to pick more than one movement type the query then fails;
Generated SQL that works looks like this;
select
sum(a11.TOTALQUANTITY) WJXBFS1
from
"_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
('PLACEHOLDER' = ('$$MoveType$$', '101')
a11
When choosing more than one value in Microstrategy the SQL now fails and looks like this;
select
sum(a11.TOTALQUANTITY) WJXBFS1
from
"_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
('PLACEHOLDER' = ('$$MoveType$$', '101'),
'PLACEHOLDER' = ('$$MoveType$$', '103'))
a11
If I cut and paste the SQL and run directly in HANA studio the error is;
Could not execute 'select sum(a11.TOTALQUANTITY) WJXBFS1 from "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER" ...' in 66 ms 361 µs .
SAP DBTech JDBC: [2048]: column store error: search parameter error: [2018] A received argument has an invalid value;TABLE/VIEW parameter: ( 'PLACEHOLDER'='$$MoveType$$, 103') not supported
Is it possible to pass multiple values in a single parameter? I'm using SP67 for this test.
Thanks,
-PatrickRavi, also to answer one of your questions about how this will work in Microstrategy; I just heard back from my Microstrategy developer and he is trying MSTR Freeform SQL query with syntax like this;
select (sumPAR_TEST.TOTALQUANTITY TOTALQUANTITY
from "_SYS_BIC"."MyPackage/CA_TEST_PASS_PARAMETER"
('PLACEHOLDER' =('$$MoveType$$', '[Movement Type]')) PAR_TEST
In this example [Movement Type] is the microstrategy prompt. Unfortunately though it translates like this which is missing extra single quotes around each value;
select sum(PAR_TEST.TOTALQUANTITY) TOTALQUANTITY
from "_SYS_BIC"."development.pr1959/CA_TEST_PASS_PARAMETER"
('PLACEHOLDER' = ('$$MoveType$$', ''101', '102'')) PAR_TEST
instead of what we need which is;
('PLACEHOLDER' = ('$$MoveType$$', '''101'', ''102''')) PAR_TEST
So at this point we are not sure if this will be possible or not.
-Patrick -
Passing multiple values to another page via a sql report
Having trouble passing multiple values to another page via a popup SQL report
I have two fields one called "descr" and another called "Met"
when I use the code below all works fine and the value of "descr" is passed
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE:'
|| descr
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
can someone look at my code below and see what may be wrong
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE,P950_CODE:'
|| descr, Met
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
I appeciate your help looking into this
FYI (Here is the entire SQL for reference)
With t
as
(SELECT
CASE WHEN KEY = 2 then
CASE WHEN WCS_CPT > :P940_METRIC_1_WCS_CPT1 then
'<span style="color:Red; ">'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_CPT,'FML999G999G999G999G990D00')||'</span>' end "WCSCPT",
CASE WHEN KEY = 2 then
CASE WHEN WCS_TOI_PER_FTE < :P940_METRIC_2_WCS_TOI_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_TOI_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSTOIPERFTE",
CASE WHEN KEY = 2 then
CASE WHEN WCS_SIO_PER_FTE < :P940_METRIC_3_WCS_SIO_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_SIO_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSSIOPERFTE",
CASE WHEN KEY = 2 then
CASE WHEN WCS_TC_PER_FTE < :P940_METRIC_4_WCS_TC_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_TC_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSTCPERFTE",
CASE WHEN KEY = 2 then
CASE WHEN WCS_ADSL_PER_FTE < :P940_METRIC_5_WCS_DSL_PER_FTE then
'<span style="color:Red; ">'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'</span>' else
'<span style="color:#399304; ">'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'</span>' end
else '<span style="color:#180c8b;">'||TO_CHAR(WCS_ADSL_PER_FTE,'999G999G999G999G990')||'</span>' end "WCSADSLPERFTE",
CASE WHEN KEY = 2 THEN
TO_CHAR(MONTH,'MON-YY')
else
'METRICS'
end "MONTH"
FROM (
SELECT DISTINCT
ROW_NUMBER() OVER (ORDER BY KEY DESC) AS ROW_NUM, KEY, WCS_CPT, WCS_TOI_PER_FTE, WCS_SIO_PER_FTE, WCS_TC_PER_FTE, WCS_ADSL_PER_FTE, MONTH
from TW_M_KEYMETRICS
WHERE TO_DATE(UPPER(MONTH),'DD/MON/YY') >= TO_DATE(UPPER(:P940_START_OF_THIS_FIN_YEAR),'DD/MON/YY')
ORDER BY KEY ASC, ROW_NUM, MONTH)
WHERE ROW_NUM <= :P940_MONTHS_SINCE_FIN_START)
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_METRIC_TYPE,P950_METRIC_VALUE:descr,MET'
|| ''
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
, max(Met) METRICS, max(Jul) Jul08, max(Aug) Aug08, max(Sep) Sep08, max(Oct) Oct08, max(Nov) Nov08, max(Dec)Dec08, max(Jan) Jan08, max(Feb) Feb08, max(Mar) Mar08, max(Apr) Apr08, max(May) May08, max(Jun) Jun08
from (
Select 'Cost Per Transaction' descr,
decode (MONTH, 'METRICS', WCSCPT) MET,
decode (MONTH, 'JUL-08', WCSCPT) Jul,
decode (MONTH, 'AUG-08', WCSCPT) Aug,
decode (MONTH, 'SEP-08', WCSCPT) Sep,
decode (MONTH, 'OCT-08', WCSCPT) Oct,
decode (MONTH, 'NOV-08', WCSCPT) Nov,
decode (MONTH, 'DEC-08', WCSCPT) Dec,
decode (MONTH, 'JAN-08', WCSCPT) Jan,
decode (MONTH, 'FEB-08', WCSCPT) Feb,
decode (MONTH, 'MAR-08', WCSCPT) Mar,
decode (MONTH, 'APR-08', WCSCPT) Apr,
decode (MONTH, 'MAY-08', WCSCPT) May,
decode (MONTH, 'JUN-08', WCSCPT) Jun
from t
union all
Select 'Total Orders Issued Per FTE' descr,
decode (MONTH, 'METRICS', WCSTOIPERFTE) MET,
decode (MONTH, 'JUL-08', WCSTOIPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSTOIPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSTOIPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSTOIPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSTOIPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSTOIPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSTOIPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSTOIPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSTOIPERFTE) Mar,
decode (MONTH, 'APR-08', WCSTOIPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSTOIPERFTE) May,
decode (MONTH, 'JUN-08', WCSTOIPERFTE) Jun
from t
union all
Select 'SIOs Per Billing FTE' descr,
decode (MONTH, 'METRICS', WCSSIOPERFTE) MET,
decode (MONTH, 'JUL-08', WCSSIOPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSSIOPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSSIOPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSSIOPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSSIOPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSSIOPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSSIOPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSSIOPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSSIOPERFTE) Mar,
decode (MONTH, 'APR-08', WCSSIOPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSSIOPERFTE) May,
decode (MONTH, 'JUN-08', WCSSIOPERFTE) Jun
from t
union all
Select 'Total Calls Answered per FTE' descr,
decode (MONTH, 'METRICS', WCSTCPERFTE) MET,
decode (MONTH, 'JUL-08', WCSTCPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSTCPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSTCPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSTCPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSTCPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSTCPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSTCPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSTCPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSTCPERFTE) Mar,
decode (MONTH, 'APR-08', WCSTCPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSTCPERFTE) May,
decode (MONTH, 'JUN-08', WCSTCPERFTE) Jun
from t
union all
Select 'ADSL Orders per FTE' descr,
decode (MONTH, 'METRICS', WCSADSLPERFTE) MET,
decode (MONTH, 'JUL-08', WCSADSLPERFTE) Jul,
decode (MONTH, 'AUG-08', WCSADSLPERFTE) Aug,
decode (MONTH, 'SEP-08', WCSADSLPERFTE) Sep,
decode (MONTH, 'OCT-08', WCSADSLPERFTE) Oct,
decode (MONTH, 'NOV-08', WCSADSLPERFTE) Nov,
decode (MONTH, 'DEC-08', WCSADSLPERFTE) Dec,
decode (MONTH, 'JAN-08', WCSADSLPERFTE) Jan,
decode (MONTH, 'FEB-08', WCSADSLPERFTE) Feb,
decode (MONTH, 'MAR-08', WCSADSLPERFTE) Mar,
decode (MONTH, 'APR-08', WCSADSLPERFTE) Apr,
decode (MONTH, 'MAY-08', WCSADSLPERFTE) May,
decode (MONTH, 'JUN-08', WCSADSLPERFTE) Jun
from t
GROUP by descr
FrankBorg Species 5618 wrote:
Having trouble passing multiple values to another page via a popup SQL report
But when I want to pass another value, all goes bonkers and instead of the value of the field being passed the literal text is passed.
can someone look at my code below and see what may be wrong
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE,P950_CODE:'
|| descr, Met
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
Hi Frank,
You should close this parameters with single quotation. Try this -
Select '<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:950:&SESSION.::&DEBUG.::'
|| 'P950_TYPE,P950_CODE:'
*|| 'descr, Met'*
|| ''', 790, 460);"style="color:darkred; font-weight: bold;font-size: 90%">'
|| descr
|| '</a>' "Note"
Hope this helps.
Regards,
M Tajuddin
http://tajuddin.whitepagesbd.com -
Passing multiple values to the QUERY BDOC parameter?
hi All,
Below is my Query BDOC Anchor Before Query Execute even handler... I'm trying to pass multiple values to the bq.Z_PartnerFunction query parameter... i.e.
PARTNER_FCT in( '00000012','ZDIVMGR','ZAREADR')
is it possible without creating new Query Bdoc ?
====================================
Private Sub aempchoicewinTCWSearchTAnchor_beforeQueryExecute(ByRef bq As BusinessQuery, ByRef cancel As Boolean)
If Not bq Is Nothing Then
If sWcDummy = "Yes" Then
bq.WcDummy = sWcDummy
End If
bq.Z_PartnerFunction = "00000012"
If ctrlZ_Territory.Value <> "" Then
bq.PRNB_TerrID = "*" & ctrlZ_Territory.Value
End If
End If
End Sub
================================
Thanks in advance
HetalHi,
it looks that you already enhanced the query BDoc because you have a new query parameter bq.Z_PartnerFunction, right?
To which BDoc parameter is this BQ parameter mapped? And how looks the related where clause?
For a single filter normally a "=" operator is used. Therefore your example with "in" won't work.
If these three partner functions are fixed then you might hardcoded them directly in the where clause (supposed the BDoc is not used somewhere else where you don't want to have this filter).
Or you might add 3 new BDoc parameters, add 3 new where clauses using a disjunction for them (and using an embracing bracket). In this case always all these 3 BQ parameters need to be filled (or all stay empty) to avoid a SQL syntax error.
Regards,
Wolfhard -
Pass multiple values as single input parameter into pipelined function
Hi all,
My need is to pass multiple values as single input parameter into pipelined function.
For example - "2" and "3" are values of input parameter "t":
with data as (
select 1 as t from dual union all
select 2 as t from dual union all
select 3 as t from dual union all
select 4 as t from dual union all
select 5 as t from dual
select * from data where t in (2,3)Is it possible at all?Not exactly sure, but usually 'multiple values'+'pipelined function' = some IN-LIST related approach?
See:
SQL> create table data as
2 select 1 as t from dual union all
3 select 2 as t from dual union all
4 select 3 as t from dual union all
5 select 4 as t from dual union all
6 select 5 as t from dual;
Table created.
SQL> --
SQL> CREATE OR REPLACE FUNCTION in_list (p_in_list IN VARCHAR2)
2 RETURN sys.odcivarchar2list PIPELINED
3 AS
4 l_text VARCHAR2(32767) := p_in_list || ',';
5 l_idx NUMBER;
6 BEGIN
7 LOOP
8 l_idx := INSTR(l_text, ',');
9 EXIT WHEN NVL(l_idx, 0) = 0;
10 PIPE ROW (TRIM(SUBSTR(l_text, 1, l_idx - 1)));
11 l_text := SUBSTR(l_text, l_idx + 1);
12 END LOOP;
13
14 RETURN;
15 END;
16 /
Function created.
SQL> --
SQL> select *
2 from data
3 where t in ( select *
4 from table(in_list('1,2'))
5 );
T
1
2
2 rows selected.http://www.oracle-base.com/articles/misc/dynamic-in-lists.php
or
http://tkyte.blogspot.nl/2006/06/varying-in-lists.html
Maybe you are looking for
-
How to add New Menu Bar using Custom.pll
Hi All, I have developed a form based on the Oracle Apps form.For standard form i have to add one more menu bar in tools menu using custom.pll,i'm using 11.5.8 version. So can any one help me in thi regards as i'm new to this custom.pll,How can we ad
-
Same query returns differenent result sets in oracle 9i and 10g
Could anyone please clarify the issue i am having on a query. I have query that is returning around 2000 records in oracle db 9.2.0.8.0, at the same time with same data if run on 10.2.0.1.0 is returning only 12 records. what might be the reason for t
-
Required configuration in a way that CENVAT clearing A/C is debited/credited same no. of times while doing MIGO/MIRO, or a transaction in which clearing of this account is possible.
-
I trust that everyone saw/received one of those e-mails, that are an html document (from a store as an example). Is it possible to do that with iWeb? Design a page and export it as an html-e-mail? Thank you.
-
Optimization PDF, make compatible with
With Acrobat Pro, there is a command(order) (as we can make File, Register(Record) for example) in programming, to make the equivalent of: optimization PDF, Make compatible with and to choose a previous version of acrobat?