Subject Re: [firebird-support] View with case statement
Author Darryl
Curiously, this VIEW was created and does work, despite this error being
displayed.

I now have what I need and it is significantly more maintainable (and
probably a bit faster) than the complex, long winded method I had a couple
of hours ago.

----- Original Message -----
From: "Darryl" <darryl@...>
To: <firebird-support@yahoogroups.com>
Sent: Thursday, August 21, 2003 11:52 AM
Subject: Re: [firebird-support] SELECT limitation with UNION/GROUP BY (NOW:
View with case statement)


> Thanks for your quick response.
>
> I have restructured my SELECT statements using CASE clauses and this seems
> to be a nice solution. My SELECT statement runs correctly, however, I get
a
> parsing error when trying to create the VIEW.
>
> Does anyone know what could be causing this error?
>
> CREATE VIEW COUNT_STOCK_BY_SIZES( ENTITY_ID, SIZE_GROUP_ID,
> PRODUCT_STYLE_ID, COLOUR_ID,
> TRANSACTION_DATE, F_1, F_2, F_3, F_4, F_5, F_6, F_7, F_8, F_9)
> AS
> select cast((STORE_ID * 100) + 2 as INTEGER) as ENTITY_ID, SIZE_GROUP_ID,
> P.PRODUCT_STYLE_ID,
> COLOUR_ID, TRANSACTION_DATE,
> case SIZE_ID
> WHEN 1 then QUANTITY <<<<<<<<<<<<<<< "Parsing error!" message on
> this line.
> WHEN 7 then QUANTITY
> WHEN 13 then QUANTITY
> end,
> case SIZE_ID /* 2 */
> WHEN 2 then QUANTITY
> WHEN 8 then QUANTITY
> WHEN 14 then QUANTITY
> end,
> < SNIP>
>
> Regards,
>
> Darryl