我一直在使用“喜欢”条款在MySQL 5.0我在MySQL 5.0中写了一个存储过程,并从我的Java程序下面的存储过程中的SELECT语句中调用存储过程我想利用参数DepartmentName的对像子句中的值有问题请帮助这个
DROP PROCEDURE IF EXISTS upSelTests;
DELIMITER //
CREATE PROCEDURE upSelTests
(
IN departmentname varchar(50),
IN testDateFrom varchar(10),
IN testDateTo varchar(10)
)
BEGIN
declare testDateFrom1 varchar(30);
select PatientID,LabNo,arriveddate,RecieptNo,patientname,referredby,ID from
tblAcceptTest where STR_TO_DATE(arriveddate, '%d/%m/%Y')>=STR_TO_DATE(testDateFrom,
'%d/%m/%Y') and STR_TO_DATE(arriveddate, '%d/%m/%Y') <= STR_TO_DATE(testDateTo,
'%d/%m/%Y') and Status = 0 and DeptName like '%departmentname%';
END //
DELIMITER ;