pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: David Gagnon <dgagnon@siunik.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: question regarding upgrade from  pg74.215.jdbc3.jar  to
Date: Wed, 23 Aug 2006 11:47:48 +1200
Message-ID: <44EB97A4.2030308@opencloud.com> (raw)
In-Reply-To: <44EB8213.2090303@siunik.com>
References: <44EB8213.2090303@siunik.com>

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



view thread (3+ messages)  latest in thread

Message-ID: <44EB97A4.2030308@opencloud.com>
Permalink:  ../44EB97A4.2030308@opencloud.com/
Also on:    postgresql.org/message-id/44EB97A4.2030308@opencloud.com

 · 

reply

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: oliver@opencloud.com, dgagnon@siunik.com
  Subject: Re: question regarding upgrade from  pg74.215.jdbc3.jar  to
  In-Reply-To: <44EB97A4.2030308@opencloud.com>
  References: <44EB8213.2090303@siunik.com> <44EB97A4.2030308@opencloud.com>

* 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