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: 309AD90BD8FC7E4383DB1ACCBF6C8DC0032076@usa0300ms01.na.xerox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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?

Thanks!

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.

Responses

Browse pgsql-interfaces by date

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