Home > database >  Mysql to CREATE a stored PROCEDURE error ([SQL] the CREATE or replace PROCEDURE query_dynamic_cursor
Mysql to CREATE a stored PROCEDURE error ([SQL] the CREATE or replace PROCEDURE query_dynamic_cursor

Time:09-27

The CREATE or replace PROCEDURE query_dynamic_cursor (IN pm25 double)
The BEGIN
DECLARE the done INT the DEFAULT 0;
DECLARE v_time varchar (10) the default ';
DECLARE v_value varchar (10) the default ';
DECLARE v_warn varchar (10) the default ';
DECLARE v_type varchar (10) the default ';
DECLARE v_projName varchar (10) the default ';

DECLARE a cur CURSOR for (SELECT time, value, warn, type, projName from data_view);
DECLARE the CONTINUE HANDLER FOR the NOT FOUND SET done=1;

DROP the VIEW IF the EXISTS data_view;

The SET @ SQLSTR="the CREATE VIEW data_view as";
# SET @ SQLSTR=CONCAT (@ SQLSTR, "SELECT the username FROM webuser WHERE username like '%'", p_name, "");
The SET @ SQLSTR=CONCAT (@ SQLSTR, "select DATE_FORMAT (a.c ollect_time, '% % Y - m - H: % d % % I: % s') time, Amy polumbo m25' value ',", pm25,
"Warn, 'pm2.5 warning' type, p. roj_name projName from c_environm_check a LEFT JOIN ifs_pro_base on Amy polumbo roj_id b=p. roj_id and Amy polumbo roj_code=p. roj_code where Amy polumbo m25 & gt;=", pm25);

PREPARE STMT FROM @ SQLSTR;
The EXECUTE STMT.
DEALLOC

CodePudding user response:

What is error? You can copy to the BAIDU translation,

CodePudding user response:

Stick is not complete
  • Related