-->
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: : Not all named parameters have been set
PostPosted: Fri Feb 10, 2006 1:01 am 
Newbie

Joined: Fri Feb 03, 2006 1:22 am
Posts: 1
Iam facing a problem in HQL querry
when I write Query [SELECT COUNT(msg.id) FROM msg in class com.ebw.cds.persistence.db.Message where ( msg.parsingStatus = 1 or msg.parsingStatus = 5 ) AND msg.receivedDateTime >=to_date('02/10/2006 00:00:00','mm/dd/yyyy HH24:mi:ss') AND msg.receivedDateTime <= to_date('02/10/2006 23:59:59','mm/dd/yyyy HH24:mi:ss') AND TRIM(UPPER(msg.rawText)) LIKE UPPER('%----- BAS UTILITIES OPEN INVESTMENT GRADE CDS CURVES%')]

it works but when I write Querry and : found in TRIM(UPPER(msg.rawText)) LIKE UPPER('%----- BAS UTILITIES OPEN : INVESTMENT GRADE CDS CURVES%')]
I got folowing exception



Exception net.sf.hibernate.QueryException: Not all named parameters have been set: [] [SELECT COUNT(msg.id) FROM msg in class com.ebw.cds.persistence.db.Message where ( msg.parsingStatus = 1 or msg.parsingStatus = 5 ) AND msg.receivedDateTime >=to_date('02/10/2006 00:00:00','mm/dd/yyyy HH24:mi:ss') AND msg.receivedDateTime <= to_date('02/10/2006 23:59:59','mm/dd/yyyy HH24:mi:ss') AND TRIM(UPPER(msg.rawText)) LIKE UPPER('%----- BAS UTILITIES OPEN : INVESTMENT GRADE CDS CURVES%')]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 11:01 am 
Newbie

Joined: Mon Jan 17, 2005 1:09 pm
Posts: 19
I looks to me that hibernate sees the ':' of your date in your query as named parameters.

I think you should set the dates in your query as named parameters:

eg:

[SELECT COUNT(msg.id) FROM msg in class com.ebw.cds.persistence.db.Message where ( msg.parsingStatus = 1 or msg.parsingStatus = 5 ) AND msg.receivedDateTime >= :date1 AND msg.receivedDateTime <= :date2 AND TRIM(UPPER(msg.rawText)) LIKE UPPER('%----- BAS UTILITIES OPEN INVESTMENT GRADE CDS CURVES%')]

followed by

query.setParameter("date1",02/10/2006 00:00:00');
query.setParameter("date2",02/10/2006 23:59:59);



PS:don't forget to rate


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.