CREATE TABLE TBPDV_CONFERENCIA (
    ID INTEGER NOT NULL,
	PDV_ID INTEGER DEFAULT 0,
	CLIENTE_ID INTEGER DEFAULT 0,
	CLIENTE_CPF VARCHAR(14),
	TABELA_PRECO_ID INTEGER DEFAULT 0,
    USUARIO_ID INTEGER DEFAULT 0,
    DATAHORA TIMESTAMP DEFAULT 'NOW',
	OBSERVACAO VARCHAR(200));
	

ALTER TABLE TBPDV_CONFERENCIA
ADD CONSTRAINT PK_TBPDV_CONFERENCIA
PRIMARY KEY (ID);

CREATE SEQUENCE GTBPDV_CONFERENCIA;

CREATE TRIGGER TTBPDV_CONFERENCIA_B01I FOR TBPDV_CONFERENCIA
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  IF (NEW.ID IS NULL) THEN
    NEW.ID = GEN_ID(GTBPDV_CONFERENCIA,1);
END;