X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 54A109DC818 for ; Fri, 10 Feb 2006 05:14:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33956-10 for ; Fri, 10 Feb 2006 05:14:24 -0400 (AST) X-Greylist: delayed 02:47:26.614888 by SQLgrey- Received: from qsrv01sl.mx.bigpond.com (qsrv01sl.mx.bigpond.com [144.140.92.181]) by postgresql.org (Postfix) with ESMTP id BB79E9DCCA7 for ; Fri, 10 Feb 2006 05:14:14 -0400 (AST) Received: from dev01 ([138.130.244.129]) by omta01sl.mx.bigpond.com with SMTP id <20060210062647.VUFQ16720.omta01sl.mx.bigpond.com@dev01> for ; Fri, 10 Feb 2006 06:26:47 +0000 Message-ID: <000801c62e0a$f6d76620$bd63a8c0@dev01> From: "Rob Johnston" To: Subject: Function that exists doesn't exist? Date: Fri, 10 Feb 2006 16:26:44 +1000 Organization: Auto-Quote Queensland MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0005_01C62E5E.C834B9E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.001 required=5 tests=[HTML_MESSAGE=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200602/81 X-Sequence-Number: 14678 This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C62E5E.C834B9E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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(QueryExecut= orImpl.java:1512) at = org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl= .java:1297) at = org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:1= 88) at = org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statemen= t.java:430) at = org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc= 2Statement.java:346) at = org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2St= atement.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 =3D name, supplier_key =3D sup, suppliers_customer_key =3D cus, purchase_terms_id =3D terms, delivery_charge =3D del, account_status_id =3D astat where supplier_id =3D 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 =3D 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. ------=_NextPart_000_0005_01C62E5E.C834B9E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Howdy,
 
A = little dumbfounded=20 by this error message when trying to update a table in postgres 8.1, = using the=20 8.1-404 JDBC3 driver. We're also running Java 1.5.0-05.
 
Java throws this = exception:
org.postgresql.util.PSQLException: = ERROR: function=20 update_payable_account(integer, character varying, character varying, = character=20 varying, integer, numeric, integer) does not = exist
at=20 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecut= orImpl.java:1512)
at=20 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl= .java:1297)
at=20 org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:1= 88)
at=20 org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statemen= t.java:430)
at=20 org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc= 2Statement.java:346)
at=20 org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2St= atement.java:297)
 
Our function looks like = this:
CREATE OR REPLACE FUNCTION=20 update_payable_account(id int4, name "varchar", sup bpchar, cus bpchar, = terms=20 int2, del "numeric", astat int4)
  RETURNS void=20 AS
$BODY$
begin
    update=20 suppliers
   =20 set
        supplier_name =   =3D=20 name,
        = supplier_key  =3D=20 sup,
        = suppliers_customer_key=20  =3D cus,
        = purchase_terms_id=20  =3D terms,
        = delivery_charge=20  =3D del,
       =20 account_status_id   =3D astat
    where = supplier_id =3D=20 id;
end;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
ALTER = FUNCTION=20 update_payable_account(id int4, name "varchar", sup bpchar, cus bpchar, = terms=20 int2, del "numeric", astat int4) OWNER TO postgres;
 
And our calling code like = this:
   sql =3D = conn.prepareCall("{ call=20 update_payable_account(?, ?, ?, ?, ?, ?, ?)=20 }");
   sql.setInt(1,=20 account.getAccountNumber());
   sql.setString(2,=20 account.getName());
   sql.setString(3,=20 account.getSupplierKey());
   sql.setString(4,=20 account.getCustomerKey());
   sql.setInt(5,=20 account.getPurchaseTermsID());
   sql.setBigDecimal(6, = new=20 BigDecimal(account.getDelivery()));   // this is=20 a double
   sql.setInt(7,=20 account.getAccountStatusID());
 
Cheers,
 
Rob = Johnston.
------=_NextPart_000_0005_01C62E5E.C834B9E0--