Hi,
I have created a function that will accept multiple values for a parameter.
I have added a textbox to the body where I want to display the values of the
parameter but for some reason it only shows the first value.
Why and how can I resolve it?
Thanksim also facing the same prob...
Did u get any solution for this...
Thanks,
"collie" wrote:
> Hi,
> I have created a function that will accept multiple values for a parameter.
> I have added a textbox to the body where I want to display the values of the
> parameter but for some reason it only shows the first value.
> Why and how can I resolve it?
> Thanks|||What kind of function is it? Are you storing comma separated values for that
parameter?
"Chandra" wrote:
> im also facing the same prob...
> Did u get any solution for this...
> Thanks,
>
> "collie" wrote:
> > Hi,
> >
> > I have created a function that will accept multiple values for a parameter.
> > I have added a textbox to the body where I want to display the values of the
> > parameter but for some reason it only shows the first value.
> > Why and how can I resolve it?
> >
> > Thanks|||Thanks for the response. Below is the function I am using.
CREATE FUNCTION dbo.UDF_CharCommaSeparatedListToTable
(
@.CommaSeparatedList VARCHAR(8000)
)
RETURNS @.ParsedTableValue TABLE (TableValue VARCHAR(1000))
AS
BEGIN
DECLARE @.TableValue VARCHAR(1000)
DECLARE @.Pos INT
SET @.CommaSeparatedList = LTRIM(RTRIM(@.CommaSeparatedList))+ ','
SET @.Pos = CHARINDEX(',', @.CommaSeparatedList, 1)
IF REPLACE(@.CommaSeparatedList, ',', '') <> ''
BEGIN
WHILE @.Pos > 0
BEGIN
SET @.TableValue = LTRIM(RTRIM(LEFT(@.CommaSeparatedList, @.Pos - 1)))
IF @.TableValue <> ''
BEGIN
INSERT INTO @.ParsedTableValue (TableValue)
VALUES (RTRIM(@.TableValue))
END
SET @.CommaSeparatedList = RIGHT(@.CommaSeparatedList,
LEN(@.CommaSeparatedList) - @.Pos)
SET @.Pos = CHARINDEX(',', @.CommaSeparatedList, 1)
END
END
RETURN
END
In the sp I am using it as follows:
--
where
(@.Paramregion IS NULL OR t.region in (Select stringval from dbo.CSVTABLE
(@.Paramregion)))
"Vipul Shah" wrote:
> What kind of function is it? Are you storing comma separated values for that
> parameter?
> "Chandra" wrote:
> > im also facing the same prob...
> > Did u get any solution for this...
> > Thanks,
> >
> >
> > "collie" wrote:
> >
> > > Hi,
> > >
> > > I have created a function that will accept multiple values for a parameter.
> > > I have added a textbox to the body where I want to display the values of the
> > > parameter but for some reason it only shows the first value.
> > > Why and how can I resolve it?
> > >
> > > Thanks|||Didn't find a solution. Did u?
"Chandra" wrote:
> im also facing the same prob...
> Did u get any solution for this...
> Thanks,
>
> "collie" wrote:
> > Hi,
> >
> > I have created a function that will accept multiple values for a parameter.
> > I have added a textbox to the body where I want to display the values of the
> > parameter but for some reason it only shows the first value.
> > Why and how can I resolve it?
> >
> > Thanks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment