-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jimmy wrote: > Senhores, bom dia. > > Gostaria de tirar umas duvidas sobre importação de arquivo no postgreSQL. > > Preciso concaternar o nome de um arquivo (TXT) com uma data (atual), > pois a data não pode ser fixa, e não estou conseguindo.
> declare > spath varchar(255); > > begin > spath := '/tmp/list_atev001_call_123' || to_date(current_date, > 'yyyymmdd') || '.txt'; > COPY list_tuvision_call FROM spath > with DELIMITER AS '|' NULL AS ''; > RETURN 0; > end; Tente isso: declare spath text; begin spath := '/tmp/list_atev001_call_123' || to_char(current_date, 'yyyymmdd') || '.txt'; EXECUTE 'COPY list_tuvision_call FROM ' || quote_literal(spath) || ' with DELIMITER AS \'|\' NULL AS \'\''; RETURN 0; end; - -- wallace reis Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas/LABBI -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFF3YMdLZIH+ybRHUMRAtP8AJwMd+tnJXW6k9NTkEhfQ9ni2iTCawCeL861 O0An5Uus6TeWiXYho0g1CMc= =DHXM -----END PGP SIGNATURE----- _______________________________________________ Grupo de Usuários do PostgreSQL no Brasil Antes de perguntar consulte o manual http://pgdocptbr.sourceforge.net/ Para editar suas opções ou sair da lista acesse a página da lista em: http://pgfoundry.org/mailman/listinfo/brasil-usuarios
