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.
I could do the data->refresh however I'm getting old and the brain does not
always remember. This also does not seem to work with a single select
query, but only on a block query.
Some background
I have around 50 cells ( X3 for 3 locations) in Calc that I currently
update manually from just counting inventory in a notebook then entering
them manually when I get to my desk.
I have in the mean time written and designed a system that does a inventory
count and populates a postages database.
I would like that data to be dynamical (or a minute or 10 delay should be
fine) updated into the open Calc document.
I could create a view in the Postgres database with the 50 or so items that
I need and their location and import it to a new sheet in Calc. Do the
manual update from the query wizard in base and then link the cells where I
need the data to the original cells. i.e.
sheet1.E17 = databasesheet.A1.
sheet2.H16 = databasesheet.B2
etc.
However I would prefer the flexibility of a direct database query from a
Calc cell where I could do the 'where' statement based on values from from
other database cells.
Thanks
Eddie
--
To unsubscribe e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted