|
A tabela de integração de retornos de notas de entrada deverá possuir, obrigatoriamente, as colunas a seguir:
DOCUMENTDATA – conteúdo do documento retornado;
STATUS – será inserido sempre com o valor ZERO, permitindo que o ERP ou outro sistema possa controlar a captura dos registros;
KIND – Campo obrigatório que determina para o sistema que fará a leitura do registro, qual o tipo de retorno consta no registro. Este campo pode receber os seguintes valores:
0 – Envio;
1 – Cancelamento;
2 – Rejeição;
3 – Cancelamento reduzido;
4 – Evento (Carta de Correção, Cancelamento, Evento de Registro de Multimodal);
5 – Evento de Manifestação do Destinatário;
6 – Retorno de Consulta de documentos Destinados (ped-list);
7 - Retorno auditoria Vaccine;
8 – Retorno de Consulta de documentos Destinados via WS de DF-e (ped-DFe);
9 – Rejeição ADe.
-1 - Qualquer KIND diferente da lista acima.
A seguir, serão listados os scripts de criação da estrutura padrão, nos diferentes SGBD’s suportados:
SGBD SERVER 2005 / MSSQL SERVER 2008 / MSSQL SERVER 2012 / MSSQL SERVER 2014
CREATE TABLE [dbo].[222](
[entryIntegrationId] [bigint] IDENTITY(1,1) NOT NULL,
[documentdata] [varbinary](max) NOT NULL,
[status] [int] NOT NULL,
[kind] [int] NOT NULL,
CONSTRAINT [PK_ 222] PRIMARY KEY CLUSTERED
(
[entryIntegrationId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
|
SGBD MYSQL
CREATE TABLE `entryintegration` (
`connectorIntegrationId` bigint(20) NOT NULL AUTO_INCREMENT,
`documentdata` LONGBLOB NOT NULL,
`status` tinyint(4) NOT NULL,
`kind` smallint(6) NOT NULL,
PRIMARY KEY (`connectorIntegrationId`),
UNIQUE KEY `connectorIntegrationId_UNIQUE` (`connectorIntegrationId`))
ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
SGBD ORACLE
/
CREATE TABLE entryIntegration (
entryIntegrationId number(20) NOT NULL,
documentdata blob NOT NULL ,
status int NOT NULL ,
kind int NOT NULL
)
/
CREATE SEQUENCE "entryIntegration_SEQ" INCREMENT BY 1 START
WITH 1 MAXVALUE 1.0E28 MINVALUE 1 NOCYCLE
CACHE 20 NOORDER
/
CREATE OR REPLACE TRIGGER "BI_entryIntegration" BEFORE INSERT ON entryIntegration
FOR EACH ROW
WHEN (new.entryIntegrationId IS NULL) BEGIN
SELECT "entryIntegration_SEQ".NEXTVAL INTO :new.entryIntegrationId FROM dual;
END;
/
ALTER TRIGGER "BI_entryIntegration" ENABLE
/
|
SGBD IBM INFORMIX
CREATE TABLE entryIntegration (
entryIntegrationId SERIAL8,
DOCUMENTDATA BYTE NOT NULL,
STATUS INTEGER NOT NULL,
KIND INTEGER NOT NULL);
alter table entryIntegration modify lock mode (ROW);
|
Obs.: O e-Agente Integration é compatível com banco de dados INFORMIX apenas até a versão 3.4.4.0.
Voltar
|