Em 29/12/2009 13:33, [email protected] escreveu:
> Boa Tarde a todos!!!
>
> Estou estudando a forma apresentada no PGCOM 2009 na palestra
> (http://pgcon.postgresql.org.br/2009/palestras/aud2/ERP.pdf) sobre a
> criação de Campos padrões:
>
> Seguindo a mesma regra apresentada (descrito abaixo).
>
> A minha dúvida é como eu faço no SELECT para pegar o Campo datainativo
> na tabela banco??????
>
>
> Executei vários testes e já GOOGLEI bastante e nada feito não encontrei
> nenhuma informação a respeito.
>
>
> Abraços e Feliz Ano Novo a todos.
>
>
> Eder Sousa
> -----------------------------------------------------------------------------------------------------------------
>
>
> CREATE TABLE ws_controlepadrao
> (
>      fkusuarioregistrobloqueado integer,
>      ativoinativo smallint DEFAULT 1, -- Tamanho(1) 1-Ativo / 2-Inativo
>      datainativo timestamp without time zone,
>      fkusuarioinclusao integer,
>      fkusuarioalteracao integer,
>      datainclusao timestamp without time zone DEFAULT now(),
>      dataalteracao timestamp without time zone,
>      observacao character varying,
>      fkusuariomarcador integer,
>      confirmainclusao integer
> ) WITH ( OIDS=TRUE);
>
> CREATE TABLE banco (
>      pkbanco serial NOT NULL,
>      uk integer[] NOT NULL,
>      fkempresa integer NOT NULL,
>      fkfilial integer NOT NULL,
>      fkunidade integer NOT NULL,
>      controle ws_controlepadrao,                 --<<<  aqui está sendo
> usado a tabela anterior
>      codigo character varying(20),
>      descricao character varying(100),
>      CONSTRAINT pkbanco PRIMARY KEY (pkbanco),
>      CONSTRAINT fkempresa FOREIGN KEY (fkempresa)
>      REFERENCES cadastro (pkcadastro) MATCH SIMPLE
>      ON UPDATE CASCADE ON DELETE RESTRICT,
>      CONSTRAINT fkfilial FOREIGN KEY (fkfilial)
>      REFERENCES cadastro (pkcadastro) MATCH SIMPLE
>      ON UPDATE CASCADE ON DELETE RESTRICT,
>      CONSTRAINT fkunidade FOREIGN KEY (fkunidade)
>      REFERENCES unidade (pkunidade) MATCH SIMPLE
>      ON UPDATE CASCADE ON DELETE RESTRICT,
>      CONSTRAINT ukbanco UNIQUE (uk, codigo)
> ) WITH (OIDS=TRUE);
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
> __________ Information from ESET NOD32 Antivirus, version of virus signature 
> database 4724 (20091229) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>
>    
Seguem os selects possiveis...

SELECT (controle).* FROM banco; -- Apenas as colunas do controle;
SELECT (controle).datainativo FROM banco; -- Apenas a coluna datainativo;
SELECT (controle).datainativo,* FROM banco; -- A coluna datainativo mais 
os outros campos da tabela banco;

Wolak.
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a