http://lohasle.iteye.com/blog/1669879 存储过程都是一样的,只是根据自己的喜好,可以用MAP或者JAVABEAN传递参数. -- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored
step1:在mysql cmd中新建存储过程: drop procedure if exists queryCountByGrade ; delimiter // -- 定义存储过程结束符号为// create procedure queryCountByGrade(IN gradenameinput INT(),OUT counts ) begin select count(*) into counts from student where grade = gradenameinput;en
1.调用没有OUT参数的存储过程: 创建存储过程: create or replace function get_code(a1 varchar(32)) returns varchar(32) as $$ declare the_result varchar(32); begin the_result := name from t_project where id = a1; return the_result; end; $$ language plp