Stored procedures

<< Click to Display Table of Contents >>

Navigation:  Technical Informations > ABC8 Database Structure >

Stored procedures

Stored procedure GETNEWID

 

Description.

Stored procedure to generate next given ID

 

Detail

CREATE PROCEDURE SYSADM.GETNEWID (@CodeRetour int OUTPUT,@CodeTable int)

AS DECLARE @Value float

SELECT @CodeRetour = -2

DECLARE cur_acces SCROLL CURSOR FOR SELECT NUM_VALUE FROM SYSADM.T_VAR WHERE ID_VAR=@CodeTable FOR UPDATE OF NUM_VALUE

open cur_acces

FETCH NEXT FROM cur_acces INTO  @Value

if (@@FETCH_STATUS=0)

BEGIN        

SELECT @Value=  @Value + 1

UPDATE SYSADM.T_VAR SET NUM_VALUE = @Value WHERE CURRENT OF cur_acces

END

ELSE

BEGIN

SELECT @Value = 1

INSERT INTO SYSADM.T_VAR (ID_VAR,NUM_VALUE) VALUES (@CodeTable,@Value)

END

SELECT @CodeRetour = CONVERT(int,@Value)

CLOSE cur_acces

DEALLOCATE cur_acces

 

Stored procedure CLEANBASE

Description.

This is a stored procedure used for database clean up

 

Détail. 

 CREATE PROCEDURE cleanbase AS

 

dump transaction tempdb with truncate_only

dump transaction ABC8 with truncate_only

 

DBCC CheckDB (ABC8)

DBCC CheckDB (tempdb)

 

dump transaction tempdb with truncate_only

dump transaction ABC8 with truncate_only

GO

 

Stored procedure DeleteRunInLog

 

Description.

This procedure is used to delete rundown in airCarty, executed by Federall and GridEditor.

 

Stored procedure InsertItemInLog

 

Description.

This procedure is used for rundown in Federall et GridEditor.

 

Stored procedure InsertLogInLog

 

Description.

This stored procedure insert templates in rundowns

Executed by Federall et GridEditor.

 

Stored procedure InsertNewRun

 

Description.

This stored procedure is used by Federall et GridEditor to insert empty steps in the rundown.

 

Stored procedure InsertNewScreen

 

Description.

Used by Federall et GridEditor to create a rundowm.

 

Stored procedure InsertRunInLog

 

Description.

Used by Federall et GridEditor to copy a step in the rundowm.