SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[9.2.349 Pro] - Issues with PostgreSQL prepared statements

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[9.2.349 Pro] - Issues with PostgreSQL prepared statements
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1401

Post [9.2.349 Pro] - Issues with PostgreSQL prepared statements Reply with quote
I've got problems preparing prepared statements in PostgreSQL. The following is a completely valid code in PostgreSQL:
Code:

PREPARE myplan (TEXT)
AS
SELECT $1;

Yet when I try to execute it in SQL Editor I get the following error message:
Quote:

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6509

Post Reply with quote
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 View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1401

Post Reply with quote
That helped, thanks.
Mon Oct 02, 2017 4:03 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.