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