* Call postgresql function...
@ 2016-07-27 7:55 eduardsapotski
2016-07-27 8:18 ` Dmitry A. Kazakov
0 siblings, 1 reply; 5+ messages in thread
From: eduardsapotski @ 2016-07-27 7:55 UTC (permalink / raw)
Hi all!
I started to learn Ada language.
How to call postgresql function with input and output parameters and return the result?
Maybe there is a good example?
Thank!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Call postgresql function...
2016-07-27 7:55 Call postgresql function eduardsapotski
@ 2016-07-27 8:18 ` Dmitry A. Kazakov
2016-07-27 8:42 ` eduardsapotski
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry A. Kazakov @ 2016-07-27 8:18 UTC (permalink / raw)
On 2016-07-27 09:55, eduardsapotski@gmail.com wrote:
> I started to learn Ada language.
> How to call postgresql function with input and output parameters and return the result?
Meaning?
1. A stored procedure
2. A PostgreSQL API subprogram (from libpq)
3. An SQL statement (preparing, binding, executing, fetching)
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Call postgresql function...
2016-07-27 8:18 ` Dmitry A. Kazakov
@ 2016-07-27 8:42 ` eduardsapotski
2016-07-27 9:09 ` Dmitry A. Kazakov
0 siblings, 1 reply; 5+ messages in thread
From: eduardsapotski @ 2016-07-27 8:42 UTC (permalink / raw)
среда, 27 июля 2016 г., 11:18:48 UTC+3 пользователь Dmitry A. Kazakov написал:
> On 2016-07-27 09:55, eduardsapotski@gmail.com wrote:
>
> > I started to learn Ada language.
> > How to call postgresql function with input and output parameters and return the result?
>
> Meaning?
>
> 1. A stored procedure
> 2. A PostgreSQL API subprogram (from libpq)
> 3. An SQL statement (preparing, binding, executing, fetching)
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de
Здравствуйте, Дмитрий. Как понимаю, русский язык Вам знаком? :)
Есть база PostgreSQL 9.5, в ней много функций. Функции имеют входные и выходные параметры, возвращают значения. Сейчас задача дергать эти функции из приложения на Ада. Хотелось бы найти нормальный пример с подобным функционалом. Самое лучшее что пока нашел: https://rosettacode.org/wiki/Parametrized_SQL_statement#Ada
Но здесь sqlite и немного не то. Может что посоветуете?
Спасибо.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Call postgresql function...
2016-07-27 8:42 ` eduardsapotski
@ 2016-07-27 9:09 ` Dmitry A. Kazakov
2016-07-27 13:14 ` Simon Wright
0 siblings, 1 reply; 5+ messages in thread
From: Dmitry A. Kazakov @ 2016-07-27 9:09 UTC (permalink / raw)
On 2016-07-27 10:42, eduardsapotski@gmail.com wrote:
> среда, 27 июля 2016 г., 11:18:48 UTC+3 пользователь Dmitry A. Kazakov написал:
>> On 2016-07-27 09:55, eduardsapotski@gmail.com wrote:
>>
>>> I started to learn Ada language.
>>> How to call postgresql function with input and output parameters and return the result?
>>
>> Meaning?
>>
>> 1. A stored procedure
>> 2. A PostgreSQL API subprogram (from libpq)
>> 3. An SQL statement (preparing, binding, executing, fetching)
>
> Здравствуйте, Дмитрий. Как понимаю, русский язык Вам знаком? :)
Yes, but this is an English language group. Please, keep posting in English.
> Есть база PostgreSQL 9.5, в ней много функций. Функции имеют входные
> ивыходные параметры, возвращают значения. Сейчас задача дергать эти
> функции из приложения на Ада.
Is it a stored procedure then?
> Хотелось бы найти нормальный пример с
> подобным функционалом. Самое лучшее что пока нашел:
> https://rosettacode.org/wiki/Parametrized_SQL_statement#Ada
> Но здесь sqlite и немного не то. Может что посоветуете?
If don't know if GNATCOLL supports PostgreSQL. If it does, the example
should work fine after you replace/modify the UPDATE statement with a
stored procedure call.
There are other PostgeSQL Ada binding available, e.g. in GNADE and APQ
come in mind, though both are not actively maintained now.
Then, I would of course use ODBC rather than native PostgreSQL bindings.
There is nothing special in how you do this in Ada or, say, in C.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Call postgresql function...
2016-07-27 9:09 ` Dmitry A. Kazakov
@ 2016-07-27 13:14 ` Simon Wright
0 siblings, 0 replies; 5+ messages in thread
From: Simon Wright @ 2016-07-27 13:14 UTC (permalink / raw)
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> If don't know if GNATCOLL supports PostgreSQL.
GNATCOLL does install PostgreSQL.
Running on macOS, it looks for libpq.dylib; if it finds it, it builds
support unless you prevent it by configuring --without-postgresql.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-07-27 13:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-27 7:55 Call postgresql function eduardsapotski
2016-07-27 8:18 ` Dmitry A. Kazakov
2016-07-27 8:42 ` eduardsapotski
2016-07-27 9:09 ` Dmitry A. Kazakov
2016-07-27 13:14 ` Simon Wright
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox