Insert using Subqueries
From: Colin Basterfield (colin.basterfield_at_xtra.co.nz)
Date: 06/24/04
- Next message: The Fat Controller: "Re: My girlfriend naked 3602"
- Previous message: Maurizio Camurati: "SQLAgent crash"
- Next in thread: Lahoty: "Re: Insert using Subqueries"
- Reply: Lahoty: "Re: Insert using Subqueries"
- Reply: EijiTek: "Re: Insert using Subqueries"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: The Fat Controller: "Re: My girlfriend naked 3602"
- Previous message: Maurizio Camurati: "SQLAgent crash"
- Next in thread: Lahoty: "Re: Insert using Subqueries"
- Reply: Lahoty: "Re: Insert using Subqueries"
- Reply: EijiTek: "Re: Insert using Subqueries"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading