Subject how to debug PSQL and print log
Author ehaerim
set term ^ ;
create procedure INS_INST_YMD(INST varchar(32), YMD date, TB integer, MB integer, DB integer)
as
declare variable ID integer;
declare variable ID2 integer;
begin
ID = 0;
select ID from I where INST = :INST into :ID;
if (ID > 0) then
begin
ID2 = 0;
select ID from HD where ID = :ID and YMD = :YMD into :ID2;
if (ID2 = 0) then
begin
insert into HD(ID, YMD, TB, MB, DB) values(:ID, :YMD, :TB, :MB, :DB);
end
end
end
^
set term ; ^

For the above stored procedure, I execute like

execute procedure INS_INST_YMD 's0001', '2011-12-21',11,12,13;

I would like to trace the internal execution of INS_INST_YMD for debugging.

How do I print logging information to a file?

thx

HR