Re: How to execute prepare statement when the placeholder is a specific table name?

2009-02-15 Thread Paul DuBois
On Feb 14, 2009, at 8:00 PM, Moon's Father wrote: Thanks for your fast reply. Do you know MySQL will support this feature in the future? It doesn't need to. Baron indicated how you can solve this problem. If you look at prepared statements in general (not just for MySQL), placeholders

Re: How to execute prepare statement when the placeholder is a specific table name?

2009-02-15 Thread Joerg Bruehe
Hi all! Paul DuBois wrote: On Feb 14, 2009, at 8:00 PM, Moon's Father wrote: Thanks for your fast reply. Do you know MySQL will support this feature in the future? ((this feature = placeholders for table names in prepared statements)) It doesn't need to. Baron indicated how you can

Re: How to execute prepare statement when the placeholder is a specific table name?

2009-02-15 Thread Joerg Bruehe
Hi, I made a silly typo: Joerg Bruehe wrote: [[...]] So allowing placeholders (variables) for identifiers (table, column, and other database object names) would block (future) optimization. That is (probably) the reason why the SQL standard also does not allow this.

Re: How to execute prepare statement when the placeholder is a specific table name?

2009-02-14 Thread Baron Schwartz
Hello, On Sat, Feb 14, 2009 at 11:15 AM, Moon's Father yueliangdao0...@gmail.com wrote: Here is my routine. DELIMITER $$ CREATE PROCEDURE `t_girl`.`sp_join2`() BEGIN set @a = 'a'; set @b = 'g'; set @stmt = concat('select * from ?,? where a.id = g.id'); prepare s1 from

Re: How to execute prepare statement when the placeholder is a specific table name?

2009-02-14 Thread Moon's Father
Thanks for your fast reply. Do you know MySQL will support this feature in the future? On Sun, Feb 15, 2009 at 12:59 AM, Baron Schwartz ba...@xaprb.com wrote: Hello, On Sat, Feb 14, 2009 at 11:15 AM, Moon's Father yueliangdao0...@gmail.com wrote: Here is my routine. DELIMITER $$