List:General Discussion« Previous MessageNext Message »
From:Rory McKinley Date:February 10 2006 5:30am
Subject:Re: Passing db names to a stored proc in MySQL 5
View as plain text  
SGreen@stripped wrote:
<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>

Doh!

I cannot believe that I didn't think of that - seems I was being dense 
after all!

Thanks Shawn will give it a try

Rory

Thread
Passing db names to a stored proc in MySQL 5Rory McKinley9 Feb
  • Re: Passing db names to a stored proc in MySQL 5Martijn Tonies9 Feb
    • Re: Passing db names to a stored proc in MySQL 5Peter Brawley12 Feb
  • Re: Passing db names to a stored proc in MySQL 5SGreen9 Feb
    • Re: Passing db names to a stored proc in MySQL 5Martijn Tonies9 Feb
    • Re: Passing db names to a stored proc in MySQL 5Rory McKinley9 Feb
      • Re: Passing db names to a stored proc in MySQL 5SGreen9 Feb
        • Re: Passing db names to a stored proc in MySQL 5Rory McKinley10 Feb
        • Re: [SOLVED]Passing db names to a stored proc in MySQL 5Rory McKinley10 Feb
      • Re: Passing db names to a stored proc in MySQL 5Peter Brawley11 Feb