calling function with String resolves as "Unknown" instead of varchar

Lists: pgsql-jdbc
From: todd runstein <todd_run(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: calling function with String resolves as "Unknown" instead of varchar
Date: 2004-05-03 21:56:50
Message-ID: 20040503215650.7289.qmail@web13704.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

I'm calling a function with the following signature:

create or replace function
usp_affectedproduct(integer, integer, varchar) RETURNS
int as ...

I'm calling the function with something similar to:

String query = "{? = call usp_affectedproducts(?, ?,
?)}";
Connection conn = null; CallableStatement s = null;
try {
conn = getConnection(datasource);
s = conn.prepareCall(query);
s.registerOutParameter(1,Types.INTEGER);
s.setInt(2,qualityid);
s.setInt(3,submitid);
s.setString(4,products[x].getName());
s.execute();
} catch (SQLException e) {
throw e;
}finally{
<clean up stuff ...>

When I run this, I get an SQLException stating:

function usp_affectedproducts(integer, integer,
"unknown") does not exist

I've also try s.setObject(4, aString, Types.VARCHAR),
also to no avail. I've tried using a
PreparedStatement instead of the CallableStatement -
again, without success.

Any ideas? I'm running 7.4.1 on RedHat 8.0 with JDK
1.4.1_01.

Thanks in advance

=====
The only "dumb question" is the one you were too afraid to ask.
________________________________________

Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
http://routeruler.sourceforge.net
________________________________________



__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover


From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: todd runstein <todd_run(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: calling function with String resolves as "Unknown" instead
Date: 2004-05-03 22:34:46
Message-ID: 4096C906.7050508@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

todd runstein wrote:

> create or replace function
> usp_affectedproduct(integer, integer, varchar) RETURNS
> int as ...

> String query = "{? = call usp_affectedproducts(?, ?,
> ?)}";

Spot the typo in the function name..

-O


From: todd runstein <todd_run(at)yahoo(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: calling function with String resolves as "Unknown" instead of varchar
Date: 2004-05-04 00:01:14
Message-ID: 20040504000114.21763.qmail@web13702.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Duhhhh!

Thanks for pointing out the obvious!

--- Oliver Jowett <oliver(at)opencloud(dot)com> wrote:
> todd runstein wrote:
>
> > create or replace function
> > usp_affectedproduct(integer, integer, varchar)
> RETURNS
> > int as ...
>
> > String query = "{? = call usp_affectedproducts(?,
> ?,
> > ?)}";
>
> Spot the typo in the function name..
>
> -O

=====
The only "dumb question" is the one you were too afraid to ask.
________________________________________

Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
http://routeruler.sourceforge.net
________________________________________



__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover