Procedures

This is the code of the GETORDERS procedure:

create procedure GETORDERS()
language sql
result sets 1
begin
  declare mycur cursor with return to caller for
     Select DOCS FROM DOCUMENTS Where ID='2'; 
  open mycur;
end@

This is the code of the INSERT_ORDERS procedure:

create procedure INSERT_ORDER(IN xml VARCHAR(1024))
language sql
begin
 INSERT INTO  <SCHEMA>.IN_DOCUMENTS (C_ID, C_XML)
SELECT MAX(IN_DOCUMENTS.C_ID)+ 1 , BLOB(xml) FROM IN_DOCUMENTS; 
end@