DatabaseProcApplicationCreatedLinks
sybsystemprocssp_remove_xact  14 déc. 14Defects Propagation Dependencies

1     
2     CREATE OR REPLACE PROCEDURE sp_remove_xact
3         @commid int,
4         @count smallint,
5         @password varchar(30) = NULL
6     AS
7     
8     
9         if exists (select *
10                from sybsystemdb.dbo.spt_committab
11                where commid = @commid
12                    and password = @password)
13        begin
14            /*
15            ** Decrement outnum by @count.
16            */
17            UPDATE sybsystemdb.dbo.spt_committab
18            SET outnum = outnum - @count, lastchange = GETDATE()
19            WHERE commid = @commid
20    
21            /*
22            **  Delete the row if outnum < 1
23            */
24            DELETE sybsystemdb.dbo.spt_committab
25            WHERE commid = @commid
26                and outnum < 1
27    
28        end
29        else
30        begin
31            /*
32            ** 17380, "Commit service xact id doesn't exist."
33            */
34            raiserror 17380
35        end
36    


exec sp_procxmode 'sp_remove_xact', 'AnyMode'
go

Grant Execute on sp_remove_xact to public
go
DEFECTS
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 26
 MGTP 3 Grant to public sybsystemprocs..sp_remove_xact  
 MNER 3 No Error Check should check @@error after update 17
 MNER 3 No Error Check should check @@error after delete 24
 MUOT 3 Updates outside transaction 24
 MSUB 2 Subquery Marker 9
 MTR1 2 Metrics: Comments Ratio Comments: 16% 2
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 4 = 3dec - 1exi + 2 2
 MTR3 2 Metrics: Query Complexity Complexity: 14 2

DATA PROPAGATION detailed
ColumnWritten To
@countspt_committab.outnum   sp_scan_xact_rset_001.outnum sp_scan_xact_rset_002.outnum

DEPENDENCIES
PROCS AND TABLES USED
read_writes table sybsystemdb..spt_committab (1)