 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[9.2.349 Pro] - Issues with PostgreSQL prepared statements |
|
I've got problems preparing prepared statements in PostgreSQL. The following is a completely valid code in PostgreSQL:
 |
 |
PREPARE myplan (TEXT)
AS
SELECT $1;
|
Yet when I try to execute it in SQL Editor I get the following error message:
 |
 |
Executing selected queries... Please wait or close this tab to cancel execution.
Execute: ODBC Error (32): SQLExecDirectW Client: 09.06.0410 Server: 9.6.5 SQL State: 07002 The # of binded parameters < the # of parameter markers; PREPARE myplan (TEXT) AS SELECT $1
The command(s) completed with errors (0.00 ms).
|
Any hints of what would cause this?
|
|
Mon Oct 02, 2017 9:13 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I believe that statement cannot be executed using ODBC interface. It needs to be wrapped into PgPlSQL block or SQL function or something else because it refers to a parameter.
However if you switch to the native driver connect using PqLib you should be able to execute it.
PqLib provides more features as compared to ODBC interface, in SA it also enables using the COPY command to load data into tables on the server from text files on the client and from clipboard. PqLib is preinstalled with SA.
|
|
Mon Oct 02, 2017 9:40 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
That helped, thanks.
|
|
Mon Oct 02, 2017 4:03 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|