i am using a stored procedure to run some queries in my database. The value is taken from a query string then passed to the stored procedure. the thing is, the user may select more than 1 option that generates 3 or more query string.
e.g. http://localhost.com/test.aspx?param=76&param2=79
i know how to take the values from the query but i do i make the stored procedure accepts either 1 or 2 or 3 values kinda like overloading
e.g.
setValue (int val)
{
this.value = val;
}
setValue (double val)
{
this.value = (int) val
}
setValue (string val)
{
try
{
this.value = Integer.parseInt(val)
}
catch (Exception e)
{
System.out.println(e.getMessage());
return 0;
}
}
this is a copy of the stored procedure..
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[getSealRecordID] (@TRANSFER_ID int)
AS
-- Declare variables
SELECT DISTINCT "FGFSTRANSFERS"."CONSIDERATION", "FGFSTRANSFERS"."AMOUNT_TRANSFER", "FGFSTRANSFERS"."DATE",
"FGFSTRANSFERS"."TRANSFER_ID",
CURR = CASE "FGFSTransferDetails"."CURR"
WHEN 'USD' THEN 'United States Dollars'
WHEN 'JMD' THEN 'Jamaican Dollars'
WHEN 'CAD' THEN 'Canadian Dollars'
WHEN 'GBP' THEN 'POUNDS'
WHEN 'EUR' THEN 'EUROS'
END
,"FGFSCUSTOMERS"."CMF_NAME_1", "FGFSCUSTOMERS"."CMF_NAME_2" , "FGFSTransferDetails"."AMOUNT",
Cons_Curr = CASE "FGFSTransferDetails"."CURR" -- As Cons_Curr,
WHEN 'USD' THEN 'United States Dollars'
WHEN 'JMD' THEN 'Jamaican Dollars'
WHEN 'CAD' THEN 'Canadian Dollars'
WHEN 'GBP' THEN 'POUNDS'
WHEN 'EUR' THEN 'EUROS'
END
,"FGFSTransferDetails"."DESCRIPTION", "FGFSTransferDetails"."IMID"
FROM ("FGFSInvestment"."dbo"."FGFSTransferDetails" "FGFSTransferDetails" INNER JOIN "FGFSInvestment"."dbo"."FGFSTRANSFERS" "FGFSTRANSFERS" ON "FGFSTransferDetails"."TRANSFER_ID"="FGFSTRANSFERS"."TRANSFER_ID") INNER JOIN "FGFSInvestment"."dbo"."FGFSCUSTOMERS" "FGFSCUSTOMERS" ON "FGFSTRANSFERS"."CUSTODIAN"="FGFSCUSTOMERS"."CMF_ACCOUNT"
WHERE "FGFSTRANSFERS"."TRANSFER_ID"= @TRANSFER_ID AND "FGFSTransferDetails"."TRANSFER_ID"=@TRANSFER_ID