From: Rob Johnston <rob@aqq.com.au>
To: pgsql-jdbc@postgresql.org
Subject: Function that exists doesn't exist?
Date: Fri, 10 Feb 2006 16:26:44 +1000
Message-ID: <000801c62e0a$f6d76620$bd63a8c0@dev01> (raw)
Howdy,
A little dumbfounded by this error message when trying to update a table in postgres 8.1, using the 8.1-404 JDBC3 driver. We're also running Java 1.5.0-05.
Java throws this exception:
org.postgresql.util.PSQLException: ERROR: function update_payable_account(integer, character varying, character varying, character varying, integer, numeric, integer) does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:346)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:297)
Our function looks like this:
CREATE OR REPLACE FUNCTION update_payable_account(id int4, name "varchar", sup bpchar, cus bpchar, terms int2, del "numeric", astat int4)
RETURNS void AS
$BODY$
begin
update suppliers
set
supplier_name = name,
supplier_key = sup,
suppliers_customer_key = cus,
purchase_terms_id = terms,
delivery_charge = del,
account_status_id = astat
where supplier_id = id;
end;
$BODY$
LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION update_payable_account(id int4, name "varchar", sup bpchar, cus bpchar, terms int2, del "numeric", astat int4) OWNER TO postgres;
And our calling code like this:
sql = conn.prepareCall("{ call update_payable_account(?, ?, ?, ?, ?, ?, ?) }");
sql.setInt(1, account.getAccountNumber());
sql.setString(2, account.getName());
sql.setString(3, account.getSupplierKey());
sql.setString(4, account.getCustomerKey());
sql.setInt(5, account.getPurchaseTermsID());
sql.setBigDecimal(6, new BigDecimal(account.getDelivery())); // this is a double
sql.setInt(7, account.getAccountStatusID());
Cheers,
Rob Johnston.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: rob@aqq.com.au
Subject: Re: Function that exists doesn't exist?
In-Reply-To: <000801c62e0a$f6d76620$bd63a8c0@dev01>
References: <000801c62e0a$f6d76620$bd63a8c0@dev01>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox