Get Data from postgresql db?

Hi there,

is there any way to get Data from a Postgresql db to use it in calc?
i have a long table with values i need for executing a postgresql query. the result should be written in another empty cell in calc. Is something like that possible?

cheers and thanks!

file>new>database…
connect to existing db
type: PostgreSQL
specify the connection parameters
check “register db”
save the database document
create queries and save the document

in calc:
view>data sources
drag a query icon from the left pane onto a cell

Hi, thanks for your fast reply! i have managed to get an example query to be displayed in calc!
maybe i was not too precise with my first question, but i need to find a way to get the current cell value into the query:
for example i have a column (in calc) of data and need to then get the data from the database acording to that value (for example: "SELECT * from xyz WHERE height LIKE “vlaueFromTheCalcCell” ")
i ultimately want to have a second column where each row represents the result from the query.

how would i get this done?

So to be a little bit clearer, i am trying to do something like this:

but i continue to get Error 504.

Hmm, i tried it now by using Makros, but also fail with what i want to do:

any idea here?

Have you tried running your sql query with DBeaver (or some similar tool)?
What is the LIKE operator used for when there are no wildcards?
What is the structure of berlinParcels table (view)?

Simple solution:
Use a parameter query like

SELECT "something" 
FROM "somewhere"
WHERE "something" = :Please_Enter_Something

notice the colon in front of the named parameter.
Whenever you refresh that query, a dialog pops up prompting for parameter substitution.

I know it’s a old post but just had to do the same and the easiest way that worked for me is create a View in your database with the exact query you want and then use the above instructions
in calc: view>data sources
drag db, table, view query icon from the left pane onto a cell