consider the following piece of SQL Server stored procedure
CREATE PROCEDURE DummyProc
( @v1 int,
@v2 int
)
AS
BEGIN
insert into dummytab values (1,1)
BEGIN transaction
insert into dummytab values (2,2)
insert into dummytab values (@v1,@v2)
insert into dummytab values (4,4)
commit transaction
insert into dummytab values (5,5)
END
GO
Can this be mapped to the DB2 code given below?
CREATE PROCEDURE DB2ADMIN.DummyProc (v1 int,v2 int)
LANGUAGE SQL
P1: BEGIN
insert into dummytab values (1,1);
begin compound:
insert into dummytab values (2,2);
insert into dummytab values (v1,v2);
insert into dummytab values (4,4);
end;
insert into dummytab values (5,5);
END P1
Specifically i would like to know, if BEGIN TRANSACTION block in a SQL
server script can be replaced with BEGIN COMPOUND clause in DB2 as shown
above?
CREATE PROCEDURE DummyProc
( @v1 int,
@v2 int
)
AS
BEGIN
insert into dummytab values (1,1)
BEGIN transaction
insert into dummytab values (2,2)
insert into dummytab values (@v1,@v2)
insert into dummytab values (4,4)
commit transaction
insert into dummytab values (5,5)
END
GO
Can this be mapped to the DB2 code given below?
CREATE PROCEDURE DB2ADMIN.DummyProc (v1 int,v2 int)
LANGUAGE SQL
P1: BEGIN
insert into dummytab values (1,1);
begin compound:
insert into dummytab values (2,2);
insert into dummytab values (v1,v2);
insert into dummytab values (4,4);
end;
insert into dummytab values (5,5);
END P1
Specifically i would like to know, if BEGIN TRANSACTION block in a SQL
server script can be replaced with BEGIN COMPOUND clause in DB2 as shown
above?