Parameter Passing By Value
Okay here is the deal Say i have a class called "CUSTOMERINFO" and in this class there are attributes such as first and last name..
okay now in the main class i create an instance.. Now i want to send it to a method to have another "CUSTOMERINFO" equal the same values as the first, but don't want them pointing at the same memory block.. therefore they are 2 separate entities and i can change one with out affecting the other.. I know there is a way i just can't find the syntax on the net.. its something like "METHODA(ByVal String newValue){}
THANKS
Try this
public class CustomerInfo
private firstName = "";
private lastName = "";
public CustomerInfo(String firstName , String lastName)
this.firstName = firstName
this.lastName = lastName
public String getFirstName()
return firstName;
public String getLastName()
return lastName;
} // End CustomerInfo class
public class SameInfo
private firstName = "";
private lastName = "";
public void setFirstName()
this.firstName = firstName;
public void setLastName()
this.lastName = lastName;
} // End SameInfo class
public class Driver
public static void main(String[] args)
CustomerInfo customerOne = new CustomerInfo("Bob", "Dole")
SameInfo anotherPerson = new SameInfo();
anotherPerson.setFirstName(customerOne.getFirstName())
anotherPerson.setLastName(customerOne.getLastName());
}
Similar Messages
-
Parameter passing by value or by reference in function module
hi everybody:
Im a beginner for abap.
Below description is described in online help.
In function module, the CALL FUNCTION statement can pass import, export, and changing parameters either by value or by reference. Table parameters are always transferred by reference.
I understand parameters passing by value means values carried by parameters are transferred, but I do not understand what is "by reference".
Please kindly give me a explanation.
Regards.
Andyhi,
Function modules are modular units with interfaces. The interface can contain the following elements:
Import parameters are parameters passed to the function module. In general, these are assigned
standard ABAP Dictionary types. Import parameters can also be characterized as optional.
Export parameters are passed from the function module to the calling program. Export parameters
are always optional and for that reason do not need to be accepted by the calling program.
Changing parameters are passed to the function module and can be changed by it. The result is
returned to the calling program after the function module has executed.
Exceptions are used to intercept errors. If an error triggers an exception in a function module, the
function module stops. You can assign exceptions to numbers in the calling program, which sets the
system field SY-SUBRC to that value. This return code can then be handled by the program.
By reference Passes a pointer to the original memory location. Very efficient
By value Allocates a new memory location for use within the subroutine. The memory is freed when the subroutine ends. Prevents changes to passed variable
By value and result Similar to pass by value, but the contents of the new memory is copied back into the original memory before returning. Allows changes and allows a rollback
When you pass a parameter by reference, new memory is not allocated for the value. Instead, a pointer to the original memory location is passed. All references to the parameter are references to the original memory location. Changes to the variable within the subroutine update the original memory location immediately.
1 report ztx1804.
2 data f1 value 'A'.
3
4 perform s1 using f1.
5 write / f1.
6
7 form s1 using p1.
8 p1 = 'X'.
9 endform.
The code in Listing produces the following output:
X
Hope this helps, Do reward. -
How to get each value from a parameter passed like this '(25,23,35,1)'
Hi
One of the parameter passed to the function is
FUNCTION f_main_facility(pi_flag_codes VARCHAR2) return gc_result_set AS
pi_flag_codes will be passed a value in this way '(25,23,35,1)'
How to get each value from the string
like 25 first time
23 second time
35 third time
1 fourth time
I need to build a select query with each value as shown below:-
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3, code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 25 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q1,
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3,code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 23 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q2,
(SELECT t2.org_id, RTRIM(xmlagg(xmlelement(e, t4.description || ';')
ORDER BY t4.description).EXTRACT('//text()'), ';') AS DESCRIPTION
from org_name t2, ref_org_name t3,code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 35 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date
group by t2.org_id) q3,
(SELECT t2.org_id, t4.description
from org_name t2, ref_org_name t3, code_table t4
where t2.att_data = t4.code
and t3.ref_code = t2.att_type
and t2.att_type = 1 and t3.code_type = t4.code_type
and to_date('01-JAN-10', 'DD-MON-YY') between t2.att_start_date AND t2.att_end_date) q4
Please help me with extracting each alue from the parm '(25,23,35,1)' for the above purpose. Thank You.chris227 wrote:
I would propose the usage of regexp for readibiliy purposes and only in the case if this doesnt perform well, look at solutions using substr etc.
select
regexp_substr( '(25,23,35,1)', '\d+', 1, 1) s1
,regexp_substr( '(25,23,35,1)', '\d+', 1, 2) s2
,regexp_substr( '(25,23,35,1)', '\d+', 1, 3) s3
,regexp_substr( '(25,23,35,1)', '\d+', 1, 4) s4
from dual
S1 S2 S3 S4
"25" "23" "35" "1"In pl/sql you do something like l_val:= regexp_substr( '(25,23,35,1)', '\d+', 1, 1);
If t2.att_type is type of number you will do:
t2.att_type= to_number(regexp_substr( '(25,23,35,1)', '\d+', 1, 1))Edited by: chris227 on 01.03.2013 08:00Sir,
I am using oracle 10g.
In the process of getting each number from the parm '(25,23,35,1)' , I also need the position of the number
say 25 is at 1 position.
23 is at 2
35 is at 3
1 is at 4.
the reason I need that is when I build seperate select for each value, I need to add the query number at the end of the select query.
Please see the code I wrote for it, But the select query is having error:-
BEGIN
IF(pi_flag_codes IS NOT NULL) THEN
SELECT length(V_CNT) - length(replace(V_CNT,',','')) FROM+ ----> the compiler gives an error for this select query : PLS-00428:
*(SELECT '(25,23,35,1)' V_CNT FROM dual);*
DBMS_OUTPUT.PUT_LINE(V_CNT);
-- V_CNT := 3;
FOR L_CNT IN 0..V_CNT LOOP
if L_CNT=0 then
V_S_POS:=1;
V_E_POS:=instr(pi_flag_codes, ',', 1, 1)-1;
else
V_S_POS:=instr(pi_flag_codes,',',1,L_CNT)+1;
V_E_POS:=instr(pi_flag_codes, ',', 1, L_CNT+1)-V_S_POS;
end if;
if L_CNT=V_CNT then
V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS));
else
V_ID:=TO_NUMBER(substr(pi_flag_codes,V_S_POS,V_E_POS));
end if;
VN_ATYPE := ' t2.att_type = ' || V_ID;
rec_count := rec_count +1;
query_no := 'Q' || rec_count;
Pls help me with fetching each value to build the where cond of the select query along with the query number.
Thank You. -
Passing a value for date parameter from Oracle Forms to BIP
Hi
I have created a report with the following SQL query:
select
d_tables.d_seq,
to_date(d_tables.d_created) creation_date,
d_tables.d_created_by created_by,
d_tables.d_pk,
d_tables.table_name,
d_tables.comments
from
d_tables, d_applications
where
d_tables.d_ppk = d_applications.d_pk
and to_date(d_tables.d_created) >= nvl(:P_CRE_DATE_FROM, to_date(d_tables.d_created))
and to_date(d_tables.d_created) <= nvl(:P_CRE_DATE_TO, to_date(d_tables.d_created))
The parameters P_CRE_DATE_FROM and P_CRE_DATE_TO have been set up as date in BI Publisher with format dd-MMM-yyyy
The report works fine when launched in BI Publisher.
I want to call this report from Oracle Forms and I'm trying to pass the values for both the parameters. However, the report does not generate output based on values passed.
Does it have to do with datatype? Does anyone know a solution for this?
Kind regards,
AparnaThanks for your suggestion. I am already referring to the whitepaper and have integrated Forms with BI Publisher. The parameter passing is working fine for a varchar2 type of parameter. However, for a date type, there seems to be some problem.
-
Passing ALL values to a single parameter
In Bi Publisher Report, I need to pass 'ALL' values to a single parameter
Here is brief explanation about my requirement,
I have 3 parameters
Parameter A,
Parameter B,
Parameter C
I have to pass ALL values to last parameter i.e; Parameter C and the rest should pass only single value, how should I do that?
Any help would be greatly appreciated.
Thank youHi,
have a look here: http://www.oracle.com/global/de/community/bip/tipps/dynamische_queries/index_en.html
This might give you an idea how to work with multi-value parameters.
Regards
Rainer -
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 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) -
SSAS report action to pass multi-value list of dimention key values to a SSRS report parameter
This was originally posted on StackOverflow and suggested I try here as well.
I want to create a report action in an SSAS OLAP cube that generates a list of formatted values to pass into an SSRS report parameter that accepts a multi-valued parameter list. This would be applied at the
cell level in the SSAS action. I have found a solution that gets me most of the way:
How to Pass Multiple Values from an SSAS Report Drill Through Action to an SSRS Multi-Value Parameter, but not quite. The action does appear in Excel and works
if I run the action from a cell that is at or below the dimension attribute I am generating the list for, in this case,
Account Key.
Below is a link to a screen capture (unable to embed it due to lack of reputation) showing the action and dimension structure in Excel. The action works as long as I run it at the
Account Key level or below. I want to be able to run it at higher levels, such as
Account Major and still have it generate all then related Account Key values for the SSRS report parameter. Running it at the higher
Account Major level does not trigger the report to run.
Excel Action Screen Shot:
http://i.stack.imgur.com/QCGSp.png
Below is the MDX I am using to generate the value for the report parameter:
UrlEscapeFragment(
GENERATE(
DESCENDANTS(
[Account].[Account Key].CurrentMember,
[Account].[Account Key].[Account Key]
[Account].[Account Key].CURRENTMEMBER.Name,
"&rp:Account="
I am hoping that I can somehow modify the MDX above to make it return all the
Account Keys for any attribute of the Account dimension when ran from any measure cell, not just when ran at self and children of
Account Key in the pivot table.
Also, if it helps, I can execute the following MDX query on the cube and get the results I am looking for.
WITH MEMBER [Measures].[Account Key List] as
GENERATE(
DESCENDANTS([Account].[Account].CurrentMember, [Account].[Account].[Account]),
[Account].[Account].CURRENTMEMBER.NAME,
"&rp:Account=")
SELECT {[Measures].[Account Key List]} on 0,
([Account].[Account Company Number].[Account Company Number],[Account].[Account Major].[Account Major]
) on 1
FROM [Company 10 Action Demo]
Below are partial results:
10.116&rp:Account=10.116.010
10.117&rp:Account=10.117.010&rp:Account=10.117.020
10.120&rp:Account=10.120.005&rp:Account=10.120.006&rp:Account=10.120.010&rp:Account=10.120.020&rp:Account=10.120.030&rp:Account=10.120.040&rp:Account=10.120.050&rp:Account=10.120.060&rp:Account=10.120.380&rp:Account=10.120.999
10.123
Questions
Any ideas what I might need to do to get Account Key to be returned for any attribute of the
Account dimension?
Would I possibly have to alter my Account dimension in the cube to get this to work?
Thanks in advance.
Edit 1 - Adventure Works Cube Version
I was unable to get the suggested answer with the "Exists" function to work. To better demonstrate this issue, I have recreated it using the Adventure Works Cube.
I will focus on the Customer dimension, specifically the Customer and
Education attributes. I created a report action called Test Report Action. Below is the XML created for it in the cube.
<Action xsi:type="ReportAction" dwd:design-time-name="f35ad5ee-5167-4fb8-a0e0-0a74cc6e81c6">
<ID>Report Action 1</ID>
<Name>Test Report Action</Name>
<TargetType>Cells</TargetType>
<Target></Target>
<Type>Report</Type>
<ReportServer>SQLSERVER</ReportServer>
<Path>ReportServer?/Test Report</Path>
<ReportParameters>
<ReportParameter>
<Name>Test Customer Existing</Name>
<Value>UrlEscapeFragment(
GENERATE(
EXISTING DESCENDANTS(
[Customer].[Customer].CurrentMember,
[Customer].[Customer].[Customer]
[Customer].[Customer].CURRENTMEMBER.Name,
"&rp:Customer="
)</Value>
</ReportParameter>
</ReportParameters>
<ReportFormatParameters>
<ReportFormatParameter>
<Name>rs:Command</Name>
<Value>Render</Value>
</ReportFormatParameter>
<ReportFormatParameter>
<Name>rs:Renderer</Name>
<Value>HTML5</Value>
</ReportFormatParameter>
</ReportFormatParameters>
</Action>
Below are the steps to re-create the issue.
Connect to the cube in Excel
Add dimension Customer -> More Fields -> Customer
Add measure Internet Sales -> Internet Sales Amount
Right-click Internet Sales Amount cell, select "Additional Actions" -> "Test Report Action" and see customer values created for URL
When the action is ran at this point with Customer, I see the values created in the URL shown message box (since there is no SSRS report server at location specified).
Now the part I'm unable to resolve
Remove the Customer dimension and add Customer -> Demographic -> Education
Right-click Internet Sales Amount cell, select "Additional Actions" -> "Test Report Action"
Nothing happens. If I ran the action on the cell next to "Bachelors", I would want it to build up all the list of all the "Customers" that make up the "Bachelors" in the
Customer dimension as part of the report parameter. If no attributes where used in the cube from the
Customer dimension for that cell, then I would like it to return "All Customers", or something similar to show that all customers are included in the aggregations.
I am not too MDX savvy, thus far. I think I need to somehow join the
Customers to Internet Sales Amount in the Generate function portion. I have tried several different combinations of the
Customer dimension and Internet Sales Amount, along with various functions to see if I could get this to work with no success. I am hoping that someone more knowledgeable the me will have a solution. If you need more details,
please ask and I will provide them.Simon,
Thanks for you help with this. This morning I found a workaround. Below describes what that is.
What I ended up doing was getting a list of values from a degenerate dimension that I could use to pass to SSRS to get a list of transactions for a report. Below is how I did this, in relation to the Adventure Works cube using the degenerate dimension
Internet Order Details.
WITH MEMBER [Measures].[Order Param List] AS
GENERATE(
EXISTS([Internet Sales Order Details].[Sales Order Number].[Sales Order Number].Members, ,
"Internet Sales"),
[Internet Sales Order Details].[Sales Order Number].CurrentMember.Name,
"&rp:OrderNum=")
SELECT {[Measures].[Order Param List], [Measures].[Internet Sales Amount]} ON 0
,([Date].[Calendar].[Date]) ON 1
FROM [Adventure Works]
This will get a list of Sales Order Number in a text string, separated by "&rp:OrderNum=" for each measure of
Internet Sales. This would allow me to create an SSRS report to bring back detail information for each
Sales Order Number. Below are some sample results.
May 16, 2007 SO50493&rp:OrderNum=SO50494&rp:OrderNum=SO50495&rp:OrderNum=SO50496&rp:OrderNum=SO50497&rp:OrderNum=SO50498&rp:OrderNum=SO50499&rp:OrderNum=SO50500 $12,157.80
May 17, 2007 SO50501&rp:OrderNum=SO50502&rp:OrderNum=SO50503&rp:OrderNum=SO50504&rp:OrderNum=SO50505&rp:OrderNum=SO50506&rp:OrderNum=SO50507&rp:OrderNum=SO50508 $13,231.62
May 18, 2007 SO50509&rp:OrderNum=SO50510 $4,624.91
With this, I can then create a Report Action in SSRS with a Parameter Value of
UrlEscapeFragment(
GENERATE(
EXISTS([Internet Sales Order Details].[Sales Order Number].[Sales Order Number].Members, ,
"Internet Sales"),
[Internet Sales Order Details].[Sales Order Number].CurrentMember.Name,
"&rp:OrderNum=")
The way I was going about it before was flawed, as I was trying to get a list of the granular values from each dimension used to build the measure value and pass each one of those as separate parameters. I just needed to set something unique for each fact
measure transaction that represents the value and uses that in a query parameter for the SSRS report. -
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 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 -
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 -
SSRS passing multiple values parameter
Hi ,
I have a multi select parameter that get values from a query in my SSRS report. The report works fine if i select a single value in drop down list. When trying to select All or select a multiple value i got an error. Any help is very much appreciated.
thank you.
By the way, i'm using Query type text not an stored procedure.
Data in my @LineID parameter drop down list
Select All
Line1
Line2
Line3
up to Line15
I tried this approach and its not working. In dataset properties under parameter value expression, i made this approach
=Join(parameter!Lineid.value,",") or =parameter!Lineid.value
My Query:
Select * from sample
Where pt.Asuprodlineid IN (@LineID)1) You don't need to use JOIN in rdl pass simply "=parameter!Lineid.value".
2) And modify your query with below mentioned.
select * from sample where pt.Asuprodlineid (SELECT WG.Param FROM fn_MVParam(@LineID) WG).
It works for me. -
How to pass input value to the IN parameter in a function
Hi ,
I'm new to pl/sql programming.
The below function is used inside a package and the package is invoked in visual studio.
The function uses 2 input parameters.
Out of which 'in_report_parameter_id' value comes thru job processor service 's job request.
The second IN paramter values are hard coded in the function.
I'm not able to understand this.
If the values are hard coded , how to make sure that only the hard coded values are the right ones?
Please anyone could explain to me?
I really dont have good idea about how to pass INPUT parameter to the functions or procedure
Is there any nice document which could give me good understanding about what are the ways or types we could pass values to the input parameter in subprograms?
thanks in advance.
CREATE OR REPLACE FUNCTION get_class_text_str
in_report_parameter_id IN NUMBER,
in_which IN VARCHAR2 DEFAULT 'SELECT'
RETURN VARCHAR2
IS
end_text VARCHAR2 (50) := '';
my_class_text_str VARCHAR2(10000) := '';
my_class_value_str VARCHAR2(10000) := '';
CURSOR class_text(c_1_text VARCHAR2, c_2_text VARCHAR2) IS
SELECT c_1_text || report_parameters.report_parameter_value
|| c_2_text
|| report_parameters.report_parameter_value
|| '" '
FROM report_parameters
WHERE report_parameters.report_parameter_id = 3690
AND report_parameters.report_parameter_group = 'CLASS'
AND report_parameters.report_parameter_name = 'CLASS'
GROUP BY report_parameters.report_parameter_value
ORDER BY CAST(report_parameters.report_parameter_value AS NUMBER);
BEGIN
IF (in_which = 'SUM') THEN
OPEN class_text ( 'SUM(NVL("Class ', '", 0)) "Class ' );
ELSIF (in_which = 'PERC')THEN
OPEN class_text ( 'ROUND((("Class ', '" / "Total") * 100), 2) "Class ' );
end_text := ', DECODE("Total", -1, 0, 100) "Total" ';
ELSE
OPEN class_text ( 'SUM(DECODE(bin_id, ', ', bin_value, 0)) "Class ' );
END IF;
LOOP
FETCH class_text INTO my_class_value_str;
EXIT WHEN class_text%NOTFOUND;
my_class_text_str := my_class_text_str || ', ' || my_class_value_str;
END LOOP;
CLOSE class_text;
my_class_text_str := my_class_text_str || end_text;
RETURN my_class_text_str;
END get_class_text_str;
/Edited by: user10641405 on Nov 19, 2009 8:16 AM
Edited by: user10641405 on Nov 19, 2009 8:30 AMThis is not a design I would use, but should work if coded properly. I would probably build a reference cursor query as text and use one open fetch and close.
You have 2 input parameters, in_report_parameter_id and in_which. I could not find where in_report_parameter_id was used in the program, but the value passed in for in_which is being used in IF logic to decide how to open the cursor. After the cursor is open rows are being fetched and eventually the cursor is closed.
The values in_which are compared to are hard-coded. It is the programmer's job to make sure the values listed are the right values and the actions taken are also correct. Your program is assuming that if the first 2 values are not encountered the third one listed is the one you want.
To pass input values to a procedure you merely provide the values as a literal or variable in the call, something like
whatever := get_class_text_str(1,'SELECT'); -
Passing multi-value parameter in stored procedure ssrs
I have customer parameter which is a drop down list in my report and I have set it to "allow multiple values". This is an SSRS report.
How do I pass multiple values to my stored procedure?
RJHi ,
Create a Table valued function in SQL Functions as below
Step 1
CREATE FUNCTION [dbo].[FnSplit]
@List nvarchar(2000),
@SplitOn nvarchar(5)
RETURNS @RtnValue table
Id int identity(1,1),
Value nvarchar(100)
AS
BEGIN
While (Charindex(@SplitOn,@List)>0)
Begin
Insert Into @RtnValue (value)
Select
Value = ltrim(rtrim(Substring(@List,1,Charindex(@SplitOn,@List)-1)))
Set @List = Substring(@List,Charindex(@SplitOn,@List)+len(@SplitOn),len(@List))
End
Insert Into @RtnValue (Value)
Select Value = ltrim(rtrim(@List))
Return
END
Step 2 in your store procedure change the parameter where condition something like below
ALTER PROCEDURE [dbo].[SomeSP]
-- Add the parameters for the stored procedure here
@CostCentre NVARCHAR(255)
SELECT
[ProjectCode],[ProjectName],[ProjectManager],SUM([Hours]) AS [Hours MTD]FROM dbo.Rpt_NRMA_CATS NC
INNER JOIN PeriodID P ON NC.PeriodID=P.PeriodID
WHERE
([CostCentre]) collate database_default IN(SELECT Value FROM dbo.FnSplit(@CostCentre,','))
END
I hope this will help you.
Dasari -
Pass Multi-value Parameter from Web Page
SSRS 2012 Sp1
Developed reports working fine. They includes some cascading parameters behaviour: it means: select Parameter1, then the values are passed to the parameter2, then the selected value (parameter2) are passed to Parameter 3 and so on.
The reports in SSRS portal work fine.
Now, the clients want to run the reports from a custom web page (It is not reporting services).
in this case the user press a button and automatically the web page retrieve the data to be passed to the report.
Here the problem: although the value passed are correct, the report is not executed! Instead, the report opens waiting for user action (as if the paramters1, 2, 3 ... must be selected).
Please, do you know how to run a SSRS report from a <Custom> web page by passing the parameters?
Thanks for your helpin that case you should be passing default values for the parameters in the report and url used should be report viewer url rather than report manager url
Another way is using report viewer
see
http://cybarlab.com/call-ssrs-report-in-asp-net-project
http://bhushan.extreme-advice.com/call-ssrs-report-with-prameters-from-asp-net-web-application/
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page
Maybe you are looking for
-
Upgrading xorg and xf86-video{ati,vesa} causes Xfce to be green
warning: xf86-input-evdev: ignoring package upgrade (2.2.5-1 => 2.3.2-1) warning: xf86-input-keyboard: ignoring package upgrade (1.3.2-2 => 1.4.0-1) warning: xf86-input-mouse: ignoring package upgrade (1.4.0-2 => 1.5.0-1) warning: xf86-video-ati: ign
-
i am facing a problem with nulls getting printed from all my JSP's on the screen where the variables are not initialized to "". In weblogic, the jspc compiler has a param "printnulls" which can be set to false so that the word "null" does not get pri
-
Hi all, Anybody have idea about How to implement Slow seller Management in SAP Retail in BI? Any doc which explains how to proceed about the same. Regards R@ngzz
-
I have just started learning Dreamweaver and have bought two books on it. I am making steady progress but I do not know how to enter text into my web site in two or more columns. None of my books explain this. can any one help? Additionally, I often
-
I am attempting to query a little Oracle table. I want to get all checks that have a (maximum line number + total discount lines > 0) > 10 In the table there are these fields: discount amount, line number, check number, system date. So say there are