Re: question regarding upgrade from pg74.215.jdbc3.jar to - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: question regarding upgrade from pg74.215.jdbc3.jar to
Date
Msg-id 44EB97A4.2030308@opencloud.com
Whole thread Raw
In response to question regarding upgrade from pg74.215.jdbc3.jar to postgresql-8.1-407.jdbc3.jar. function does not exist appeared ??? Please help :-/  (David Gagnon <dgagnon@siunik.com>)
Responses Re: question regarding upgrade from pg74.215.jdbc3.jar to  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
David Gagnon wrote:

> CREATE OR REPLACE FUNCTION usp_Comptabilite_AgeDeCompteClient(VARCHAR,
> VARCHAR, DATE, BOOLEAN, BOOLEAN, INT, VARCHAR) RETURNS refcursor  AS $$

> 2006-08-22 18:04:27 ERROR:  function
> usp_comptabilite_agedecompteclient(character varying, character varying,
> "unknown", boolean, boolean, character varying, "unknown") does not exist
> 2006-08-22 18:04:27 HINT:  No function matches the given name and
> argument types. You may need to add explicit type casts.

The problem is with parameter 7. This is expecting an INT, but you are
giving it a VARCHAR. You are probably calling setString(7, "0").

If you use setInt(7,0) or setObject(7,"0",Types.INTEGER) it should work.

> If I execute the statement on pgAdminIII it works: select * from
> usp_Comptabilite_AgeDeCompteClient('M', NULL, '2006-08-22',
> true,         true, '0', NULL)      ;

Try it in pgAdmin using PREPARE and you should see the same error.

> P.S.: I traced with the debugger and I do call setDate for arg $3.  I
> don't understand why it's still unknow ?

It's because the driver doesn't know whether it is a timestamp or a
timestamptz, and if we explicitly specify a type that doesn't match the
actual type then the server will mangle the value while casting.
However, it's not that parameter which is causing your problem.

-O

pgsql-jdbc by date:

Previous
From: Luis Vilar Flores
Date:
Subject: Re: bytea memory improvement
Next
From: Oliver Jowett
Date:
Subject: Re: question regarding upgrade from pg74.215.jdbc3.jar to