This is my initial error code:
1 create procedure search_sc (student_no varchar(6)) 2 begin 3 select sc.* 4 from sc 5 where sno= student_no 6 end;
Report the error: “Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘end’ at line 6
Solution:
delimiter // create procedure search_sc (student_no varchar(6)) begin select sc.* from sc where sno= student_no; end //
It turns out that the MySQL interpreter is based on ‘;’ To end the read command and execute the command in multiple ‘;’ The interpreter does not know which sentence ends the read command and executes the command, and the function of the delimiter is to replace the flag after the delimiter with the flag after the delimiter (in this paper ‘/ /’), so that the MySQL interpreter will execute this sentence only after ‘/ /’ appears
Similar Posts:
- How to Sovle mysqldump backup Error on the MySQL command line
- [How to Solve]error: invalid array assignment
- SQL statements generated by SQL compare
- [design and development] Python learning notes – Super () argument 1 must be type, not classobj
- How to Solve Python TypeError: ‘module’ object is not callable
- [Solved] MYSQL Error: “ Every derived table must have its own alias”
- [Solved] Hive Update and Delete Error: Attempt to do update or delete using transaction manager
- mysqldump: Couldn’t execute ‘SET OPTION SQL_QUOTE_SHOW_CREATE=1’
- IDEA Connect MYSQL Error: You have an error in your SQL syntax : ‘OPTION SQL_SELECT_LIMIT=1000’ (or…
- [Thinkphp6] Connect to SQL Server and use subquery to report error: when subquery is not introduced with exists, only one expression can be specified in the selection list