/******************************************************************************/
commit work; UPDATE TBACESSO_IP SET ID = gen_id(GTBACESSO_IP,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBACESSO_IP ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBACESSO_IP ADD CONSTRAINT PK_TBACESSO_IP PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBAPI_TABELA_PRECO SET ID = gen_id(GTBAPI_TABELA_PRECO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBAPI_TABELA_PRECO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBAPI_TABELA_PRECO ADD CONSTRAINT PK_TBAPI_TABELA_PRECO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBAPI_TOKEN;
commit work; UPDATE TBAPI_TOKEN SET ID = gen_id(GTBAPI_TOKEN,1);
ALTER TABLE TBAPI_TOKEN ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBAPI_TOKEN ADD CONSTRAINT PK_TBAPI_TOKEN PRIMARY KEY (ID);

SET TERM ^ ;
create trigger ttbapi_token_b01i for tbapi_token
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gtbapi_token,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBBIHANDS_LISTAS SET ID = gen_id(GTBBIHANDS_LISTAS,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBBIHANDS_LISTAS ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBBIHANDS_LISTAS ADD CONSTRAINT PK_TBBIHANDS_LISTAS PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBBLOQUEIO_PRODUCAO SET ID = gen_id(GTBBLOQUEIO_PRODUCAO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBBLOQUEIO_PRODUCAO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBBLOQUEIO_PRODUCAO ADD CONSTRAINT PK_TBBLOQUEIO_PRODUCAO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBBSCGERAL_HISTORICOXML SET ID = gen_id(GTBBSCGERAL_HISTORICOXML,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBBSCGERAL_HISTORICOXML ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBBSCGERAL_HISTORICOXML ADD CONSTRAINT PK_TBBSCGERAL_HISTORICOXML PRIMARY KEY (ID);

SET TERM ^ ;
create trigger tTBBSCGERAL_HISTORICOXML_b01i for TBBSCGERAL_HISTORICOXML
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBBSCGERAL_HISTORICOXML,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBBSC_AREA_SETOR SET ID = gen_id(GTBBSC_AREA_SETOR,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBBSC_AREA_SETOR ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBBSC_AREA_SETOR ADD CONSTRAINT PK_TBBSC_AREA_SETOR PRIMARY KEY (ID);

SET TERM ^ ;
create trigger tTBBSC_AREA_SETOR_b01i for TBBSC_AREA_SETOR
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBBSC_AREA_SETOR,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBBSC_CALENDARIO SET ID = gen_id(GTBBSC_CALENDARIO,1);
ALTER TABLE TBBSC_CALENDARIO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBBSC_CALENDARIO ADD CONSTRAINT PK_TBBSC_CALENDARIO PRIMARY KEY (ID);

SET TERM ^ ;
create trigger tTBBSC_CALENDARIO_b01i for TBBSC_CALENDARIO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBBSC_CALENDARIO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBBSC_HISTORICO SET ID = gen_id(GTBBSC_HISTORICO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBBSC_HISTORICO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBBSC_HISTORICO ADD CONSTRAINT PK_TBBSC_HISTORICO PRIMARY KEY (ID);

SET TERM ^ ;
create trigger tTBBSC_HISTORICO_b01i for TBBSC_HISTORICO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBBSC_HISTORICO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCAIXABANCO_CONCILIACAO SET ID = gen_id(GTBCAIXABANCO_CONCILIACAO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCAIXABANCO_CONCILIACAO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCAIXABANCO_CONCILIACAO ADD CONSTRAINT PK_TBCAIXABANCO_CONCILIACAO PRIMARY KEY (ID);

SET TERM ^ ;
create trigger tTBCAIXABANCO_CONCILIACAO_b01i for TBCAIXABANCO_CONCILIACAO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBCAIXABANCO_CONCILIACAO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCARRETA_DIMENSOES SET ID = gen_id(GTBCARRETA_DIMENSOES,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCARRETA_DIMENSOES ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCARRETA_DIMENSOES ADD CONSTRAINT PK_TBCARRETA_DIMENSOES PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
ALTER TABLE TBCASO_PARAMETROS_USUARIO ADD ID_PK INTEGER;
commit work; UPDATE TBCASO_PARAMETROS_USUARIO SET ID_PK = ID;
ALTER TABLE TBCASO_PARAMETROS_USUARIO ALTER COLUMN ID_PK SET NOT NULL;
ALTER TABLE TBCASO_PARAMETROS_USUARIO ADD CONSTRAINT PK_TBCASO_PARAMETROS_USUARIO PRIMARY KEY (ID_PK);
SET TERM ^ ;
create trigger tTBCASO_PARAMETROS_US_b99IU for TBCASO_PARAMETROS_USUARIO
active before insert or UPDATE position 99
as
begin
    new.ID_PK = new.ID;
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
ALTER TABLE TBCASO_VISUALIZACAO_CONF ADD ID_PK INTEGER;
commit work; UPDATE TBCASO_VISUALIZACAO_CONF SET ID_PK = ID;
ALTER TABLE TBCASO_VISUALIZACAO_CONF ALTER COLUMN ID_PK SET NOT NULL;
ALTER TABLE TBCASO_VISUALIZACAO_CONF ADD CONSTRAINT PK_TBCASO_VISUALIZACAO_CONF PRIMARY KEY (ID_PK);
SET TERM ^ ;
create trigger tTBCASO_VISUALIZACAO_CONF_b99IU for TBCASO_VISUALIZACAO_CONF
active before insert or UPDATE position 99
as
begin
    new.ID_PK = new.ID;
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCHECKLIST_PEDIDO SET ID = gen_id(GTBCHECKLIST_PEDIDO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCHECKLIST_PEDIDO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCHECKLIST_PEDIDO ADD CONSTRAINT PK_TBCHECKLIST_PEDIDO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCHECKLIST_PEDIDO_ITEM SET ID = gen_id(GTBCHECKLIST_PEDIDO_ITEM,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCHECKLIST_PEDIDO_ITEM ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCHECKLIST_PEDIDO_ITEM ADD CONSTRAINT PK_TBCHECKLIST_PEDIDO_ITEM PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCHECKLIST_PEDIDO_PARAMETRO SET ID = gen_id(GTBCHECKLIST_PEDIDO_PARAMETRO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCHECKLIST_PEDIDO_PARAMETRO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCHECKLIST_PEDIDO_PARAMETRO ADD CONSTRAINT PK_TBCHECKLIST_PEDIDO_PARAMETRO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCHECKLIST_PEDIDO_USUARIO SET ID = gen_id(GTBCHECKLIST_PEDIDO_USUARIO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCHECKLIST_PEDIDO_USUARIO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCHECKLIST_PEDIDO_USUARIO ADD CONSTRAINT PK_TBCHECKLIST_PEDIDO_USUARIO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBCIDADE_IBGE;
ALTER TABLE TBCIDADE_IBGE ADD ID INTEGER;
commit work; UPDATE TBCIDADE_IBGE SET ID = gen_id(GTBCIDADE_IBGE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCIDADE_IBGE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCIDADE_IBGE ADD CONSTRAINT PK_TBCIDADE_IBGE PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBCIDADE_IBGE_b01i for TBCIDADE_IBGE
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBCIDADE_IBGE,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBCIDADE_IEMI_MERCADO;
ALTER TABLE TBCIDADE_IEMI_MERCADO ADD ID INTEGER;
commit work; UPDATE TBCIDADE_IEMI_MERCADO SET ID = gen_id(GTBCIDADE_IEMI_MERCADO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCIDADE_IEMI_MERCADO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCIDADE_IEMI_MERCADO ADD CONSTRAINT PK_TBCIDADE_IEMI_MERCADO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBCIDADE_IEMI_MERCADO_b01i for TBCIDADE_IEMI_MERCADO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBCIDADE_IEMI_MERCADO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCLIENTE_SUBTIPO SET ID = gen_id(GTBCLIENTE_SUBTIPO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCLIENTE_SUBTIPO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCLIENTE_SUBTIPO ADD CONSTRAINT PK_TBCLIENTE_SUBTIPO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCOLABORADOR_ACESSO_PORTAL SET ID = gen_id(GTBCOLABORADOR_ACESSO_PORTAL,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCOLABORADOR_ACESSO_PORTAL ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCOLABORADOR_ACESSO_PORTAL ADD CONSTRAINT PK_TBCOLABORADOR_ACESSO_PORTAL PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCOLETAINVENTARIO SET ID = gen_id(ITBCOLETAINVENTARIO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCOLETAINVENTARIO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCOLETAINVENTARIO ADD CONSTRAINT PK_TBCOLETAINVENTARIO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCOLETA_INVENTARIO_TECIDO SET ID = gen_id(GTBCOLETA_INVENTARIO_TECIDO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCOLETA_INVENTARIO_TECIDO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCOLETA_INVENTARIO_TECIDO ADD CONSTRAINT PK_TBCOLETA_INVENTARIO_TECIDO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCONCILIACAO_CARTAO_RECEBER SET ID = gen_id(GTBCONCILIACAO_CARTAO_RECEBER,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCONCILIACAO_CARTAO_RECEBER ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCONCILIACAO_CARTAO_RECEBER ADD CONSTRAINT PK_TBCONCILIACAO_CARTAO_RECEBER PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBCONFIGURACAO;
ALTER TABLE TBCONFIGURACAO ADD ID INTEGER;
commit work; UPDATE TBCONFIGURACAO SET ID = gen_id(GTBCONFIGURACAO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCONFIGURACAO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCONFIGURACAO ADD CONSTRAINT PK_TBCONFIGURACAO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBCONFIGURACAO_b01i for TBCONFIGURACAO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBCONFIGURACAO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBCONTAS_VARIACAO_TIPO;
commit work; UPDATE TBCONTAS_VARIACAO_TIPO SET ID = gen_id(GTBCONTAS_VARIACAO_TIPO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCONTAS_VARIACAO_TIPO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCONTAS_VARIACAO_TIPO ADD CONSTRAINT PK_TBCONTAS_VARIACAO_TIPO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCONTROLE_TABELA SET ID = gen_id(GTBCONTROLE_TABELA,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCONTROLE_TABELA ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCONTROLE_TABELA ADD CONSTRAINT PK_TBCONTROLE_TABELA PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCONTROLE_TABELA_COLUNAS SET ID = gen_id(GTBCONTROLE_TABELA_COLUNAS,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCONTROLE_TABELA_COLUNAS ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCONTROLE_TABELA_COLUNAS ADD CONSTRAINT PK_TBCONTROLE_TABELA_COLUNAS PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCUSTO_PRODUTO SET ID = gen_id(GTBCUSTO_PRODUTO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCUSTO_PRODUTO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCUSTO_PRODUTO ADD CONSTRAINT PK_TBCUSTO_PRODUTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBCUSTO_SIMULACAO SET ID = gen_id(GTBCUSTO_SIMULACAO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBCUSTO_SIMULACAO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBCUSTO_SIMULACAO ADD CONSTRAINT PK_TBCUSTO_SIMULACAO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBDB SET ID = gen_id(GTBDB,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBDB ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBDB ADD CONSTRAINT PK_TBDB PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBDESPESA_HISTORICO SET ID = gen_id(GTBDESPESA_HISTORICO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBDESPESA_HISTORICO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBDESPESA_HISTORICO ADD CONSTRAINT PK_TBDESPESA_HISTORICO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBDOLAR_MENSAL SET ID = gen_id(GTBDOLAR_MENSAL,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBDOLAR_MENSAL ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBDOLAR_MENSAL ADD CONSTRAINT PK_TBDOLAR_MENSAL PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBDRE_FIN_GRUPOS_FORMULA SET ID = gen_id(GTBDRE_FIN_GRUPOS_FORMULA,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBDRE_FIN_GRUPOS_FORMULA ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBDRE_FIN_GRUPOS_FORMULA ADD CONSTRAINT PK_TBDRE_FIN_GRUPOS_FORMULA PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBDRE_GERENCIAL_GRUPOS SET ID = gen_id(GTBDRE_GERENCIAL_GRUPOS,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBDRE_GERENCIAL_GRUPOS ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBDRE_GERENCIAL_GRUPOS ADD CONSTRAINT PK_TBDRE_GERENCIAL_GRUPOS PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBENDERECAMENTO SET ID = gen_id(GTBENDERECAMENTO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBENDERECAMENTO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBENDERECAMENTO ADD CONSTRAINT PK_TBENDERECAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBENDERECAMENTO SET ID = gen_id(GTBENDERECAMENTO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBENDERECAMENTO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBENDERECAMENTO ADD CONSTRAINT PK_TBENDERECAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBESPUMACAO_CONFIG;
ALTER TABLE TBESPUMACAO_CONFIG ADD ID INTEGER;
commit work; UPDATE TBESPUMACAO_CONFIG SET ID = gen_id(GTBESPUMACAO_CONFIG,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBESPUMACAO_CONFIG ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBESPUMACAO_CONFIG ADD CONSTRAINT PK_TBESPUMACAO_CONFIG PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBESPUMACAO_CONFIG_b01i for TBESPUMACAO_CONFIG
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBESPUMACAO_CONFIG,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBESTEIRA_BLOQUEIO;
ALTER TABLE TBESTEIRA_BLOQUEIO ADD ID INTEGER;
commit work; UPDATE TBESTEIRA_BLOQUEIO SET ID = gen_id(GTBESTEIRA_BLOQUEIO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBESTEIRA_BLOQUEIO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBESTEIRA_BLOQUEIO ADD CONSTRAINT PK_TBESTEIRA_BLOQUEIO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBESTEIRA_BLOQUEIO_b01i for TBESTEIRA_BLOQUEIO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBESTEIRA_BLOQUEIO,1);
end
^
SET TERM ; ^
/******************************************************************************/
CREATE SEQUENCE GTBESTOQUE_SALDO_DIARIO_PROD;
ALTER TABLE TBESTOQUE_SALDO_DIARIO_PROD ADD ID INTEGER;
commit work; UPDATE TBESTOQUE_SALDO_DIARIO_PROD SET ID = gen_id(GTBESTOQUE_SALDO_DIARIO_PROD,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBESTOQUE_SALDO_DIARIO_PROD ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBESTOQUE_SALDO_DIARIO_PROD ADD CONSTRAINT PK_TBESTOQUE_SAL_D_PROD PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBESTOQUE_SAL_D_PROD_b01i for TBESTOQUE_SALDO_DIARIO_PROD
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBESTOQUE_SALDO_DIARIO_PROD,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBFAMILIA_CUSTO SET ID = gen_id(GTBFAMILIA_CUSTO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFAMILIA_CUSTO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFAMILIA_CUSTO ADD CONSTRAINT PK_TBFAMILIA_CUSTO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBFAMILIA_CUSTO_b01i for TBFAMILIA_CUSTO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBFAMILIA_CUSTO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBFAMILIA_FATURAMENTO SET ID = gen_id(TBFAMILIA_FATURAMENTO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFAMILIA_FATURAMENTO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFAMILIA_FATURAMENTO ADD CONSTRAINT PK_TBFAMILIA_FATURAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBFAMILIA_FICHA_MODELO;
ALTER TABLE TBFAMILIA_FICHA_MODELO ADD ID INTEGER;
commit work; UPDATE TBFAMILIA_FICHA_MODELO SET ID = gen_id(GTBFAMILIA_FICHA_MODELO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFAMILIA_FICHA_MODELO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFAMILIA_FICHA_MODELO ADD CONSTRAINT PK_TBFAMILIA_FICHA_MODELO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBFAMILIA_FICHA_MODELO_b01i for TBFAMILIA_FICHA_MODELO
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBFAMILIA_FICHA_MODELO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBFICHA_PRODUTO_CUSTO_DETALHE SET ID = gen_id(gtbficha_produto_custo_deta,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFICHA_PRODUTO_CUSTO_DETALHE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFICHA_PRODUTO_CUSTO_DETALHE ADD CONSTRAINT PK_TBFICHA_PRO_C_DETALHE PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBFIREBIRD_ADMIN_PASTA SET ID = gen_id(GTBFIREBIRD_ADMIN_PASTA,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFIREBIRD_ADMIN_PASTA ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFIREBIRD_ADMIN_PASTA ADD CONSTRAINT PK_TBFIREBIRD_ADMIN_PASTA PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBFISCAL_OCORRENCIA;
ALTER TABLE TBFISCAL_OCORRENCIA ADD ID INTEGER;
commit work; UPDATE TBFISCAL_OCORRENCIA SET ID = gen_id(GTBFISCAL_OCORRENCIA,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFISCAL_OCORRENCIA ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFISCAL_OCORRENCIA ADD CONSTRAINT PK_TBFISCAL_OCORRENCIA PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBFISCAL_OCORRENCIA_b01i for TBFISCAL_OCORRENCIA
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBFISCAL_OCORRENCIA,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBFRETE SET ID = gen_id(GTBFRETE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFRETE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFRETE ADD CONSTRAINT PK_TBFRETE PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBFRETE_COMPOSICAO_VALOR;
ALTER TABLE TBFRETE_COMPOSICAO_VALOR ADD ID INTEGER;
commit work; UPDATE TBFRETE_COMPOSICAO_VALOR SET ID = gen_id(GTBFRETE_COMPOSICAO_VALOR,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFRETE_COMPOSICAO_VALOR ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFRETE_COMPOSICAO_VALOR ADD CONSTRAINT PK_TBFRETE_COMPOSICAO_VALOR PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBFRETE_COMPOSICAO_VALOR_b01i for TBFRETE_COMPOSICAO_VALOR
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBFRETE_COMPOSICAO_VALOR,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBFRETE_DETALHE SET ID = gen_id(GTBFRETE_DETALHE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFRETE_DETALHE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFRETE_DETALHE ADD CONSTRAINT PK_TBFRETE_DETALHE PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBFRETE_DETALHE_CUBAGEM SET ID = gen_id(GTBFRETE_DETALHE_CUBAGEM,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBFRETE_DETALHE_CUBAGEM ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBFRETE_DETALHE_CUBAGEM ADD CONSTRAINT PK_TBFRETE_DETALHE_CUBAGEM PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBFRETE_DETALHE_PESO SET ID = gen_id(GTBFRETE_DETALHE_PESO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBFRETE_DETALHE_PESO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBFRETE_DETALHE_PESO ADD CONSTRAINT PK_TBFRETE_DETALHE_PESO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBFRETE_VARIAVEL;
ALTER TABLE TBFRETE_VARIAVEL ADD ID INTEGER;
commit work; UPDATE TBFRETE_VARIAVEL SET ID = gen_id(GTBFRETE_VARIAVEL,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBFRETE_VARIAVEL ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBFRETE_VARIAVEL ADD CONSTRAINT PK_TBFRETE_VARIAVEL PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBFRETE_VARIAVEL_b01i for TBFRETE_VARIAVEL
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBFRETE_VARIAVEL,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBGRUPO_MODELO_PRODUTO SET ID = gen_id(GTBGRUPO_MODELO_PRODUTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBGRUPO_MODELO_PRODUTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBGRUPO_MODELO_PRODUTO ADD CONSTRAINT PK_TBGRUPO_MODELO_PRODUTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBHTML_ELEMENTO SET ID = gen_id(GTBHTML_ELEMENTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBHTML_ELEMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBHTML_ELEMENTO ADD CONSTRAINT PK_TBHTML_ELEMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBHTML_TOTALIZADOR;
commit work; UPDATE TBHTML_TOTALIZADOR SET ID = gen_id(GTBHTML_TOTALIZADOR,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBHTML_TOTALIZADOR ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBHTML_TOTALIZADOR ADD CONSTRAINT PK_TBHTML_TOTALIZADOR PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBHTML_TOTALIZADOR_b01i for TBHTML_TOTALIZADOR
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBHTML_TOTALIZADOR,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBHTML_TOTALIZADOR_GERAL SET ID = gen_id(GTBHTML_TOTALIZADOR_GERAL,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBHTML_TOTALIZADOR_GERAL ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBHTML_TOTALIZADOR_GERAL ADD CONSTRAINT PK_TBHTML_TOTALIZADOR_GERAL PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBINDICADOR_FAIXA SET ID = gen_id(GTBINDICADOR_FAIXA,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBINDICADOR_FAIXA ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBINDICADOR_FAIXA ADD CONSTRAINT PK_TBINDICADOR_FAIXA PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBINDICADOR_SETOR SET ID = gen_id(GTBINDICADOR_SETOR,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBINDICADOR_SETOR ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBINDICADOR_SETOR ADD CONSTRAINT PK_TBINDICADOR_SETOR PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBINDICADOR_SETOR_AGRUPAMENTO SET ID = gen_id(GTBINDICADOR_SETOR_AGRUPAMENTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBINDICADOR_SETOR_AGRUPAMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBINDICADOR_SETOR_AGRUPAMENTO ADD CONSTRAINT PK_TBINDICADOR_SETOR_AGRUP PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBINTEGRACAO_API SET ID = gen_id(GTBINTEGRACAO_API,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBINTEGRACAO_API ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBINTEGRACAO_API ADD CONSTRAINT PK_TBINTEGRACAO_API PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBINTEGRACAO_DISPOSITIVO SET ID = gen_id(GTBINTEGRACAO_DISPOSITIVO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBINTEGRACAO_DISPOSITIVO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBINTEGRACAO_DISPOSITIVO ADD CONSTRAINT PK_TBINTEGRACAO_DISPOSITIVO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  delete from TBINTEGRACAO_MOBILE where id in (587975, 587976, 587977, 587978, 587979, 587980, 587981);
  commit work; UPDATE TBINTEGRACAO_MOBILE SET ID = gen_id(GTBINTEGRACAO_MOBILE,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBINTEGRACAO_MOBILE ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBINTEGRACAO_MOBILE ADD CONSTRAINT PK_TBINTEGRACAO_MOBILE PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBLEITURA_DOC_BARRA SET ID = gen_id(GTBLEITURA_DOC_BARRA,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBLEITURA_DOC_BARRA ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBLEITURA_DOC_BARRA ADD CONSTRAINT PK_TBLEITURA_DOC_BARRA PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBLOG_PROCEDURE SET ID = gen_id(GTBLOG_PROCEDURE,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBLOG_PROCEDURE ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBLOG_PROCEDURE ADD CONSTRAINT PK_TBLOG_PROCEDURE PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBLOTE_CONFERENCIA SET ID = gen_id(GTBLOTE_CONFERENCIA,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBLOTE_CONFERENCIA ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBLOTE_CONFERENCIA ADD CONSTRAINT PK_TBLOTE_CONFERENCIA PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBMETA_FATURAMENTO SET ID = gen_id(GTBMETA_FATURAMENTO_ID,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBMETA_FATURAMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBMETA_FATURAMENTO ADD CONSTRAINT PK_TBMETA_FATURAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBMFE;
ALTER TABLE TBMFE ADD ID_PK INTEGER;
commit work; UPDATE TBMFE SET ID_PK = gen_id(GTBMFE,1) WHERE ID_PK IS NULL;
ALTER TABLE TBMFE ALTER COLUMN ID_PK SET NOT NULL;
ALTER TABLE TBMFE ADD CONSTRAINT PK_TBMFE PRIMARY KEY (ID_PK);
SET TERM ^ ;
create trigger tTBMFE_b01i for TBMFE
active before insert position 0
as
begin
  if (new.ID_PK is null) then
    new.ID_PK = gen_id(gTBMFE,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBMFE_CAIXA_MOVIMENTO;
ALTER TABLE TBMFE_CAIXA_MOVIMENTO ADD ID INTEGER;
commit work; UPDATE TBMFE_CAIXA_MOVIMENTO SET ID = gen_id(GTBMFE_CAIXA_MOVIMENTO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBMFE_CAIXA_MOVIMENTO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBMFE_CAIXA_MOVIMENTO ADD CONSTRAINT PK_TBMFE_CAIXA_MOVIMENTO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBMFE_CAIXA_MOVIMENTO_b01i for TBMFE_CAIXA_MOVIMENTO
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBMFE_CAIXA_MOVIMENTO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBMFE_CLIENTE;
ALTER TABLE TBMFE_CLIENTE ADD ID INTEGER;
commit work; UPDATE TBMFE_CLIENTE SET ID = gen_id(GTBMFE_CLIENTE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBMFE_CLIENTE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBMFE_CLIENTE ADD CONSTRAINT PK_TBMFE_CLIENTE PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBMFE_CLIENTE_b01i for TBMFE_CLIENTE
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBMFE_CLIENTE,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBMFE_ITEM SET ID = gen_id(GTBMFE_ITEM,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBMFE_ITEM ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBMFE_ITEM ADD CONSTRAINT PK_TBMFE_ITEM PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBMFE_PARCELAMENTO SET ID = gen_id(GTBMFE_PARCELAMENTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBMFE_PARCELAMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBMFE_PARCELAMENTO ADD CONSTRAINT PK_TBMFE_PARCELAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBMFE_PARCELAMENTO_ITEM;
ALTER TABLE TBMFE_PARCELAMENTO_ITEM ADD ID INTEGER;
commit work; UPDATE TBMFE_PARCELAMENTO_ITEM SET ID = gen_id(GTBMFE_PARCELAMENTO_ITEM,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBMFE_PARCELAMENTO_ITEM ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBMFE_PARCELAMENTO_ITEM ADD CONSTRAINT PK_TBMFE_PARCELAMENTO_ITEM PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBMFE_PARCELAMENTO_ITEM_b01i for TBMFE_PARCELAMENTO_ITEM
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBMFE_PARCELAMENTO_ITEM,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBMFE_SUPRIMENTO_SANGRIA;
ALTER TABLE TBMFE_SUPRIMENTO_SANGRIA ADD ID INTEGER;
commit work; UPDATE TBMFE_SUPRIMENTO_SANGRIA SET ID = gen_id(GTBMFE_SUPRIMENTO_SANGRIA,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBMFE_SUPRIMENTO_SANGRIA ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBMFE_SUPRIMENTO_SANGRIA ADD CONSTRAINT PK_TBMFE_SUPRIMENTO_SANGRIA PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBMFE_SUPRIMENTO_SANGRIA_b01i for TBMFE_SUPRIMENTO_SANGRIA
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBMFE_SUPRIMENTO_SANGRIA,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBNFE_ITEM_ID;
ALTER TABLE TBNFE_ITEM ADD ID INTEGER;
ALTER trigger tbnfe_item_b08iu inactive;
ALTER trigger TBNFE_ITEM_B07IU inactive;
commit work; UPDATE TBNFE_ITEM SET ID = gen_id(GTBNFE_ITEM_ID,1) WHERE ID IS NULL; commit work;  
ALTER trigger tbnfe_item_b08iu active;   
ALTER trigger TBNFE_ITEM_B07IU active;
ALTER TABLE TBNFE_ITEM ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBNFE_ITEM ADD CONSTRAINT PK_TBNFE_ITEM PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBNFE_ITEM_b01i for TBNFE_ITEM
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(GTBNFE_ITEM_ID,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBNFS_EMBARQUE_COMPOS_DADOS;
ALTER TABLE TBNFS_EMBARQUE_COMPOS_DADOS ADD ID_PK INTEGER;
commit work; UPDATE TBNFS_EMBARQUE_COMPOS_DADOS SET ID_PK = gen_id(GTBNFS_EMBARQUE_COMPOS_DADOS,1) WHERE ID_PK IS NULL; 
ALTER TABLE TBNFS_EMBARQUE_COMPOS_DADOS ALTER COLUMN ID_PK SET NOT NULL;
ALTER TABLE TBNFS_EMBARQUE_COMPOS_DADOS ADD CONSTRAINT PK_TBNFS_EMBARQUE_COMPOS_DADOS PRIMARY KEY (ID_PK);
SET TERM ^ ;
create trigger TTBNFS_EMBARQUE_COM_DAD_B01I for TBNFS_EMBARQUE_COMPOS_DADOS
active before insert position 0
as
begin
  if (new.ID_PK is null) then
    new.ID_PK = gen_id(GTBNFS_EMBARQUE_COMPOS_DADOS,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBNFS_ITEM_ROMANEIO;
ALTER TABLE TBNFS_ITEM_ROMANEIO ADD ID INTEGER;
commit work; UPDATE TBNFS_ITEM_ROMANEIO SET ID = gen_id(GTBNFS_ITEM_ROMANEIO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBNFS_ITEM_ROMANEIO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBNFS_ITEM_ROMANEIO ADD CONSTRAINT PK_TBNFS_ITEM_ROMANEIO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBNFS_ITEM_ROMANEIO_b01i for TBNFS_ITEM_ROMANEIO
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBNFS_ITEM_ROMANEIO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBOC_AUTORIZACAO;
ALTER TABLE TBOC_AUTORIZACAO ADD ID INTEGER;
commit work; UPDATE TBOC_AUTORIZACAO SET ID = gen_id(GTBOC_AUTORIZACAO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBOC_AUTORIZACAO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBOC_AUTORIZACAO ADD CONSTRAINT PK_TBOC_AUTORIZACAO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBOC_AUTORIZACAO_b01i for TBOC_AUTORIZACAO
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBOC_AUTORIZACAO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPAINEL_PRODUCAO SET ID = gen_id(GTBPAINEL_PRODUCAO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPAINEL_PRODUCAO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPAINEL_PRODUCAO ADD CONSTRAINT PK_TBPAINEL_PRODUCAO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPEDIDO_DESMEMBRAMENTO SET ID = gen_id(GTBPEDIDO_DESMEMBRAMENTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPEDIDO_DESMEMBRAMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPEDIDO_DESMEMBRAMENTO ADD CONSTRAINT PK_TBPEDIDO_DESMEMBRAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPEDIDO_FORMA_PAGAMENTO SET ID = gen_id(GTBPEDIDO_FORMA_PAGAMENTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPEDIDO_FORMA_PAGAMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPEDIDO_FORMA_PAGAMENTO ADD CONSTRAINT PK_TBPEDIDO_FORMA_PAGAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPEDIDO_ITEM_CUSTO SET ID = gen_id(GTBPEDIDO_ITEM_CUSTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPEDIDO_ITEM_CUSTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPEDIDO_ITEM_CUSTO ADD CONSTRAINT PK_TBPEDIDO_ITEM_CUSTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPEDIDO_PARCELAMENTO SET ID = gen_id(GTBPEDIDO_PARCELAMENTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPEDIDO_PARCELAMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPEDIDO_PARCELAMENTO ADD CONSTRAINT PK_TBPEDIDO_PARCELAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPEDIDO_STATUS SET ID = gen_id(GTBPEDIDO_STATUS,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPEDIDO_STATUS ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPEDIDO_STATUS ADD CONSTRAINT PK_TBPEDIDO_STATUS PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPEDIDO_STATUS SET ID = gen_id(GTBPEDIDO_STATUS,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPEDIDO_STATUS ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPEDIDO_STATUS ADD CONSTRAINT PK_TBPEDIDO_STATUS PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
commit work; UPDATE TBPERSONAL1 SET ID = gen_id(GTBPERSONAL1,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBPERSONAL1 ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBPERSONAL1 ADD CONSTRAINT PK_TBPERSONAL1 PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBPERSONAL1_b01i for TBPERSONAL1
active before insert position 0
as
begin
  if (new.id is null) then
    new.id = gen_id(gTBPERSONAL1,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBPROGRAMACAO_REGISTRO_OP SET ID = gen_id(GTBPROGRAMACAO_REGISTRO_OP,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBPROGRAMACAO_REGISTRO_OP ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBPROGRAMACAO_REGISTRO_OP ADD CONSTRAINT PK_TBPROGRAMACAO_REGISTRO_OP PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBRAMAL SET ID = gen_id(GTBRAMAL,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBRAMAL ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBRAMAL ADD CONSTRAINT PK_TBRAMAL PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBRATEAMENTO_CCUSTO SET ID = gen_id(GTBRATEAMENTO_CCUSTO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBRATEAMENTO_CCUSTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBRATEAMENTO_CCUSTO ADD CONSTRAINT PK_TBRATEAMENTO_CCUSTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBRATEAMENTO_CONTABIL_CCUSTO SET ID = gen_id(gtbrateamento_cont_ccust,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBRATEAMENTO_CONTABIL_CCUSTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBRATEAMENTO_CONTABIL_CCUSTO ADD CONSTRAINT PK_TBRATEAMENTO_CONTABIL_CCUSTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBRATEAMENTO_DETALHE SET ID = gen_id(GTBRATEAMENTO_DETALHE,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBRATEAMENTO_DETALHE ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBRATEAMENTO_DETALHE ADD CONSTRAINT PK_TBRATEAMENTO_DETALHE PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBREFEICAO_DATAS SET ID = gen_id(GTBREFEICAO_DATAS,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBREFEICAO_DATAS ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBREFEICAO_DATAS ADD CONSTRAINT PK_TBREFEICAO_DATAS PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBRELATORIOS SET ID = gen_id(GTBRELATORIOS,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBRELATORIOS ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBRELATORIOS ADD CONSTRAINT PK_TBRELATORIOS PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBRELATORIO_WEB_GRAFICO SET ID = gen_id(GTBRELATORIO_WEB_GRAFICO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBRELATORIO_WEB_GRAFICO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBRELATORIO_WEB_GRAFICO ADD CONSTRAINT PK_TBRELATORIO_WEB_GRAFICO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBRELATORIO_WEB_PARAMETRO2;
commit work; UPDATE TBRELATORIO_WEB_PARAMETRO2 SET ID = gen_id(GTBRELATORIO_WEB_PARAMETRO2,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBRELATORIO_WEB_PARAMETRO2 ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBRELATORIO_WEB_PARAMETRO2 ADD CONSTRAINT PK_TBRELATORIO_WEB_PARAMETRO2 PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBRELATORIO_WEB_PAR2_b01i for TBRELATORIO_WEB_PARAMETRO2
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBRELATORIO_WEB_PARAMETRO2,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBREVISAO_ESTOQUE;
ALTER TABLE TBREVISAO_ESTOQUE ADD ID INTEGER;
commit work; UPDATE TBREVISAO_ESTOQUE SET ID = gen_id(GTBREVISAO_ESTOQUE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBREVISAO_ESTOQUE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBREVISAO_ESTOQUE ADD CONSTRAINT PK_TBREVISAO_ESTOQUE PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBREVISAO_ESTOQUE_b01i for TBREVISAO_ESTOQUE
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBREVISAO_ESTOQUE,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBRH_CONFIGURACAO_ID_PK;
ALTER TABLE TBRH_CONFIGURACAO ADD ID_PK INTEGER;
commit work; UPDATE TBRH_CONFIGURACAO SET ID_PK = gen_id(GTBRH_CONFIGURACAO_ID_PK,1) WHERE ID_PK IS NULL;
ALTER TABLE TBRH_CONFIGURACAO ALTER COLUMN ID_PK SET NOT NULL;
ALTER TABLE TBRH_CONFIGURACAO ADD CONSTRAINT PK_TBRH_CONFIGURACAO PRIMARY KEY (ID_PK);
SET TERM ^ ;
create trigger tTBRH_CONFIGURACAO_b01i for TBRH_CONFIGURACAO
active before insert position 0
as
begin
  if (new.ID_PK is null) then
    new.ID_PK = gen_id(gTBRH_CONFIGURACAO_ID_PK,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBROMANEIO SET ID = gen_id(GTBROMANEIO,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBROMANEIO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBROMANEIO ADD CONSTRAINT PK_TBROMANEIO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBROMANEIO_ITEM SET ID = gen_id(GTBROMANEIO_ITEM,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBROMANEIO_ITEM ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBROMANEIO_ITEM ADD CONSTRAINT PK_TBROMANEIO_ITEM PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBSERVIDOR SET ID = gen_id(GTBSERVIDOR,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBSERVIDOR ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBSERVIDOR ADD CONSTRAINT PK_TBSERVIDOR PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBSTATUS_commit work; UPDATE;
commit work; UPDATE TBSTATUS_commit work; UPDATE SET ID = gen_id(GTBSTATUS_commit work; UPDATE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBSTATUS_commit work; UPDATE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBSTATUS_commit work; UPDATE ADD CONSTRAINT PK_TBSTATUS_commit work; UPDATE PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBSTATUS_commit work; UPDATE_b01i for TBSTATUS_commit work; UPDATE
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBSTATUS_commit work; UPDATE,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBSVN;
ALTER TABLE TBSVN ADD ID INTEGER;
commit work; UPDATE TBSVN SET ID = gen_id(GTBSVN,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBSVN ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBSVN ADD CONSTRAINT PK_TBSVN PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBSVN_b01i for TBSVN
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBSVN,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBSVN_FILE;
ALTER TABLE TBSVN_FILE ADD ID INTEGER;
commit work; UPDATE TBSVN_FILE SET ID = gen_id(GTBSVN_FILE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBSVN_FILE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBSVN_FILE ADD CONSTRAINT PK_TBSVN_FILE PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBSVN_FILE_b01i for TBSVN_FILE
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBSVN_FILE,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBTABELA_GENERICA;
ALTER TABLE TBTABELA_GENERICA ADD ID INTEGER;
commit work; UPDATE TBTABELA_GENERICA SET ID = gen_id(GTBTABELA_GENERICA,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBTABELA_GENERICA ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBTABELA_GENERICA ADD CONSTRAINT PK_TBTABELA_GENERICA PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBTABELA_GENERICA_b01i for TBTABELA_GENERICA
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBTABELA_GENERICA,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBTURNO_HORARIO;
commit work; UPDATE TBTURNO_HORARIO SET ID = gen_id(GTBTURNO_HORARIO,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBTURNO_HORARIO ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBTURNO_HORARIO ADD CONSTRAINT PK_TBTURNO_HORARIO PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBTURNO_HORARIO_b01i for TBTURNO_HORARIO
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBTURNO_HORARIO,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBTV_HISTORICO_PROD SET ID = gen_id(GTBTV_HISTORICO_PROD,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBTV_HISTORICO_PROD ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBTV_HISTORICO_PROD ADD CONSTRAINT PK_TBTV_HISTORICO_PROD PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBVARIACAO_CONTABILIZACAO_ITEM SET ID = gen_id(gen_tbvariacao_contabio_item,1) WHERE ID IS NULL; commit work;
  ALTER TABLE TBVARIACAO_CONTABILIZACAO_ITEM ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBVARIACAO_CONTABILIZACAO_ITEM ADD CONSTRAINT PK_TBVARIACAO_CONT_ITEM PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBFICHA_TEMPLATE SET ID = gen_id(GTBFICHA_TEMPLATE,1) WHERE ID IS NULL or ID = 0; commit work;
  ALTER TABLE TBFICHA_TEMPLATE ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBFICHA_TEMPLATE ADD CONSTRAINT PK_TBFICHA_TEMPLATE PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBFIREBIRD_ADMIN_DB SET ID = gen_id(GTBFIREBIRD_ADMIN_DB,1) WHERE ID IS NULL or ID = 0; commit work;
  ALTER TABLE TBFIREBIRD_ADMIN_DB ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBFIREBIRD_ADMIN_DB ADD CONSTRAINT PK_TBFIREBIRD_ADMIN_DB PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBREGISTRO_ORCAMENTO SET ID = gen_id(GTBREGISTRO_ORCAMENTO,1) WHERE ID IS NULL or ID = 0; commit work;
  ALTER TABLE TBREGISTRO_ORCAMENTO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBREGISTRO_ORCAMENTO ADD CONSTRAINT PK_TBREGISTRO_ORCAMENTO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
  commit work; UPDATE TBRELATORIOS_CAMPO SET ID = gen_id(GTBRELATORIOS_CAMPO,1) WHERE ID IS NULL or ID = 0; commit work;
  ALTER TABLE TBRELATORIOS_CAMPO ALTER COLUMN ID SET NOT NULL;
  ALTER TABLE TBRELATORIOS_CAMPO ADD CONSTRAINT PK_TBRELATORIOS_CAMPO PRIMARY KEY (ID);
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTBSTATUS_UPDATE;
commit work; UPDATE TBSTATUS_UPDATE SET ID = gen_id(GTBSTATUS_UPDATE,1) WHERE ID IS NULL; commit work;
ALTER TABLE TBSTATUS_UPDATE ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TBSTATUS_UPDATE ADD CONSTRAINT PK_TBSTATUS_UPDATE PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTBSTATUS_UPDATE_b01i for TBSTATUS_UPDATE
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTBSTATUS_UPDATE,1);
end
^
SET TERM ; ^
/******************************************************************************/
/******************************************************************************/
CREATE SEQUENCE GTMPGERAL5;
ALTER TABLE TMPGERAL5 ADD ID INTEGER;
commit work; UPDATE TMPGERAL5 SET ID = gen_id(GTMPGERAL5,1) WHERE ID IS NULL; commit work;
ALTER TABLE TMPGERAL5 ALTER COLUMN ID SET NOT NULL;
ALTER TABLE TMPGERAL5 ADD CONSTRAINT PK_TMPGERAL5 PRIMARY KEY (ID);
SET TERM ^ ;
create trigger tTMPGERAL5_b01i for TMPGERAL5
active before insert position 0
as
begin
  if (new.ID is null) then
    new.ID = gen_id(gTMPGERAL5,1);
end
^
SET TERM ; ^
/******************************************************************************/


CREATE SEQUENCE GTMP10001                       ;  ALTER TABLE TMP10001                        ADD ID INTEGER;  commit work; UPDATE TMP10001                        SET ID = gen_id(GTMP10001                       ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP10001                        ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP10001                        ADD CONSTRAINT PK_TMP10001                        PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP10001_b01i for TMP10001                                          active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP10001                       ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMP10168_1                     ;  ALTER TABLE TMP10168_1                      ADD ID INTEGER;  commit work; UPDATE TMP10168_1                      SET ID = gen_id(GTMP10168_1                     ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP10168_1                      ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP10168_1                      ADD CONSTRAINT PK_TMP10168_1                      PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP10168_1_b01i for TMP10168_1                                      active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP10168_1                     ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMP22040                       ;  ALTER TABLE TMP22040                        ADD ID INTEGER;  commit work; UPDATE TMP22040                        SET ID = gen_id(GTMP22040                       ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP22040                        ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP22040                        ADD CONSTRAINT PK_TMP22040                        PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP22040_b01i for TMP22040                                          active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP22040                       ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMP5100                        ;  ALTER TABLE TMP5100                         ADD ID INTEGER;  commit work; UPDATE TMP5100                         SET ID = gen_id(GTMP5100                        ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP5100                         ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP5100                         ADD CONSTRAINT PK_TMP5100                         PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP5100_b01i for TMP5100                                            active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP5100                        ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPBSCHISTORICO                ;  ALTER TABLE TMPBSCHISTORICO                 ADD ID INTEGER;  commit work; UPDATE TMPBSCHISTORICO                 SET ID = gen_id(GTMPBSCHISTORICO                ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPBSCHISTORICO                 ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPBSCHISTORICO                 ADD CONSTRAINT PK_TMPBSCHISTORICO                 PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPBSCHISTORICO_b01i for TMPBSCHISTORICO                            active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPBSCHISTORICO                ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPCALC_PLACA                  ;  ALTER TABLE TMPCALC_PLACA                   ADD ID INTEGER;  commit work; UPDATE TMPCALC_PLACA                   SET ID = gen_id(GTMPCALC_PLACA                  ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPCALC_PLACA                   ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPCALC_PLACA                   ADD CONSTRAINT PK_TMPCALC_PLACA                   PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPCALC_PLACA_b01i for TMPCALC_PLACA                                active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPCALC_PLACA                  ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPCOTA_FATURAMENTO            ;  ALTER TABLE TMPCOTA_FATURAMENTO             ADD ID INTEGER;  commit work; UPDATE TMPCOTA_FATURAMENTO             SET ID = gen_id(GTMPCOTA_FATURAMENTO            ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPCOTA_FATURAMENTO             ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPCOTA_FATURAMENTO             ADD CONSTRAINT PK_TMPCOTA_FATURAMENTO             PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPCOTA_FATURAMENTO_b01i for TMPCOTA_FATURAMENTO                    active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPCOTA_FATURAMENTO            ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPCUSTO_MODELO                ;  ALTER TABLE TMPCUSTO_MODELO                 ADD ID INTEGER;  commit work; UPDATE TMPCUSTO_MODELO                 SET ID = gen_id(GTMPCUSTO_MODELO                ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPCUSTO_MODELO                 ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPCUSTO_MODELO                 ADD CONSTRAINT PK_TMPCUSTO_MODELO                 PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPCUSTO_MODELO_b01i for TMPCUSTO_MODELO                            active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPCUSTO_MODELO                ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPCUSTO_PRODUTO               ;  ALTER TABLE TMPCUSTO_PRODUTO                ADD ID INTEGER;  commit work; UPDATE TMPCUSTO_PRODUTO                SET ID = gen_id(GTMPCUSTO_PRODUTO               ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPCUSTO_PRODUTO                ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPCUSTO_PRODUTO                ADD CONSTRAINT PK_TMPCUSTO_PRODUTO                PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPCUSTO_PRODUTO_b01i for TMPCUSTO_PRODUTO                          active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPCUSTO_PRODUTO               ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPCUSTO_PRODUTO_ABS           ;  ALTER TABLE TMPCUSTO_PRODUTO_ABS            ADD ID INTEGER;  commit work; UPDATE TMPCUSTO_PRODUTO_ABS            SET ID = gen_id(GTMPCUSTO_PRODUTO_ABS           ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPCUSTO_PRODUTO_ABS            ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPCUSTO_PRODUTO_ABS            ADD CONSTRAINT PK_TMPCUSTO_PRODUTO_ABS            PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPCUSTO_PRODUTO_ABS_b01i for TMPCUSTO_PRODUTO_ABS                  active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPCUSTO_PRODUTO_ABS           ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPFATURAMENTO_ITEM            ;  ALTER TABLE TMPFATURAMENTO_ITEM             ADD ID INTEGER;  commit work; UPDATE TMPFATURAMENTO_ITEM             SET ID = gen_id(GTMPFATURAMENTO_ITEM            ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPFATURAMENTO_ITEM             ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPFATURAMENTO_ITEM             ADD CONSTRAINT PK_TMPFATURAMENTO_ITEM             PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPFATURAMENTO_ITEM_b01i for TMPFATURAMENTO_ITEM                    active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPFATURAMENTO_ITEM            ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPFRETE                       ;  ALTER TABLE TMPFRETE                        ADD ID INTEGER;  commit work; UPDATE TMPFRETE                        SET ID = gen_id(GTMPFRETE                       ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPFRETE                        ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPFRETE                        ADD CONSTRAINT PK_TMPFRETE                        PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPFRETE_b01i for TMPFRETE                                          active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPFRETE                       ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPGERAL                       ;  ALTER TABLE TMPGERAL                        ADD ID INTEGER;  commit work; UPDATE TMPGERAL                        SET ID = gen_id(GTMPGERAL                       ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPGERAL                        ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPGERAL                        ADD CONSTRAINT PK_TMPGERAL                        PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPGERAL_b01i for TMPGERAL                                          active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPGERAL                       ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPGERAL2                      ;  ALTER TABLE TMPGERAL2                       ADD ID INTEGER;  commit work; UPDATE TMPGERAL2                       SET ID = gen_id(GTMPGERAL2                      ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPGERAL2                       ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPGERAL2                       ADD CONSTRAINT PK_TMPGERAL2                       PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPGERAL2_b01i for TMPGERAL2                                        active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPGERAL2                      ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPGERAL3                      ;  ALTER TABLE TMPGERAL3                       ADD ID INTEGER;  commit work; UPDATE TMPGERAL3                       SET ID = gen_id(GTMPGERAL3                      ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPGERAL3                       ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPGERAL3                       ADD CONSTRAINT PK_TMPGERAL3                       PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPGERAL3_b01i for TMPGERAL3                                        active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPGERAL3                      ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPGERAL4                      ;  ALTER TABLE TMPGERAL4                       ADD ID INTEGER;  commit work; UPDATE TMPGERAL4                       SET ID = gen_id(GTMPGERAL4                      ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPGERAL4                       ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPGERAL4                       ADD CONSTRAINT PK_TMPGERAL4                       PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPGERAL4_b01i for TMPGERAL4                                        active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPGERAL4                      ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPGERAL6                      ;  ALTER TABLE TMPGERAL6                       ADD ID INTEGER;  commit work; UPDATE TMPGERAL6                       SET ID = gen_id(GTMPGERAL6                      ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPGERAL6                       ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPGERAL6                       ADD CONSTRAINT PK_TMPGERAL6                       PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPGERAL6_b01i for TMPGERAL6                                        active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPGERAL6                      ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPINDICADOR1                  ;  ALTER TABLE TMPINDICADOR1                   ADD ID INTEGER;  commit work; UPDATE TMPINDICADOR1                   SET ID = gen_id(GTMPINDICADOR1                  ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPINDICADOR1                   ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPINDICADOR1                   ADD CONSTRAINT PK_TMPINDICADOR1                   PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPINDICADOR1_b01i for TMPINDICADOR1                                active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPINDICADOR1                  ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPINDICADOR2                  ;  ALTER TABLE TMPINDICADOR2                   ADD ID INTEGER;  commit work; UPDATE TMPINDICADOR2                   SET ID = gen_id(GTMPINDICADOR2                  ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPINDICADOR2                   ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPINDICADOR2                   ADD CONSTRAINT PK_TMPINDICADOR2                   PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPINDICADOR2_b01i for TMPINDICADOR2                                active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPINDICADOR2                  ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPINDICADOR3                  ;  ALTER TABLE TMPINDICADOR3                   ADD ID INTEGER;  commit work; UPDATE TMPINDICADOR3                   SET ID = gen_id(GTMPINDICADOR3                  ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPINDICADOR3                   ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPINDICADOR3                   ADD CONSTRAINT PK_TMPINDICADOR3                   PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPINDICADOR3_b01i for TMPINDICADOR3                                active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPINDICADOR3                  ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPINDICADOR4                  ;  ALTER TABLE TMPINDICADOR4                   ADD ID INTEGER;  commit work; UPDATE TMPINDICADOR4                   SET ID = gen_id(GTMPINDICADOR4                  ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPINDICADOR4                   ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPINDICADOR4                   ADD CONSTRAINT PK_TMPINDICADOR4                   PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPINDICADOR4_b01i for TMPINDICADOR4                                active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPINDICADOR4                  ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPINDICADOR7                  ;  ALTER TABLE TMPINDICADOR7                   ADD ID INTEGER;  commit work; UPDATE TMPINDICADOR7                   SET ID = gen_id(GTMPINDICADOR7                  ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPINDICADOR7                   ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPINDICADOR7                   ADD CONSTRAINT PK_TMPINDICADOR7                   PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPINDICADOR7_b01i for TMPINDICADOR7                                active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPINDICADOR7                  ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPMEDIANA                     ;  ALTER TABLE TMPMEDIANA                      ADD ID INTEGER;  commit work; UPDATE TMPMEDIANA                      SET ID = gen_id(GTMPMEDIANA                     ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPMEDIANA                      ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPMEDIANA                      ADD CONSTRAINT PK_TMPMEDIANA                      PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPMEDIANA_b01i for TMPMEDIANA                                      active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPMEDIANA                     ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPMETA_FATURAMENTO            ;  ALTER TABLE TMPMETA_FATURAMENTO             ADD ID INTEGER;  commit work; UPDATE TMPMETA_FATURAMENTO             SET ID = gen_id(GTMPMETA_FATURAMENTO            ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPMETA_FATURAMENTO             ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPMETA_FATURAMENTO             ADD CONSTRAINT PK_TMPMETA_FATURAMENTO             PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPMETA_FATURAMENTO_b01i for TMPMETA_FATURAMENTO                    active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPMETA_FATURAMENTO            ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPMOVIMENTACAO_ESTOQUE        ;  ALTER TABLE TMPMOVIMENTACAO_ESTOQUE         ADD ID INTEGER;  commit work; UPDATE TMPMOVIMENTACAO_ESTOQUE         SET ID = gen_id(GTMPMOVIMENTACAO_ESTOQUE        ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPMOVIMENTACAO_ESTOQUE         ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPMOVIMENTACAO_ESTOQUE         ADD CONSTRAINT PK_TMPMOVIMENTACAO_ESTOQUE         PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPMOVIMENTACAO_ESTOQUE_b01i for TMPMOVIMENTACAO_ESTOQUE            active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPMOVIMENTACAO_ESTOQUE        ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPPEDIDOS_POR_MES             ;  ALTER TABLE TMPPEDIDOS_POR_MES              ADD ID INTEGER;  commit work; UPDATE TMPPEDIDOS_POR_MES              SET ID = gen_id(GTMPPEDIDOS_POR_MES             ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPPEDIDOS_POR_MES              ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPPEDIDOS_POR_MES              ADD CONSTRAINT PK_TMPPEDIDOS_POR_MES              PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPPEDIDOS_POR_MES_b01i for TMPPEDIDOS_POR_MES                      active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPPEDIDOS_POR_MES             ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPPEDIDO_ITEM_ABERTO          ;  ALTER TABLE TMPPEDIDO_ITEM_ABERTO           ADD ID INTEGER;  commit work; UPDATE TMPPEDIDO_ITEM_ABERTO           SET ID = gen_id(GTMPPEDIDO_ITEM_ABERTO          ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPPEDIDO_ITEM_ABERTO           ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPPEDIDO_ITEM_ABERTO           ADD CONSTRAINT PK_TMPPEDIDO_ITEM_ABERTO           PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPPEDIDO_ITEM_ABERTO_b01i for TMPPEDIDO_ITEM_ABERTO                active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPPEDIDO_ITEM_ABERTO          ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPPREPARACAO_PIVOT            ;  ALTER TABLE TMPPREPARACAO_PIVOT             ADD ID INTEGER;  commit work; UPDATE TMPPREPARACAO_PIVOT             SET ID = gen_id(GTMPPREPARACAO_PIVOT            ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPPREPARACAO_PIVOT             ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPPREPARACAO_PIVOT             ADD CONSTRAINT PK_TMPPREPARACAO_PIVOT             PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPPREPARACAO_PIVOT_b01i for TMPPREPARACAO_PIVOT                    active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPPREPARACAO_PIVOT            ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPPRODUCAO_ITEM_ABERTO        ;  ALTER TABLE TMPPRODUCAO_ITEM_ABERTO         ADD ID INTEGER;  commit work; UPDATE TMPPRODUCAO_ITEM_ABERTO         SET ID = gen_id(GTMPPRODUCAO_ITEM_ABERTO        ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPPRODUCAO_ITEM_ABERTO         ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPPRODUCAO_ITEM_ABERTO         ADD CONSTRAINT PK_TMPPRODUCAO_ITEM_ABERTO         PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPPRODUCAO_ITEM_ABERTO_b01i for TMPPRODUCAO_ITEM_ABERTO            active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPPRODUCAO_ITEM_ABERTO        ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPPROGRAMACAO_REGISTRO        ;  ALTER TABLE TMPPROGRAMACAO_REGISTRO         ADD ID INTEGER;  commit work; UPDATE TMPPROGRAMACAO_REGISTRO         SET ID = gen_id(GTMPPROGRAMACAO_REGISTRO        ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPPROGRAMACAO_REGISTRO         ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPPROGRAMACAO_REGISTRO         ADD CONSTRAINT PK_TMPPROGRAMACAO_REGISTRO         PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPPROGRAMACAO_REGISTRO_b01i for TMPPROGRAMACAO_REGISTRO            active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPPROGRAMACAO_REGISTRO        ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPPROGRAMACAO_REGISTRO_JUST   ;  ALTER TABLE TMPPROGRAMACAO_REGISTRO_JUST    ADD ID INTEGER;  commit work; UPDATE TMPPROGRAMACAO_REGISTRO_JUST    SET ID = gen_id(GTMPPROGRAMACAO_REGISTRO_JUST   ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPPROGRAMACAO_REGISTRO_JUST    ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPPROGRAMACAO_REGISTRO_JUST    ADD CONSTRAINT PK_TMPPROGRAMACAO_REGISTRO_JUST    PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPPROGRAMACAO_REGISTRO_JUST_b01i for TMPPROGRAMACAO_REGISTRO_JUST  active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPPROGRAMACAO_REGISTRO_JUST   ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPREGISTROS_POR_MES           ;  ALTER TABLE TMPREGISTROS_POR_MES            ADD ID INTEGER;  commit work; UPDATE TMPREGISTROS_POR_MES            SET ID = gen_id(GTMPREGISTROS_POR_MES           ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPREGISTROS_POR_MES            ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPREGISTROS_POR_MES            ADD CONSTRAINT PK_TMPREGISTROS_POR_MES            PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPREGISTROS_POR_MES_b01i for TMPREGISTROS_POR_MES                  active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPREGISTROS_POR_MES           ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPRELATORIO_PECA_DISPONIVEL   ;  ALTER TABLE TMPRELATORIO_PECA_DISPONIVEL    ADD ID INTEGER;  commit work; UPDATE TMPRELATORIO_PECA_DISPONIVEL    SET ID = gen_id(GTMPRELATORIO_PECA_DISPONIVEL   ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPRELATORIO_PECA_DISPONIVEL    ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPRELATORIO_PECA_DISPONIVEL    ADD CONSTRAINT PK_TMPRELATORIO_PECA_DISPONIVEL    PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPRELATORIO_PECA_DISPONIVEL_b01i for TMPRELATORIO_PECA_DISPONIVEL  active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPRELATORIO_PECA_DISPONIVEL   ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMPTEMPO_MODELO                ;  ALTER TABLE TMPTEMPO_MODELO                 ADD ID INTEGER;  commit work; UPDATE TMPTEMPO_MODELO                 SET ID = gen_id(GTMPTEMPO_MODELO                ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMPTEMPO_MODELO                 ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMPTEMPO_MODELO                 ADD CONSTRAINT PK_TMPTEMPO_MODELO                 PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMPTEMPO_MODELO_b01i for TMPTEMPO_MODELO                            active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMPTEMPO_MODELO                ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMP_REP_CUSTO_MATERIA_PRIMA    ;  ALTER TABLE TMP_REP_CUSTO_MATERIA_PRIMA     ADD ID INTEGER;  commit work; UPDATE TMP_REP_CUSTO_MATERIA_PRIMA     SET ID = gen_id(GTMP_REP_CUSTO_MATERIA_PRIMA    ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP_REP_CUSTO_MATERIA_PRIMA     ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP_REP_CUSTO_MATERIA_PRIMA     ADD CONSTRAINT PK_TMP_REP_CUSTO_MATERIA_PRIMA     PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP_REP_CUSTO_MATERIA_PRIMA_b01i for TMP_REP_CUSTO_MATERIA_PRIMA    active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP_REP_CUSTO_MATERIA_PRIMA    ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMP_SPC_INTEGRIDADE_CONTABIL   ;  ALTER TABLE TMP_SPC_INTEGRIDADE_CONTABIL    ADD ID INTEGER;  commit work; UPDATE TMP_SPC_INTEGRIDADE_CONTABIL    SET ID = gen_id(GTMP_SPC_INTEGRIDADE_CONTABIL   ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP_SPC_INTEGRIDADE_CONTABIL    ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP_SPC_INTEGRIDADE_CONTABIL    ADD CONSTRAINT PK_TMP_SPC_INTEGRIDADE_CONTABIL    PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP_SPC_INTEGRIDADE_CONTABIL_b01i for TMP_SPC_INTEGRIDADE_CONTABIL  active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP_SPC_INTEGRIDADE_CONTABIL   ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMP_SPC_NF_CONTABIL            ;  ALTER TABLE TMP_SPC_NF_CONTABIL             ADD ID INTEGER;  commit work; UPDATE TMP_SPC_NF_CONTABIL             SET ID = gen_id(GTMP_SPC_NF_CONTABIL            ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP_SPC_NF_CONTABIL             ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP_SPC_NF_CONTABIL             ADD CONSTRAINT PK_TMP_SPC_NF_CONTABIL             PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP_SPC_NF_CONTABIL_b01i for TMP_SPC_NF_CONTABIL                    active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP_SPC_NF_CONTABIL            ,1);  end  ^  SET TERM ; ^
CREATE SEQUENCE GTMP_SPI_NF_CONTABIL            ;  ALTER TABLE TMP_SPI_NF_CONTABIL             ADD ID INTEGER;  commit work; UPDATE TMP_SPI_NF_CONTABIL             SET ID = gen_id(GTMP_SPI_NF_CONTABIL            ,1) WHERE ID IS NULL; commit work;  ALTER TABLE TMP_SPI_NF_CONTABIL             ALTER COLUMN ID SET NOT NULL;  ALTER TABLE TMP_SPI_NF_CONTABIL             ADD CONSTRAINT PK_TMP_SPI_NF_CONTABIL             PRIMARY KEY (ID);  SET TERM ^ ;  create trigger tTMP_SPI_NF_CONTABIL_b01i for TMP_SPI_NF_CONTABIL                    active before insert position 0  as  begin    if (new.ID is null) then      new.ID = gen_id(gTMP_SPI_NF_CONTABIL            ,1);  end  ^  SET TERM ; ^


 commit work;