473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Passing Multiple values in stored procedure

I need to know a way to pipe the output of an sql (select )statement to a stored procedure.
Eg:
The stored procedure is sp_rsch_filters param1,param2,param3

Requirement is to pass param1,param2 and param3 from user X.
Feb 28 '08 #1
6 2137
Delerna
1,134 Expert 1GB
Sorry I am confused
You begin by asking
I need to know a way to pipe the output of an sql (select )statement to a stored procedure.

and finish with
Requirement is to pass param1,param2 and param3 from user X.

can you clarify the question for me please?
do you want to pass a recordset or parameters?
Feb 28 '08 #2
Sorry I am confused
You begin by asking
I need to know a way to pipe the output of an sql (select )statement to a stored procedure.

and finish with
Requirement is to pass param1,param2 and param3 from user X.

can you clarify the question for me please?
do you want to pass a recordset or parameters?
--------------------------------------------------------------------------------------------------------------------well

i want to create a stored procedure in which i pass more than one values in one
variable
Feb 28 '08 #3
Delerna
1,134 Expert 1GB
do you mean like this
Expand|Select|Wrap|Line Numbers
  1. exec prMyProc 'val1,val2,val3,val4'
  2.  
where the procedure is
Expand|Select|Wrap|Line Numbers
  1. CREATE PROC prMyProc @PramVar varchar(1000)
  2. AS
  3. --code to extract the values from @PramVar
  4. GO
  5.  
Feb 28 '08 #4
do you mean like this
Expand|Select|Wrap|Line Numbers
  1. exec prMyProc 'val1,val2,val3,val4'
  2.  
where the procedure is
Expand|Select|Wrap|Line Numbers
  1. CREATE PROC prMyProc @PramVar varchar(1000)
  2. AS
  3. --code to extract the values from @PramVar
  4. GO
  5.  
-------------------------------------------------------------------------------------------------------
yes i need this

Kindly send me complete code

thanx

please send me complete o
Feb 29 '08 #5
Delerna
1,134 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. exec prMyProc 'val1,val2,val3,val4'
  2.  
where the procedure is

Expand|Select|Wrap|Line Numbers
  1. CREATE PROC prMyProc @PramVar varchar(1000)
  2. AS
  3.    declare @V1 varchar(10), @V2 varchar(10), @V3 varchar(10), @V4 varchar(10)
  4. set @V1= left(@Param,charindex(',',@Param)-1)
  5. set @Param= right(@Param,len(@Param)-charindex(',',@Param))
  6. set @V2= left(@Param,charindex(',',@Param)-1)
  7. set @Param= right(@Param,len(@Param)-charindex(',',@Param))
  8. set @V3= left(@Param,charindex(',',@Param)-1)
  9. set @V4= right(@Param,len(@Param)-charindex(',',@Param))
  10.  
  11. --do whatener it is that you are going to do with @V1,@V2,@V3,@V4
  12.  
  13. GO
  14.  
Feb 29 '08 #6
Delerna
1,134 Expert 1GB
now that I've given you that, I have a question
Why wouldn't you just do this

Expand|Select|Wrap|Line Numbers
  1. exec prMyProc val1,val2,val3,val4
  2.  
where the procedure is

Expand|Select|Wrap|Line Numbers
  1. CREATE PROC prMyProc @v1 varchar(10), @v2 varchar(10) @v3 varchar(10) @v4 varchar(10)
  2. AS
  3. --do whatener it is that you are going to do with @V1,@V2,@V3,@V4
  4.  
  5. GO
  6.  
Feb 29 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bob | last post by:
I'm new to Access projects and SQL server and am not a veteran VB programmer. There's a cry for help! I'm attempting to print the current form on screen by using a command button which the user...
7
by: Anne | last post by:
hie there, i want to be able to pass multiple parameters to another page. currently, i am able to do so, but somehow i feel it is not the correct way to do it. below is part of what i have so far....
14
by: Microsoft | last post by:
I know how to call a finction and pass a parameter to it, but I don;t understand how to take the resulting output of the function and use it from the subroutine that called the function ...
12
by: Dennis D. | last post by:
Hello: I want a function to return three variables to the calling procedure: Private Function CalcTimes(ByVal iAddDays as Integer, ByVal iAddHours as Integer, ByVal iAddMins as Integer) As...
1
by: chariclark | last post by:
This may be a quick fix post... ---------------------------- I am having trouble passing multiple values into stored procedure. Here it is below: CREATE Procedure spGetAssociateds ( @PDSI...
3
by: shara | last post by:
Hello there, I want to pass multiple values selected in a select box(HTML) to another php page.I tried doing in several ways but of no use.Can anybody please help me with this. The code i used...
0
by: Mervin Harshal | last post by:
I need to know a way to pipe the output of an sql (select )statement to a stored procedure. Eg: The stored procedure is sp_rsch_filters param1,param2,param3 Requirement is to pass param1,param2...
2
by: hemantc87 | last post by:
i have created this function with a parameter offset and i want to access the database using stored procedure but the code and stored procedure i have written below is not working...what is the right...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.