> BUT is there a way to define the column type in a view. I know normally it
> picks it up from the table.

Functions with a text return type always return NOTE in a view, which can
sometimes be a hassle.

Bill Downall has shown me how to get around this: you need to convert your view
to UNION together the data you want with a SELECT statement returning no rows
from a table with the correct column types:

CREATE VIEW ViewName (ViewColumnList) AS +
  SELECT ColumnList FROM TableWithCorrectTypes WHERE LIMIT = 0 +
  UNION ALL +
  SELECT ColumnList FROM YourTableOrTables WHERE (Your Where Clause)

The first SELECT does not contribute any rows to the result set, it just
coerces the columns to have the proper data types.
--
Larry

Reply via email to