pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
question regarding upgrade from  pg74.215.jdbc3.jar  to postgresql-8.1-407.jdbc3.jar. function does not exist appeared ??? Please help :-/
3+ messages / 2 participants
[nested] [flat]

* question regarding upgrade from  pg74.215.jdbc3.jar  to postgresql-8.1-407.jdbc3.jar. function does not exist appeared ??? Please help :-/
@ 2006-08-22 22:15 David Gagnon <dgagnon@siunik.com>
  2006-08-22 23:47 ` Re: question regarding upgrade from  pg74.215.jdbc3.jar  to Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David Gagnon @ 2006-08-22 22:15 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

  I just upgraded my jdbc driver and fixing stuff to make it work with 
the new driver.  I cannot find the  answer to the following one.  I 
tried with the old driver and everything works.  With the new one that 
doesn't work.

Here is the function declaration:
CREATE OR REPLACE FUNCTION usp_Comptabilite_AgeDeCompteClient(VARCHAR, 
VARCHAR, DATE, BOOLEAN, BOOLEAN, INT, VARCHAR) RETURNS refcursor  AS $$


Here is the error that I grabbed from the postgresql log file:

          select * from usp_Comptabilite_AgeDeCompteClient(M, NULL, 
2006-08-22 -0400, 1,         1, 0, NULL)     

2006-08-22 18:04:27 LOG:  statement: PREPARE <unnamed> AS           
select * from usp_Comptabilite_AgeDeCompteClient($1, $2, $3, $4,         
$5, $6, $7)     
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.
2006-08-22 18:04:27 STATEMENT:            select * from 
usp_Comptabilite_AgeDeCompteClient($1, $2, $3, $4,         $5, $6, $7)     


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

Any idea what is the difference between drivers that can explain this.  
And of course how I can fix the problem! 

Thanks for your help!  It's really appreciated!
Best Regards
/David

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









^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: question regarding upgrade from  pg74.215.jdbc3.jar  to
  2006-08-22 22:15 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>
@ 2006-08-22 23:47 ` Oliver Jowett <oliver@opencloud.com>
  2006-08-22 23:51   ` Re: question regarding upgrade from  pg74.215.jdbc3.jar  to Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Oliver Jowett @ 2006-08-22 23:47 UTC (permalink / raw)
  To: David Gagnon <dgagnon@siunik.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: question regarding upgrade from  pg74.215.jdbc3.jar  to
  2006-08-22 22:15 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>
  2006-08-22 23:47 ` Re: question regarding upgrade from  pg74.215.jdbc3.jar  to Oliver Jowett <oliver@opencloud.com>
@ 2006-08-22 23:51   ` Oliver Jowett <oliver@opencloud.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Oliver Jowett @ 2006-08-22 23:51 UTC (permalink / raw)
  To: David Gagnon <dgagnon@siunik.com>; +Cc: pgsql-jdbc

Oliver Jowett wrote:

> The problem is with parameter 7.

Aaaand.. I can't count. It's parameter 6 :)

-O



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-08-22 23:51 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-22 22:15 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>
2006-08-22 23:47 ` Re: question regarding upgrade from  pg74.215.jdbc3.jar  to Oliver Jowett <oliver@opencloud.com>
2006-08-22 23:51   ` Re: question regarding upgrade from  pg74.215.jdbc3.jar  to Oliver Jowett <oliver@opencloud.com>

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