pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: todd runstein <todd_run@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: calling function with String resolves as "Unknown" instead of varchar
Date: Mon, 3 May 2004 14:56:50 -0700 (PDT)
Message-ID: <20040503215650.7289.qmail@web13704.mail.yahoo.com> (raw)

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 



view thread (3+ messages)  latest in thread

Message-ID: <20040503215650.7289.qmail@web13704.mail.yahoo.com>
Permalink:  ../20040503215650.7289.qmail@web13704.mail.yahoo.com/
Also on:    postgresql.org/message-id/20040503215650.7289.qmail@web13704.mail.yahoo.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: todd_run@yahoo.com
  Subject: Re: calling function with String resolves as "Unknown" instead of varchar
  In-Reply-To: <20040503215650.7289.qmail@web13704.mail.yahoo.com>
  References: <20040503215650.7289.qmail@web13704.mail.yahoo.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