Subject Re: Error CREATE VIEW (code = -607)
Author ettotev
--- In firebird-support@yahoogroups.com, "eric_developer" <memsystems-erp@...> wrote:
>
> Hi,
>
> how to solve? simple example:
>
> RECREATE VIEW TMP_REGC100 AS
> SELECT CODFOR
> FROM TMP_NFENT
> GROUP BY 1
> UNION all
> SELECT CODEMP
> FROM TMP_NFSAI
>
> -------------------
> Dynamic SQL Error
> SQL error code = -607
> Invalid command
> must specify column name for view select expression
> -------------------
>
> i tried no success:
> .... AS SELECT * FROM ( SELECT ... GROUP ... UNION ... SELECT ... )
>

Earlier versions of firebird required you to always specify the column names when creating a view - in your case something like
RECREATE VIEW TMP_REGC100 (CODEFOR) AS .....

At some point this was relaxed so that you could omit the field list - but then it was still required when there was the UNION statement in the view.

Finally this was fixed as well, so your statement should work well with the latest version.

Regards
Emil