-->
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.  [ 4 posts ] 
Author Message
 Post subject: Insert Statement Not working in HQL
PostPosted: Mon Aug 25, 2008 2:51 am 
Newbie

Joined: Thu Jul 17, 2008 2:16 am
Posts: 11
Hi,
I am trying to insert a row in my table but it doesn't work and gives the error unexpected token: VALUES .

My query is:

INSERT INTO Trnhst(xwbccd,
xwe4nb, xwricd, xwc8dt, xwbncd, xwbdcd, person, xwaacs, xwabcd, xwagcd, xwahcd, xwaicd,
xwt8tx, xwordn, xwa5qt, xwvalu) VALUES('ACC44', 00200201, 'INV', 9, 'AG', 'USA', 'STU', 'USA',
'000078', '22', '30', '39', 'PR123', 12, 6.0, 77.94)

Plz Help me its very urgent
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 25, 2008 3:20 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
For inserts, only the INSERT INTO ... SELECT ... form is supported. Read http://www.hibernate.org/hib_docs/v3/re ... tch-direct for more information.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Mon Sep 22, 2008 4:13 am 
Newbie

Joined: Thu Jul 17, 2008 2:16 am
Posts: 11
Thanks for the help


Top
 Profile  
 
 Post subject: Re: Insert Statement Not working in HQL
PostPosted: Sat May 09, 2009 4:50 am 
Newbie

Joined: Sat May 09, 2009 4:44 am
Posts: 2
And if you really need this, you can use SQLQuery query = session.createSQLQuery("inser into xxx () values ()"); I am using it for many-to-many relation changes without version increase


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.