USE ` test `;
DROP procedure IF the EXISTS ` save_grades `;
DELIMITER $$
USE ` test ` $$
The CREATE DEFINER=` root ` @ ` localhost ` PROCEDURE ` save_grades ` ()
The BEGIN
# the stored procedures to create a table, the current time test scores for backup
Declare tb_name varchar (20);
Set tb_name=date_format (now (), Y '%');
If length (date_format (now (), '% c'))=2 then
The set tb_name=concat (tb_name, '0');
The set tb_name=concat (tb_name date_format (now (), '% c'));
Elseif length (date_format (now (), '% c'))=1 then
The set tb_name=concat (tb_name date_format (now (), '- % c'));
end if;
If length (date_format (now (), '% d'))=2 then
The set tb_name=concat (tb_name, '0');
The set tb_name=concat (tb_name date_format (now (), '% d'));
Elseif length (date_format (now (), '% d'))=1 then
The set tb_name=concat (tb_name date_format (now (), '- % d));
end if;
Prepare STM from 'the create table `? ` (id int primary key, name varchar (10), stunum varchar (10), math int, mathteacherid int, int. English, englishteacherid int, physics int, physicsteacherid int) ';
The set @ arg=tb_name;
The execute STM using @ arg;
Prepare stm2 from 'insert into `? ` select id, name, stunnum, math, English, physics, physicsteacherid englishteacherid, mathteacherid from students';
The execute stm2 using @ arg;
END $$
DELIMITER.
Then run time error:
the Error Code: 1210. Incorrect the arguments to the EXECUTE
What is the problem?
CodePudding user response:
The top · · · · · ·CodePudding user response:
Top!!!!!!!!!!!!!!!!CodePudding user response:
No one????????CodePudding user response:
I tried, is the use of the function problem: the execute; But specific how should use up blank;If must understand, that you have to check the document, if only in order to solve the problem, you can change a kind of writing;
To build a temporary table, you want to insert data, directly inserted into a temporary table, in the process of ending place, drop the temporary table, quantity is big, if temporary table data can TRUNCATE table first, and then drop;