Re: [INTERFACES] DBI and 'COPY' ... possible?

Поиск
Список
Период
Сортировка
От Goran Thyni
Тема Re: [INTERFACES] DBI and 'COPY' ... possible?
Дата
Msg-id 3842D7BB.8008988@kirra.net
обсуждение исходный текст
Ответ на DBI and 'COPY' ... possible?  (The Hermit Hacker <scrappy@hub.org>)
Список pgsql-interfaces
The Hermit Hacker wrote:
> 
> I've just checked the perldoc's on DBI and DBD::Pg, and can't see any way
> of doing this in perl that "jumps out at me"...has anyone gotten this to
> work, and how?

Marc,

No DBI-way I konow of,
but perl is the greatest glue language.

I did it like this, exemple below:
   open(FIL, "| psql $databas");   print FIL "COPY x_kw FROM STDIN USING DELIMITERS '|';\n";   foreach (sort keys %kw)
  {       my $id = $kw{$_};       /^(.+)\+(\w)$/;       my ($kw,$kat) = ($1,$2);       print FIL "$id|$kw|$kat\n";
}  close FIL;
 


best regards,
Göran Thyni

--------------------
On quiet nights you can hear Windows NT reboot!

************




В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: [INTERFACES] pgaccess on win95 connection
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [INTERFACES] libpq + multiple connections ...