Subject Re: [firebird-support] commit in stored procedures
Author Maurizio P.
hi ,
thanks for interesting answers ,
anyway the code i wrote was only an example .

So i made some test and here it is what it should
work for me , please correct me if i am wrong ,

the example SP :
CREATE PROCEDURE TEST_SP
AS
DECLARE VARIABLE cli VARCHAR(7);
BEGIN
FOR SELECT T1.codcli
FROM test T1
into  :cli
DO BEGIN
  update test T2
  SET T2.codcli = ''
  WHERE :cli = T2.codcli ;
END

/* the line below forces an error  */
INSERT INTO TEST ( TEST.codcli  ) VALUES ( 'itsatest' )

SUSPEND;
END

.... so , running that procedure with Delphi (SQLStoredProc) ,
it returns an error , and nothing changed in the test table ,

here the Delphi code :
  try
   sp.ExecProc ;
  except
   // errors happened
  end;


thanks

Mauro

 


 















[Non-text portions of this message have been removed]