Skip site navigation (1) Skip section navigation (2)

Interesting ECPG error

From: "Owens, Steve" <Steve(dot)Owens(at)xerox(dot)com>
To: "Pgsql-Interfaces (E-mail)" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Interesting ECPG error
Date: 2004-06-18 21:11:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
I'm running 7.4.2 and using ECPG's dynamic SQL capabilities to run some pgplsql functions in a database, some of which just insert records into a table. The dynamic SQL statement looks something like this:

"SELECT create_foo(?, ?, ?, ?);"

I'm supplying all 4 arguments, and all 4 arguments have legal values, but ECPG always returns a -220 (too few arguments) in sqlca.sqlcode when running these statements. Other functions that I have are of the form:

"SELECT * from get_foo(?, ?);"

In these cases, with all valid arguments ECPG is returning a 0 (normal return).

Now, I assume that the -220 is due to a "malformed" SELECT statement in the first case, though this seems to work ok in psql. My question is: is there a way to rewrite the failing case above so that it returns a 0 instead of a -220?


	This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient(s) please contact the sender by reply e-mail and destroy all copies of the original message. Finally, the recipient should check that this email is authentic and examine it for the presence of viruses. Xerox does perform virus checks but cannot accept liability for any damage caused by any virus transmitted by this email. Thank you.


pgsql-interfaces by date

Next:From: L J BayukDate: 2004-06-21 01:05:54
Subject: Released updated Tcl interfaces: pgin.tcl-2.1.0, pgtclng-1.5.1
Previous:From: Rich CullingfordDate: 2004-06-16 18:33:16
Subject: Re: Problems creating indexes with IMMUTABLE functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group