Is it possible to use prepared statement as part of the select expression?
I want to create the following query if possible at all
SELECT
value,
开发者_Python百科formula,
(PREPARE stmnt FROM formula;
EXECUTE stmnt USING value)
FROM table1
The formula field values are hardcoded MySQL prepared statement in a DB. Let me know if it makes sense :)
No.
But you can :-
SELECT
a function
or
call
a stored procedure from within another stored procedure
if that helps at all (which it probably doesn't).
http://rubayeet.wordpress.com/2008/10/07/mysql-prepared-statements-and-php-experiment/
ref this, it may help. you can't use prepare directly in a select statement..
精彩评论