-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Query with named parameters that multiple occurs
PostPosted: Thu Apr 08, 2004 7:29 am 
Newbie

Joined: Thu Apr 08, 2004 7:17 am
Posts: 10
Hi,

Im trying around with Queries and named parameters. I have statements where one named parameter occurs several times.

Examle:
from bbb b where b.behaelter.id = :VAL0 and b.terminVon <=:VAL1 and (b.terminBis is null or b.terminBis > :VAL1)

I made a query (q) and called
q.setLong("VAL0",123456)
and
q.setLong("VAL1",987654)

I hoped that "VAL1" is replaced two times, because I read somewhere that all should replaced.

When I run the query my Database said:
java.sql.SQLException: ORA-01008: Nicht allen Variablen ist ein Wert zugeordnet
what means that not all variables are assigned with a value.

What can I do?

Thanks a lot in advance.
Alex


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 08, 2004 9:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Its a position holder which maps to the JDBC standard query parameters. Use unique names for each parameter. You can pass the same parameter value.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.