-->
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: Named Parameter in sql-insert
PostPosted: Tue Sep 21, 2010 11:33 am 
Newbie

Joined: Mon May 17, 2010 11:29 am
Posts: 12
Is it possible to use named-parameters in a sql-insert statement? From my experience, this is not possible but was just hoping for some confirmation.

Thanks.


Top
 Profile  
 
 Post subject: Re: Named Parameter in sql-insert
PostPosted: Mon Oct 25, 2010 2:44 am 
Newbie

Joined: Wed Jul 15, 2009 10:30 am
Posts: 5
(for posterity) Yes, you can use named parameters with insert.

Code:
Query query = session.getNamedQuery("externalized_insert_script_name");
         query.setInteger("param1", param1);
         query.setFloat("param2", param2);
         query.executeUpdate();


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.