> CREATE TEMPORARY VIEW tempv (col1) AS SELECT
> (FLOAT(col1)) FROM temp
> SELECT col1 FROM tempv
> SELECT (col1-0.7) FROM tempv

Steven:

You are running up against R:Base's "implicit
domaining" feature (my name for it).  You should have
no problem if you use a different column name when you
create the view.

R:Base does not allow columns with the same name to
have different type definitions.  That is, you cannot
create two tables which have a columns named COL1,
with one table defining it as TEXT and another as
FLOAT.  If you try you will get an error message like
"ERROR - Column Col1 is already used in another table
and its type cannot be redefined".

However, you are able to slip invalid definitions into
views.  The reason, I assume, is that the columns in
the views never get added to R:Base's internal column
list (what we see exposed as SYS_COLUMNS) and
therefore the checking never occurs.  The columns are
generated on-the-fly when you use the view.

So, when R:Base attempts to analyze the expression in
your second select, the only entry it finds in
SYS_COLUMNS for that column name is the one from the
base table your view is coming from -- and that
definition is type text.

If there is a bug to report, I think the problem is
that R:Base lets you store the view definition without
checking the column names and result types.  That is,
I think that on the CREATE VIEW command you should get
the error message mentioned above.  Given R:Base's
rule about identically named columns having the same
data types, your code above would never execute -- the
only issue is in which statement the error should get
caught.
--
Larry


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to