mysql 動態執行SQL文

2021-05-27 14:30:29 字數 536 閱讀 5791

參考:

mysql 儲存過程中動態執行 sql 文

2 + pow ?,mysql>prepa re stmt1 from 'select sqrt pow ?.2 as hypotenuse';

mysql>set @a = 3;

mysql>set @b = 4;

@b; class=userinputexecute stmt1 using @a.>

mysql>set @a = 'select * from table1 ';

mysql>set @b = 'where column1>10 limit 1';

@b mysql>set @a =concat @a.;

mysql>prepa re stmt1 from@a;

mysql>execute stmt1;

mysql 動態執行SQL文

在mysql儲存過程中動態執行sql文 mysql prepare stmt1 from select sqrt pow 2 pow 2 as hypotenuse mysql set a 3 mysql set b 4 mysql execute stmt1 using a,b mysql set...

mysql 過程 動態執行sql

begin declare v sql varchar 500 declare v table name varchar 20 declare v date time varchar 20 set v date time date format now y m d select v date tim...

mysql執行動態sql語句

今天oracle群上有人問mysql可不可以執行動態的sql語句,搜了一下,居然可以。set tsql select from companyinfo prepare stmt1 from tsql execute stmt1 set fid fid set table1 companyinfo s...