-->
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: SQL Replace function in HQL
PostPosted: Mon Mar 03, 2008 11:03 am 
Newbie

Joined: Mon Feb 04, 2008 7:42 am
Posts: 7
Hibernate version: 3.2.5

I am trying to convert a legacy SQL bulk update statement into HQL. The SQL is:

UPDATE table t1
SET t1.desc =
(
SELECT REPLACE(t2.desc,'<body>','')
FROM table t2
WHERE t2.desc = t1.desc
)
WHERE t1.desc LIKE '%<body>%'

Could someone please help, I particularly need help converting the "REPLACE" function with a HQL equivalent. I have searched through the docs and google and was unable to find one.

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 4:17 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
Those functions should pass straight through to the underlying database AFIAK. What error are you getting when you run this?

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


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.