IT Community - Software Programming, Web Development and Technical Support

Using arrays in stored procedures

This is a discussion on Using arrays in stored procedures within the Database Support forums, part of the Web Development category; Using arrays in stored procedures i want to call a stored procedure sending array of integers as parameter now in ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-26-2007, 06:59 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Default Using arrays in stored procedures

Using arrays in stored procedures


i want to call a stored procedure sending array of integers as
parameter

now in stored procedure i want to execute

Code:

select * from Products where Prod_Code IN

(sent array)

means "sent array" stores values i want to check in query

please help
__________________
The OXYGEN
Delivers edgy, intelligent Technology to all...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-26-2007, 07:01 AM
Balasubramanian.S Balasubramanian.S is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 180
Balasubramanian.S is on a distinguished road
Default Re: Using arrays in stored procedures

Hi,

Send them as a string of comma seperated values instead of an array. Then, in your sp, do this:

Code:

declare @sql varchar(1000)
Set @sql = 'Select * From Products Where Prod_Code IN (' + @values + ')'
exec(@sql)



Where @values is your parameter.
__________________
S.Balasubramanian
Nothing is impossible
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete all stored procedures in a Database oxygen Database Support 1 03-05-2008 01:35 AM
Using arrays in stored procedures it.wily Database Support 2 02-09-2008 09:18 AM
NET Code generators for C# and SQL Stored Procedures verrock_po ASP and ASP.NET Programming 1 12-05-2007 11:22 PM
SQL Server Undocumented Stored Procedures a.deeban Database Support 3 09-04-2007 02:31 AM
Executing SQL Server Stored Procedures With PHP - Executing stored procedures Jeyaseelansarc PHP Programming 1 07-18-2007 11:23 PM


All times are GMT -7. The time now is 12:31 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0