sql - Stored Procedures for IBM DB2 -
i new stored procedures. need pick stored procedures db2(which new to). code wrote not working:
create procedure sp_test ( id number ) begin if number < 0 raise value error; end if; select * student_tb taskid = 'number'; end; /
and script (another file) calls stored procedure:
begin sp_test('15'); end;
i not sure wrong. hope can advise. thank you.
i'm not expert in db2, i'm pretty sure have call stored procs in db2.
call sp_test('15');
or
execute (call sp_test('15'));
the syntax might little different stored procedures return result set. docs db2 on target platform should explain difference.
Comments
Post a Comment