lava-oushudb-dt-sql-parser/test/parser/mysql/syntax/fixtures/prepared.sql
琉易 428d851913
feat: #190 improve mysql grammer (#196)
* refactor: generic rename to mysql

* refactor: g4 with mysql syntax

* test: mysql syntax

* refactor: remove useless keywords

* refactor: remove nonReserved keywords

* refactor: lint specificFunction

---------

Co-authored-by: liuyi <liuyi@dtstack.com>
2023-11-27 15:25:40 +08:00

31 lines
601 B
SQL

-- https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html
-- https://dev.mysql.com/doc/refman/8.0/en/prepare.html
/* PREPARE stmt_name FROM preparable_stmt */
PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
PREPARE stmt2 FROM @s;
-- https://dev.mysql.com/doc/refman/8.0/en/execute.html
/* EXECUTE stmt_name
[USING @var_name [, @var_name] ...] */
EXECUTE stmt1 USING @a, @b;
EXECUTE stmt3;
-- https://dev.mysql.com/doc/refman/8.0/en/deallocate-prepare.html
/* {DEALLOCATE | DROP} PREPARE stmt_name */
DEALLOCATE PREPARE stmt1;
DROP PREPARE stmt1;