Calling stored procedures and functions

Поиск
Список
Период
Сортировка
Искать

Calling stored procedures and functions

От:
Simon Connah <simon.n.connah@protonmail.com>
Дата:
Вложения:
Hi,

I'm really sorry to ask so many questions in such a short period of time but I'm having some issues with getting things to work and Google isn't working too well for me at the moment. At least I am doing what Google tells me but it still isn't working. Anyway, my code is here (along with the error message):

https://gist.github.com/simonconnah/4ea902ca9830caafd3901dea0f84b49f

If anyone could shed some light on why calling this stored procedure isn't working I would really appreciate it.

Thank you.

Simon.

RE: [EXTERNAL] Calling stored procedures and functions

От:
Hanefi Onaldi <Hanefi.Onaldi@microsoft.com>
Дата:
Hi Simon,

I think you need to read more on the differences between PostgreSQL functions and procedures. I suggest you use CALL to execute your procedure, instead of a SELECT.

You can also change the procedure into a function and that will also work.

The syntax is:
CALL proc(...)
or
SELECT func(...)

See https://www.postgresql.org/docs/current/sql-call.html for more info.

-----Original Message-----
From: Simon Connah  
Sent: 30 Mart 2021 Salı 11:23
To: pgsql-novice@lists.postgresql.org
Subject: [EXTERNAL] Calling stored procedures and functions

Hi,

I'm really sorry to ask so many questions in such a short period of time but I'm having some issues with getting things to work and Google isn't working too well for me at the moment. At least I am doing what Google tells me but it still isn't working. Anyway, my code is here (along with the error message):

https://gist.github.com/simonconnah/4ea902ca9830caafd3901dea0f84b49f

If anyone could shed some light on why calling this stored procedure isn't working I would really appreciate it.

Thank you.

Simon.

RE: [EXTERNAL] Calling stored procedures and functions

От:
Simon Connah <simon.n.connah@protonmail.com>
Дата:
Вложения:
On Tuesday, March 30th, 2021 at 09:32, Hanefi Onaldi  wrote:

> Hi Simon,
> 

> I think you need to read more on the differences between PostgreSQL functions and procedures. I suggest you use CALL to execute your procedure, instead of a SELECT.
> 

> You can also change the procedure into a function and that will also work.
> 

> The syntax is:
> 

> CALL proc(...)
> 

> or
> 

> SELECT func(...)
> 

> See https://www.postgresql.org/docs/current/sql-call.html for more info.
> 


Thank you! I was getting them the wrong way around. Everything seems to be working now. I really appreciate your help.

Simon.
FAQ