| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Rory McKinley | Date: | February 10 2006 7:40am |
| Subject: | Re: [SOLVED]Passing db names to a stored proc in MySQL 5 | ||
| View as plain text | |||
<snip> > You were so close! Try it more like this: > > SET sSQL=CONCAT('SELECT * FROM ', passed_in_db_name, '.sites WHERE > site_name=?'); > > PREPARE query_statement from sSQL <snip> Yup - got it to work - but it is so much hassle that I might seriously reconsider having queries run across databases, as it works fine for one or two stored procs, but I really cannot imagine doing hundreds this way! Only change I had to make was to put the @ in front of the variable name otherwise the prepare statement bombs! Thanks Shawn and Martijn for the help
| Thread | ||
|---|---|---|
| • Passing db names to a stored proc in MySQL 5 | Rory McKinley | 9 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | Martijn Tonies | 9 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | Peter Brawley | 12 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | SGreen | 9 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | Martijn Tonies | 9 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | Rory McKinley | 9 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | SGreen | 9 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | Rory McKinley | 10 Feb |
| • Re: [SOLVED]Passing db names to a stored proc in MySQL 5 | Rory McKinley | 10 Feb |
| • Re: Passing db names to a stored proc in MySQL 5 | Peter Brawley | 11 Feb |
