Duncan Adams | 11 Nov 14:59 2013
Picon

Postgres and Calc

Hi All

Hope you are all well.

I have a postgres database with a table called item_table that has the
following columns:

location_id, item_id, owner_id, quantity

I am attempting to connect a query such as
    select quantity from item_table where location_id = 1 and item_id = 1
and owner_id = 1
to a Libreoffice Calc cell for instance sheet1.d7

As a more complex version I would like to do something like
    select quantity from item_table where location_id = Sheet2.E16  and
item_id = Sheet2.H16 and owner_id = Sheet2.C1
(Drop down box's at those locations would give back full points although
not needed to make things work)

However I would be happy just to get the first bit working.

>From my web research I have found that I can connect to BASE for example
using the following tutorial.
http://dcparris.net/2012/07/06/connecting-libreoffice-to-postgresql-natively/
or
https://forum.openoffice.org/en/forum/viewtopic.php?f=75&t=3294 part 5

However this seems to be a static link that needs to be manually updated
each time.
(Continue reading)

Alexander Thurgood | 12 Nov 09:21 2013
Picon

Re: Postgres and Calc

Le 11/11/13 14:59, Duncan Adams a écrit :

Hi Duncan,

> I am attempting to connect a query such as
>     select quantity from item_table where location_id = 1 and item_id = 1
> and owner_id = 1
> to a Libreoffice Calc cell for instance sheet1.d7

I don't see how you can do this absent the use of a macro or some other
script to parse the data in your cells that are not part of the query,
then compose the query and send that to your pg backend.

> 
> As a more complex version I would like to do something like
>     select quantity from item_table where location_id = Sheet2.E16  and
> item_id = Sheet2.H16 and owner_id = Sheet2.C1
> (Drop down box's at those locations would give back full points although
> not needed to make things work)
> 

I would assume that the same would be required here, i.e. macros /
scripting.

You might try asking your question on the OpenOffice.org forum, I'm
pretty certain something similar has been asked already.

Alex

--

-- 
(Continue reading)


Gmane