Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO stored procedure question

Status
Not open for further replies.

bartvb

Programmer
Nov 29, 2001
24
0
0
BE
ADO stored procedure question

I've already called a stored procedure with parameters and so on.

Now I have the following question:


Is it possible to give a recordset as input parameter (REF CURSOR) to a stored procedure?
Because i must select some data for a lot of id's (not always the same; too much for "," separated
list or so and my database doesn't support temporary tables)

and i've got those id's in a recordset from a previous stored procedure
 
Bart

I don't think it is possible.

Have you considered building up SQL commands in your VB code, using SQL command objects, and changing the Command Text at run-time.

Sadcow
 
Yes, perhaps that is the only solution

Perhaps some more explanation of the situation. I must make 15 reports in vb which all select different fields from the database, but all have the same where clause

where blabla like parameter1
...
abce like parameter20 (20 times like in where clause)


The reason why i like stored procedures for reports is that you can change some things without recompiling your programs. But i don't like the idea of passing 15 times those variables to 15 stored procedures... when something changes... So i thought

1) call a stored procedure to read the id's (whith the where clause)
2) pass that result to the 15 other stored procedures.


But if you say that isn't possible... I shall build the sql command in vb concatenating the where class every time

 
Or build the stored procedure as subquery? One for the parameter set?

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Bartvb

I am afraid I cannot see a more elegant solution, apart from general advice of staying away from reports - I hate them.

Sadcow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top