Re: question regarding upgrade from pg74.215.jdbc3.jar to

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: question regarding upgrade from pg74.215.jdbc3.jar to
Date: 2006-08-22 23:47:48
Message-ID: 44EB97A4.2030308@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Jowett 2006-08-22 23:51:44 Re: question regarding upgrade from pg74.215.jdbc3.jar to
Previous Message Michael Fuhr 2006-08-22 23:22:27 Re: pl/R problem

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2006-08-22 23:51:44 Re: question regarding upgrade from pg74.215.jdbc3.jar to
Previous Message Luis Vilar Flores 2006-08-22 23:00:18 Re: bytea memory improvement