Insert using Subqueries

From: Colin Basterfield (colin.basterfield_at_xtra.co.nz)
Date: 06/24/04


Date: Thu, 24 Jun 2004 19:01:46 +1200

Hi,

I want to do the following

insert into site_revenue(site_id,revenue_id)
values (
2,
(select r.revenue_id from revenue r
where r.revenue_name = 'BAR/CAFE'))

Reason being I don't know what the revenue_id is when I call the routine
that does the insert. I don't want to use a Stored Proc if I can help it.

It complains however with this error

>>Subqueries are not allowed in this context. Only scalar expressions are
allowed.

TIA
Colin B



Relevant Pages

  • Re: [video] A 30 second 4 club routine
    ... Colin E. wrote: ... The reason for the shirt and tie is because I filmed this during my lunch ... Title: 4 clubs 30 seconds ... My entry into Gatto's 4 club 30 second routine video contest. ...
    (rec.juggling)
  • Re: Overhead cable
    ... > Thanks Colin, ... > I did wonder about that, but not for the reason you've mentioned. ... > house is priced that will probablyy attract a young couple or a retired ... > to prospective buyers? ...
    (uk.legal)
  • Re: No roadmap? Who cares?
    ... In fact if revenue recognition is the root of ... I reason this as if Someone gets SA and there is a road map/forward ... at least a portion of that SA revenue wont be allowed to be recognized ...
    (borland.public.delphi.non-technical)
  • Re: The race for third and an observation on this group
    ... enough to actually go to the real event, excluding those that live nearby of ... I've traveled hundreds or thousands of miles to see AMA races ... and the main reason I went to Istanbul this year was ... Colin, you talk about excuses and comspiracy and you betray YOUR bias ...
    (rec.motorcycles.racing)
  • Re: Gilchrist on status of Super Series matches
    ... >> This strikes me as an intriguing suggestion, if for no reason other ... >> than to see Colin, alvey, Higgs and dechucka teaming up on the same ...
    (rec.sport.cricket)

Loading