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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored procedure and multiple select form field

Status
Not open for further replies.

laurent42

Programmer
Aug 7, 2001
13
US
I have a form with a multiple select form field among other fields called "IDAgent2".

That form calls a stored procedure and IDAgent2 is passed to the stored procedure.

Let's say IDAgent2 equals "1, 2, 3".

I need to repeat the following insert query for each value Y inside of IDAgent2 (1, 2 and 3):
INSERT INTO X
(IDAgent, IDEvenement)
VALUES (Y, @IDEvenement)

How do I parse @IDAgent2 for the different values separated by "," to run that query for each of them within the stored procedure?

Thanks.
 
Depends on what DBMS you have, stored procedures have different syntax. This forum covers standard SQL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top