Subject | Re: [firebird-support] commit in stored procedures |
---|---|
Author | Maurizio P. |
Post date | 2010-01-24T10:11:04Z |
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]
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]