我做了以下程序:
/*Stored procedure*/
create procedure SP_getlagerstatus(in Kategori VARCHAR(15), in minverdi int(3))
select * from deler join delekategori on deler.DelekategoriID=delekategori.DeleKategoriID
where DeleKategoriNavn ='Kategori' and Lagerstatus > 'minverdi';
当我用call SP_getlagerstatus('biler',1);
运行它时,我没有得到任何结果,但当我直接运行查询时:
select * from deler join delekategori on deler.DelekategoriID=delekategori.DeleKategoriID
where DeleKategoriNavn ='biler' and Lagerstatus > 1;
我得到了理想的结果。我错过了什么?
/Andy.l
答案 0 :(得分:0)
省略参数
周围的'
select * from deler join delekategori on deler.DelekategoriID=delekategori.DeleKategoriID
where DeleKategoriNavn =Kategori and Lagerstatus > minverdi;