Re: Printable report generation - Mailing list pgsql-general

From will trillich
Subject Re: Printable report generation
Date
Msg-id 20010822121441.A15403@serensoft.com
Whole thread Raw
In response to Re: Printable report generation  (Tony Grant <tony@animaproductions.com>)
List pgsql-general
On Tue, Aug 21, 2001 at 10:25:35AM +0200, Tony Grant wrote:
>
> > > For example, say I've got a postgresql database of client information
> > > (names, addresses, etc.), and I want to use this information to generate
> > > envelopes for mailouts.  As far as my understanding goes, such
> > > functionality is not provided by postgresql itself.
>
> I have the same problem but I need a guide on JDBC serialization. I
> would like to put a button on a JSP that will save the result of a query
> to local disk as a tab delimited file.
>
> That will permit me to open it in AppleWorks for mailing label printing.
>
> Any pointers greatly appreciated

db=# \h copy
Command:     COPY
Description: Copies data between files and tables
Syntax:
COPY [ BINARY ] table [ WITH OIDS ]
    FROM { 'filename' | stdin }
    [ [USING] DELIMITERS 'delimiter' ]
    [ WITH NULL AS 'null string' ]
COPY [ BINARY ] table [ WITH OIDS ]
    TO { 'filename' | stdout }
    [ [USING] DELIMITERS 'delimiter' ]
    [ WITH NULL AS 'null string' ]

db=# copy someTable to '/path/to/file.tsv';

now read tab-separated file "file.tsv" into the program of your
choice.

or use "practical extraction and reporting language" to generate
your reports (perl!)...

--
Khan said that revenge is a dish best served cold. I think
sometimes it's best served hot, chunky, and foaming.
    - P.J.Lee ('79-'80)

will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Join questions
Next
From: Andrew Gould
Date:
Subject: Re: During dump: function not found