ตรวจสอบ Stored Procedure ชื่อ get_serialnumber
begin declare serial_exist int; declare xserial_no int; if param1='' then select 'test' into param1; end if; select count(serial_no) into serial_exist from serial where name = param1; if serial_exist = 0 then insert into serial (name,serial_no) values (param1,0); end if; update serial set serial_no = serial_no + 1 where name = param1; select serial_no into xserial_no from serial where name = param1; return xserial_no; end