MySQL Forums
Forum List  »  Optimizer & Parser

Re: explain a prepared statement
Posted by: Rick James
Date: March 14, 2011 06:22PM

mysql> use database_test;
mysql> SET @test_parameter = "xxx"; 
mysql> SELECT * from table1, table2 where field1= @test_parameter and ....
or
mysql> use database_test;
mysql> SELECT * from table1, table2 where field1= "xxx" and ....
also
mysql> use database_test;
mysql> EXPLAIN SELECT * from table1, table2 where field1= "xxx" and ....

In other words, don't do PREPARE and EXECUTE. Those are reserved for STORED PROCEDUREs, and are used in certain APIs.

Options: ReplyQuote


Subject
Views
Written By
Posted
3309
March 09, 2011 07:07AM
1510
March 13, 2011 02:13PM
3439
March 14, 2011 07:11AM
Re: explain a prepared statement
1972
March 14, 2011 06:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.