comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Call postgresql function...
Date: Wed, 27 Jul 2016 11:09:07 +0200
Date: 2016-07-27T11:09:07+02:00	[thread overview]
Message-ID: <nn9tnr$1d4n$1@gioia.aioe.org> (raw)
In-Reply-To: 651f87d2-0c20-4c0c-88e8-a82f241f3466@googlegroups.com

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

  reply	other threads:[~2016-07-27  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-07-27 13:14       ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox