Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
the number of SELECT column must match the number of INTO clause parameters |
Tue, Sep 11 2012 12:13 AM | Permanent Link |
IQA | Hi All,
I know what the error means, but the columns appear to match exactly to the columns I'm trying to insert into, in both the number and the column type. ElevateDB Error #700 An error was found in the statement at line 2 and column 6 (Invalid expression found, the number of SELECT column must match the number of INTO clause parameters) Any ideas ? Heres the SQL Select F.forecastdate, 0 stay_overs, 0 room_arrivals, 0 room_departures, Coalesce(Count(R.guestID),0) rooms_occupied, SUM(adults + children) guests Into forecast From forecastdates F inner join reservation R on (CAST(R.ar_time AS DATE) = CAST(F.forecastdate AS DATE)) OR (CAST(ar_time AS DATE) < CAST(F.forecastdate AS DATE) AND CAST(R.dep_time AS DATE) > CAST(F.forecastdate AS DATE)) Group by forecastdate! Thanks, Phil. |
Tue, Sep 11 2012 12:51 AM | Permanent Link |
IQA | It's OK... I was porting code over from a DBISAM app...
So I just changed the way I was INSERTING... (works ok now) INSERT INTO forecast (forecastdate, stay_overs, room_arrivals, room_departures, rooms_occupied, guests) Select F.forecastdate, 0 stay_overs, 0 room_arrivals, 0 room_departures, Coalesce(Count(R.guestID),0) rooms_occupied, SUM(adults + children) guests Into forecast From forecastdates F inner join reservation R on (CAST(R.ar_time AS DATE) = CAST(F.forecastdate AS DATE)) OR (CAST(ar_time AS DATE) < CAST(F.forecastdate AS DATE) AND CAST(R.dep_time AS DATE) > CAST(F.forecastdate AS DATE)) Group by forecastdate! |
Tue, Sep 11 2012 3:14 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Phil,
<< It's OK... I was porting code over from a DBISAM app... So I just changed the way I was INSERTING... (works ok now) >> Yep, the INTO clause for SELECT statements is now SQL-standard and is used to output single-row values into parameters. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, April 26, 2024 at 06:09 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |