[firebase-br] Erro ao criar banco - help-me please.

Janderson Almeida jandersonloko em gmail.com
Qua Maio 7 20:17:23 -03 2008


Obrigado

2008/5/6 Vilcionei Weirich <vilcionei em gmail.com>:

> O problema esta ocorrendo porque a chave primária com o nome pk_numeroDAS
> está sendo criado nas tabelas DAS e TributosFilial, por isso da o erro de
> índice duplicado.
>
> espero ter ajudado.
>
> até..
>
> On Tue, May 6, 2008 at 10:13 AM, Janderson Almeida <
> jandersonloko em gmail.com>
> wrote:
>
> > Gerenciador: IBExpert
> > Banco: Firebird 2.03
> >
> > Banco que estah sendo criado:
> >
> > CREATE DOMAIN BOOLEAN AS
> >   CHAR(1)
> >   DEFAULT 'F'
> >   CHECK (value in ('F', 'T')
> > );
> >
> > create table contribuinte(
> >   CNPJBase char(8) not null,
> >   CNPJ char(14) not null,
> >   datInicioAtividade date not null,
> >   optanteSimples boolean not null,
> >   codAtividade int not null,
> >   codMunicipio int not null,
> >   UF char(2) not null,
> >   constraint pk_cnpjBase primary key(CNPJBase)
> > );
> >
> > create table DAS
> > (
> >   numeroDAS char(17) not null,
> >   CNPJbase char(8) not null,
> >   isApuracao boolean not null,
> >   periodoApuracao date not null,
> >   dataVencimento date not null,
> >   dataLimiteAcolhimento date not null,
> >   valorInicial numeric(9,2) not null,
> >   valorJuros numeric(9,2) not null,
> >   valorMultas numeric(9,2) not null,
> >   valorReal numeric (9,2) not null,
> >   limiteEstadual numeric(9,2) not null,
> >   indiceMajoracao float not null,
> >   constraint pk_numeroDAS primary key(numeroDAS),
> >   constraint fk_CNPJBase_Contribuiinte foreign key (CNPJBase) references
> > contribuinte
> > );
> >
> > create table filial
> > (
> >   CNPJFilial char(14) not null,
> >   CNPJmatriz char(14) not null,
> >   UF char(2) not null,
> >   codMunicipio int not null,
> >   constraint pk_CNPJFilial primary key (CNPJFilial),
> >   constraint fk_CNPJMatriz_Contribuinte foreign key(CNPJmatriz)
> references
> > contribuinte
> > );
> >
> > create table TributosFilial
> > (
> >   CNPJFilial char(14) not null,
> >   numeroDAS char(17) not null,
> >   ICMS numeric(9,2) not null,
> >   ISS numeric(9,2) not null,
> >   valorReceitaInformado numeric(9,2) not null,
> >   constraint pk_numeroDAS primary key (numeroDAS),
> >   constraint fk_CNPJFilial_Filial foreign key(CNPJFilial) references
> > filial,
> >   constraint fk_numeroDAS_DAS foreign key(numeroDAS) references das
> > );
> >
> > -- Quando chega na ultima tabela estah dando este erro:
> >
> > This operation is not defined for system tables.
> > unsuccessful metadata update.
> > STORE RDB$INDICES failed.
> > attempt to store duplicate value (visible to active transactions) in
> > unique
> > index "RDB$INDEX_5".
> >
> >
> > Que isso? O que eu estou fazendo de errado?
> >
> > grato.
> >
> > Janderson Almeida.
> > ______________________________________________
> > FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> > Para saber como gerenciar/excluir seu cadastro na lista, use:
> > http://www.firebase.com.br/fb/artigo.php?id=1107
> > Para consultar mensagens antigas: http://firebase.com.br/pesquisa
> >
> ______________________________________________
> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> Para saber como gerenciar/excluir seu cadastro na lista, use:
> http://www.firebase.com.br/fb/artigo.php?id=1107
> Para consultar mensagens antigas: http://firebase.com.br/pesquisa
>



Mais detalhes sobre a lista de discussão lista