EXEMPLO_1212310
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
SPC_ATUALIZA_LOTE_BONUM
Parameters
Name
Type
Mode
@COLIGADA
smallint
IN
@DATAINICIAL
datetime
IN
@DATAFINAL
datetime
IN
Definition
/* RM Sistemas RM Saldus Tradução do procedimento "AtualizaLote" da BNIntegraSaldus.pas para Stored Procedure MSSQL */ CREATE PROCEDURE SPC_ATUALIZA_LOTE_BONUM @COLIGADA SMALLINT, @DATAINICIAL DATETIME, @DATAFINAL DATETIME AS BEGIN DECLARE @LOTESALDUS INT, @TABELA CURSOR SET @TABELA = CURSOR STATIC FOR SELECT CAST(TEXTO AS INTEGER) FROM IPARAMETROS WHERE CODCOLIGADA = @COLIGADA AND NOME = 'CODLOTESALDUS' OPEN @TABELA FETCH NEXT FROM @TABELA INTO @LOTESALDUS IF (@LOTESALDUS IS NOT NULL) AND (@LOTESALDUS > 0) BEGIN UPDATE CLOTE SET DATAINICIAL = @DATAINICIAL, DATAFINAL = @DATAFINAL WHERE CODCOLIGADA = @COLIGADA AND CODLOTE = @LOTESALDUS END CLOSE @TABELA DEALLOCATE @TABELA END