-->
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.  [ 1 post ] 
Author Message
 Post subject: Named Parameter in Select clause
PostPosted: Wed Nov 16, 2011 12:01 pm 
Newbie

Joined: Wed Nov 16, 2011 11:38 am
Posts: 1
Hi,

Is it possible to include a Named Parameter in a Select clause?

I am trying to create an DML style Insert. I am selecting the information from a table. The table has all the information except one value that is supplied as a parameter. When I try to include the parameters in the select I get an error stating that it does not recognize the parameters. An example is below. (This is an example to show what I am referring to. )

INSERT INTO eventScheduler
(customerId, eventStart, eventEnd, eventDate, eventLocation, requestId)
SELECT cus.customerId, ev.AvailableStart, ev.AvailabilityEnd, sysDate, :requestId
FROM event ev, customer cus
WHERE cus.customerId = ev.customerId

So far the only way to accomplish this is the following:
INSERT INTO eventScheduler
(customerId, eventStart, eventEnd, eventDate, eventLocation, requestId)
SELECT cus.customerId, ev.AvailableStart, ev.AvailabilityEnd, sysDate, :requestId
FROM event ev, customer cus, request req
where cus.customerId = ev.customerId
AND req.id = :requestId


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

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.