开发者

Is it possible to use prepared statement as part of the select expression?

开发者 https://www.devze.com 2023-03-15 23:17 出处:网络
I want to create the following query if possible at all SELECT value, 开发者_Python百科formula, (PREPARE stmnt FROM formula;

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..

0

精彩评论

暂无评论...
验证码 换一张
取 消