Thread: Stored procedure support for PSQLODBC
Hi,
I am trying to execute a stored procedure query using SQLExecDirect of psqlodbc driver.
The sample statement is below
{call public.SXRCXT18_GETDESC1( ?, ? )}
I am getting an error -
ERROR: public.sxrcxt18_getdesc1(unknown, unknown) is a procedure; Error while executing the query SQLNativeErr = {3} SQLErrorText = {4}. SQLEXEC Id1 error (SQLState = ERROR: public.sxrcxt18_getdesc1(unknown, unknown) is a procedure; Error while executing the query SQLNativeErr = {3} SQLErrorText = {4}
Can you please tell me the reason for this? Is there a different way to call stored procedure ?
Regards,
Abhishek Kumar
Yes, you need to omit the curly braces.
Curly braces is ODBC syntax, and because PostgreSQL used to only have functions and not procedures, the driver maps this syntax to functions. By omitting the curly braces you are using the native PostgreSQL CALL syntax which executes a procedure.
|
CAUTION: This Email is from an EXTERNAL source. Ensure you trust this sender before clicking on any links or attachments. Hi,I am trying to execute a stored procedure query using SQLExecDirect of psqlodbc driver.The sample statement is below{call public.SXRCXT18_GETDESC1( ?, ? )}I am getting an error -ERROR: public.sxrcxt18_getdesc1(unknown, unknown) is a procedure; Error while executing the query SQLNativeErr = {3} SQLErrorText = {4}. SQLEXEC Id1 error (SQLState = ERROR: public.sxrcxt18_getdesc1(unknown, unknown) is a procedure; Error while executing the query SQLNativeErr = {3} SQLErrorText = {4}Can you please tell me the reason for this? Is there a different way to call stored procedure ?Regards,Abhishek Kumar
Good Morning Abhishek,
Can you file an issue on github Issues · postgresql-interfaces/psqlodbc (github.com)
Dave Cramer
www.postgres.rocks
On Wed, 25 Sept 2024 at 02:32, Abhishek Kumar <abhishek.aak0@gmail.com> wrote:
Hi,I am trying to execute a stored procedure query using SQLExecDirect of psqlodbc driver.The sample statement is below{call public.SXRCXT18_GETDESC1( ?, ? )}I am getting an error -ERROR: public.sxrcxt18_getdesc1(unknown, unknown) is a procedure; Error while executing the query SQLNativeErr = {3} SQLErrorText = {4}. SQLEXEC Id1 error (SQLState = ERROR: public.sxrcxt18_getdesc1(unknown, unknown) is a procedure; Error while executing the query SQLNativeErr = {3} SQLErrorText = {4}Can you please tell me the reason for this? Is there a different way to call stored procedure ?Regards,Abhishek Kumar