Hi,
When compiling The Trigger Below the sistem dont accept the Sequence
:NEW
tmpCodReg := :NEW.CodRegistrador;
***
PLS-00553: nome do conjunto de caracteres não é reconhecido
It is strange because i have an developing environment and there is no
such problem
Now in the Production environment i got the PLS-00553 error message
Obrigado and thanks
Alexis Neme
Create Or Replace TRIGGER SITRAX.ALARME AFTER INSERT ON
SITRAX.HISTORICOELEMENTOS
FOR EACH ROW
DECLARE
ParaTrigger Boolean;
tmpCentral Varchar2(10);
tmpAlarme Varchar2(50);
tmpElemento Varchar2(40);
tmpCodReg Char(10);
tmpIdRegistro Integer;
Cursor IDReg is
SELECT IdRegistro
FROM TempAlarme
WHERE IdRegistro = :NEW.IdRegistro;
BEGIN
ParaTrigger := False;
IF ParaTrigger THEN
RETURN;
END IF;
tmpCodReg := :NEW.CodRegistrador;
- NORMALIZACAO Dos ALARMES -----
- Alarme Ceasing AXE
- Registrador 112
IF tmpCodReg = '0000000112' THEN
- A sigla da Central
SELECT Sigla Into tmpCentral
FROM ElementosMonitorados
WHERE Codigo = :NEW.CodElemento;
- Normalizar o alarme
Update MGFAlarme
SET reconhecido = 1,
USUARIO = '0000000000', -- Administrador
INSTANTERECONHEC = sysdate
WHERE
Central =tmpCentral
and To_number(alarme)= To_Number(:NEW.Valor)
and instante < sysdate ;
RETURN ; -- EXIT
END IF ;
- ALARMES
- Registrador Alarme: 0000000038
- Registrador Criticidade 0000000080
- Registrador ElementoAlarmado 0000000081
- Registrador Descricao 0000000380
- Registrador TipoAlarmado 0000000102
IF tmpCodReg = '0000000038' OR
tmpCodReg = '0000000080' OR
tmpCodReg = '0000000081' OR
tmpCodReg = '0000000102' OR
tmpCodReg = '0000000380' THEN
- INSERT INTO DEBUG VALUES ( 'DATAHORACENTRAL = ' || TO_CHAR(
:NEW.DATAHORACENTRAL ) );
- INSERT INTO DEBUG VALUES ( 'tmpIdRegistro = ' || TO_CHAR(
:NEW.IDRegistro, '9999999999' ) );
OPEN IdReg;
FETCH IDReg INTO tmpIdRegistro;
- Caso nao exista, inserir
IF IDReg%ROWCOUNT = 0 THEN
- INSERT INTO DEBUG VALUES ( 'GRAVAÇÃO' );
SELECT Sigla Into tmpCentral
FROM ElementosMonitorados
WHERE Codigo = :NEW.CodElemento;
INSERT INTO TempAlarme ( IdRegistro, DataHora, Central )
VALUES ( :NEW.IdRegistro, :NEW.DataHoraCentral,
tmpCentral );
END IF;
- INSERT INTO DEBUG VALUES ( 'Valor = ' || :NEW.Valor );
- Gravar o valor
IF tmpCodReg = '0000000038' THEN
UPDATE TempAlarme Set Codigo = :NEW.Valor
WHERE IdRegistro = :NEW.IdRegistro;
ELSIF tmpCodReg = '0000000080' THEN
UPDATE TempAlarme Set Criticidade = :NEW.Valor
WHERE IdRegistro = :NEW.IdRegistro;
ELSIF tmpCodReg = '0000000081' THEN
UPDATE TempAlarme Set Elemento = :NEW.Valor
WHERE IdRegistro = :NEW.IdRegistro;
ELSIF tmpCodReg = '0000000102' THEN
UPDATE TempAlarme Set TipoElemento = :NEW.Valor
WHERE IdRegistro = :NEW.IdRegistro;
ELSIF tmpCodReg = '0000000380' THEN
UPDATE TempAlarme Set Descricao = :NEW.Valor
WHERE IdRegistro = :NEW.IdRegistro;
END IF;
CLOSE IDReg;
END IF;
END;
Sent via Deja.com
http://www.deja.com/
Share what you know. Learn what you don't.
Received on Mon Jun 07 1999 - 15:43:43 CDT