Thread: Quick-and-Dirty Data Entry with LibreOffice3?

Quick-and-Dirty Data Entry with LibreOffice3?

From
Rich Shepard
Date:
   Rather than writing an application right now to enter data into a table I
thought of trying LibreOffice as a front end. But, it doesn't seem to work
as OO.o did. This leads to two questions:

   1)  Can someone show me how to use LO as a front end to a postgres table?

   2)  Is there another tool suitable for a linux box for some data entry
work?

Rich

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Filip Rembiałkowski
Date:


2011/9/26 Rich Shepard <rshepard@appl-ecosys.com>
 Rather than writing an application right now to enter data into a table I
thought of trying LibreOffice as a front end. But, it doesn't seem to work
as OO.o did.

It does, albeit you will need libreoffice-base which is not always installed by default (not in my Ubuntu). And of course the JDBC driver.


  1)  Can someone show me how to use LO as a front end to a postgres table?

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
planas
Date:
Rich

On Mon, 2011-09-26 at 11:38 -0700, Rich Shepard wrote:
Rather than writing an application right now to enter data into a table I
thought of trying LibreOffice as a front end. But, it doesn't seem to work
as OO.o did. This leads to two questions:

   1)  Can someone show me how to use LO as a front end to a postgres table?

2)  Is there another tool suitable for a linux box for some data entry
work?

Rich

Which version of LO are you using and which Linux? I have some experience with using LO as a front-end when pgAdmin is not the best tool.

I have noticed that with Ubuntu you need to use the 3.3.x series from the repository. There is pg connector for LO 3.3.x in the repository. Getting 3.4.x to connect is more of a pain in Ubuntu. I think the correct driver is libreoffice-sdbc-postgresql.

The steps I use are
1 Open Base and select connect to an existing database.
2 Scroll down to postgresq and select (it will be there if the correct driver is present)
3 On the next screen you will need to enter the connection information (dbname = ????, host = ////)
4 On the next screen enter your user information
5 On the next screen I usually enter the defaults
6 You should be in Base.


--
Jay Lozier
jslozier@gmail.com

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Rich Shepard
Date:
On Mon, 26 Sep 2011, planas wrote:

> Which version of LO are you using and which Linux? I have some experience
> with using LO as a front-end when pgAdmin is not the best tool.

   LO-3.4.3 on Slackware-13.1/32-bit.

> I have noticed that with Ubuntu you need to use the 3.3.x series from the
> repository. There is pg connector for LO 3.3.x in the repository. Getting
> 3.4.x to connect is more of a pain in Ubuntu. I think the correct driver
> is libreoffice-sdbc-postgresql.

   A Google search for 'libreoffice-sdbc-postgresql' actually turns up a link
that supposed to have a .txz version for Slackware, but the only packages on
the site are .deb. Oh, well. I'll keep looking.

Thanks,

Rich

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Richard Broersma
Date:
On Tue, Sep 27, 2011 at 9:15 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

>  A Google search for 'libreoffice-sdbc-postgresql' actually turns up a link
> that supposed to have a .txz version for Slackware, but the only packages on
> the site are .deb. Oh, well. I'll keep looking.

I'd recommend using JDBC ODBC driver for PostgreSQL.  Open Office via
direct JDBC has a hard time with some PostgreSQL data-types.  ODBC
handles this by converting these to a text representation that Open
Office can handle.

--
Regards,
Richard Broersma Jr.

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Rich Shepard
Date:
On Tue, 27 Sep 2011, Richard Broersma wrote:

> I'd recommend using JDBC ODBC driver for PostgreSQL.  Open Office via
> direct JDBC has a hard time with some PostgreSQL data-types.  ODBC handles
> this by converting these to a text representation that Open Office can
> handle.

Richard,

   LibreOffice tells me it cannot generate an ODBC connection because it
cannot find libodbc.so.1. There is no such library on my system. I'll see if
I can find it via SlackBuilds.org.

Rich

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Rich Shepard
Date:
On Tue, 27 Sep 2011, Richard Broersma wrote:

> ODBC handles this by converting these to a text representation that Open
> Office can handle.

Richard,

   Progress has been made. I built and installed unixODBC from
slackbuilds.org and now the hangup is identifying the location and name of
the database to LO.

   All my postgresql databases are in /usr/local/pgsql/data/base/ in numbered
subdirectories. I've no idea in which one resides the database I want.

   Is there a way to determine where my database is located?

Thanks,

Rich


Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Richard Broersma
Date:
You will need to use the PostgreSQL ODBC driver.  I should mention
that I haven't used ODBC from a Linux client before.  I found the some
instructions in the mailing list archive:
http://archives.postgresql.org/pgsql-odbc/2002-02/msg00023.php

On Tue, Sep 27, 2011 at 11:20 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:
> On Tue, 27 Sep 2011, Richard Broersma wrote:
>
>> ODBC handles this by converting these to a text representation that Open
>> Office can handle.
>
> Richard,
>
>  Progress has been made. I built and installed unixODBC from
> slackbuilds.org and now the hangup is identifying the location and name of
> the database to LO.
>
>  All my postgresql databases are in /usr/local/pgsql/data/base/ in numbered
> subdirectories. I've no idea in which one resides the database I want.
>
>  Is there a way to determine where my database is located?
>
> Thanks,
>
> Rich
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>



--
Regards,
Richard Broersma Jr.

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
John R Pierce
Date:
On 09/27/11 11:20 AM, Rich Shepard wrote:
>   All my postgresql databases are in /usr/local/pgsql/data/base/ in
> numbered
> subdirectories. I've no idea in which one resides the database I want.
>
>   Is there a way to determine where my database is located?


Eeek! you NEVER directly access the postgres data files.  rather, you
connect to postgres via a socket, and ask it to fetch the data for you,
thats just how it works.

your database and all the databases on that system are in
/usr/local/pgsql/data ... they involve multiple of those subdirectories,
you can't seperate the pieces from the whole without breaking it completely.

to use ODBC, you'd need to give it the DSN information, I don't know the
exact format, but in general, its something like

    [PostgreSQL]
    Description         = Postgres Database FRED
    Driver              = PostgreSQL
    Trace               = Yes
    TraceFile           = sql.log
    Database            = FRED
    Servername          = localhost
    UserName            = fred
    Password            =
    Port                = 5432


--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Rich Shepard
Date:
On Tue, 27 Sep 2011, John R Pierce wrote:

> Eeek! you NEVER directly access the postgres data files.  rather, you
> connect to postgres via a socket, and ask it to fetch the data for you,
> thats just how it works.

   Well, when the LO odbc window asks for the location of the database to which
to connect, what do I tell it?

> to use ODBC, you'd need to give it the DSN information, I don't know the
> exact format, but in general, its something like
>
>     [PostgreSQL]
>     Description         = Postgres Database FRED
>     Driver              = PostgreSQL
>     Trace               = Yes
>     TraceFile           = sql.log
>     Database            = FRED
>     Servername          = localhost
>     UserName            = fred
>     Password            =
>     Port                = 5432

   I'm not presented with an opportunity to offer any of this information
anywhere.

   Guess the most practical thing to do is give up trying to use LO as a
front end. I'll just write INSTALL INTO ... statements in emacs then use
psql to read them into the table.

Thanks all,

Rich

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Vincent Veyron
Date:
Le mardi 27 septembre 2011 à 13:19 -0700, Rich Shepard a écrit :
> On Tue, 27 Sep 2011, John R Pierce wrote:
>
> > to use ODBC, you'd need to give it the DSN information, I don't know the
> > exact format, but in general, its something like
> >
> >     [PostgreSQL]
> >     Description         = Postgres Database FRED
> >     Driver              = PostgreSQL

[...]

>    I'm not presented with an opportunity to offer any of this information
> anywhere.
>

These are the notes I took for an installation of linuxodbc on Debian;
they are a few years old because I came to the same conclusion as you
(see below) :

apt-get install linuxodbc

#install postgres driver
apt-get install odbc-postgresql
odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template
#create data source
cat /usr/share/doc/odbc-postgresql/examples/odbc.ini.template >> /etc/odbc.ini
#edit pg_hba.conf
# All IPv4 connections from localhost
#host    all         all         127.0.0.1         255.255.255.255   ident sameuser
host    all         all         127.0.0.1         255.255.255.255   trust
#test connectivity with isql
isql 'odbcname' username


>    Guess the most practical thing to do is give up trying to use LO as a
> front end. I'll just write INSTALL INTO ... statements in emacs then use
> psql to read them into the table.

I'm not sure what 'INSTALL INTO ... statements' are, but are you aware
of the very convenient 'M-x sql-postgres' in emacs?

I got it to work with this in my .emacs file

(setq sql-user "yourusername")
(setq sql-database "yourdbname")
(setq sql-server "localhost")
(setq sql-postgres-options '("-Uyourusername" "-P" "pager=off"))


I use that and a mix of copy/paste/replace between emacs and a
spreadsheet to generate all the statements I need;



--
Vincent Veyron
http://marica.fr/
Logiciel de gestion des sinistres et des contentieux pour le service juridique


Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Rich Shepard
Date:
On Wed, 28 Sep 2011, Vincent Veyron wrote:

> I'm not sure what 'INSTALL INTO ... statements' are, but are you aware
> of the very convenient 'M-x sql-postgres' in emacs?

Vincent,

   I have a SQL major mode for emacs. Don't know that it's specific to
postgres but it is automatically invoked when I open a buffer with a .sql
file name. I get syntax-related colors; perhaps it does more of which I am
unaware.

> I got it to work with this in my .emacs file
>
> (setq sql-user "yourusername")
> (setq sql-database "yourdbname")
> (setq sql-server "localhost")
> (setq sql-postgres-options '("-Uyourusername" "-P" "pager=off"))

   I'll look for sql-postgres if it will allow me to add rows to an existing
table.

Many thanks,

Rich

Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Vincent Veyron
Date:
Le mercredi 28 septembre 2011 à 06:07 -0700, Rich Shepard a écrit :
> On Wed, 28 Sep 2011, Vincent Veyron wrote:
>
> > I'm not sure what 'INSTALL INTO ... statements' are, but are you aware
> > of the very convenient 'M-x sql-postgres' in emacs?
>
> Vincent,
>
>    I have a SQL major mode for emacs. Don't know that it's specific to
> postgres but it is automatically invoked when I open a buffer with a .sql
> file name. I get syntax-related colors; perhaps it does more of which I am
> unaware.


You get a lot more : this gives you an interface to Postgresql inside an
Emacs buffer.


--
Vincent Veyron
http://marica.fr/
Logiciel de gestion des sinistres et des contentieux pour le service juridique


Re: Quick-and-Dirty Data Entry with LibreOffice3?

From
Rich Shepard
Date:
On Fri, 30 Sep 2011, Vincent Veyron wrote:

> You get a lot more : this gives you an interface to Postgresql inside an
> Emacs buffer.

   Thank you.

Rich