Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: Why excepti...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 3736 of 3800
Post > Topic >>

Re: Why exception ex****ting query result on Derby ?

by MikeRam <ing.ramundo@[EMAIL PROTECTED] > Apr 27, 2008 at 05:27 PM

MikeRam wrote:
> q="SELECT * FROM "+dbTable+" WHERE "+FieldName+" BETWEEN ? AND ? ORDER 
> BY ID";
> q="CALL SYSCS_UTIL.SYSCS_EX****T_QUERY('"+q+"','"+OutFile+"', null, null,

> null)";
> stm=cn.conn.prepareStatement(q);
> stm.setString(1, sd.StringDataOraInizio);
> stm.setString(2, sd.StringDataOraFine);
> stm.executeUpdate();
> 
> 
> I use Apache Derby but,
> When i execute the attached code i receive an exception 
> java.sql.SQLException: No input parameters.
> 
> The same query in other point of my program do not produce an exception.
> Maybe i can't use system procedure with parameter ?
> Thanks
> 
> 
> 
Even with this syntax i receive the same exception
stm=cn.conn.prepareCall(q);
stm.setString(1, sd.StringDataOraInizio);
stm.setString(2, sd.StringDataOraFine);
stm.execute();

Parametric query are usable in stored procedure
as i see from ref guide:

CallableStatement cs = conn.prepareCall
("CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE(?, ?, ?)");
cs.setString(1, "US");
cs.setString(2, "CUSTOMER");
cs.setShort(3, (short) 1);
cs.execute();
 




 4 Posts in Topic:
Why exception exporting query result on Derby ?
MikeRam <ing.ramundo@[  2008-04-27 16:30:27 
Re: Why exception exporting query result on Derby ?
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-27 11:02:28 
Re: Why exception exporting query result on Derby ?
MikeRam <ing.ramundo@[  2008-04-27 17:27:12 
Re: Why exception exporting query result on Derby ?
=?ISO-8859-1?Q?Arne_Vajh=  2008-05-12 18:50:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 4:46:25 CDT 2008.