Larry and the List,
Please excuese tardy reply. Larry you state "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."
I respectfully disagree. Try the following code.
BROWSE SYS_COLUMN_ID=6,SYS_COLUMN_NAME=18, +
(SYS_TYPE_NAME & (IFEQ (T1.SYS_DATA_TYPE,3,('('+ +
CTXT(T1.SYS_LENGTH)+')'), (IFEQ(T1.SYS_DATA_TYPE,9,('('+
+
CTXT(T1.SYS_LENGTH)+','+ CTXT(T1.SYS_SCALE)+')'),(IFEQ(T1.SYS_DATA_TYPE,12,+
('('+ CTXT(T1.SYS_LENGTH)+')'),' ')))))))=12,SYS_TABLE_ID=6,+
SYS_TABLE_NAME, SYS_PRECISION=5, SYS_LENGTH=4 FROM SYS_COLUMNS
T1 RIGHT +
OUTER JOIN SYS_TABLES T2 ON T2.SYS_TABLE_ID = T1.SYS_TABLE_ID
+
WHERE T2.SYS_TABLE_TYPE='VIEW' +
ORDER BY T2.SYS_TABLE_NAME ASC, SYS_COLUMN_ID DESC
--
You will note that RBase does store a column definition for
each view in SYS_COLUMNS. Where RBase can not determine
a name to use i.e. you did not use "CREATE VIEW viewname
(columnnames) AS SELECT" syntax. It uses "UNKNOWN" as a column
name. You can create a "view column name" with the same
name as a real column but with a different data type. See
previous messages in this thread for a workaround.
--
Jim Bentley
American Celiac Society
[EMAIL PROTECTED] - email
(973) 325-8837 voice
(973) 669-8808 Fax
---- Lawrence Lustig <[EMAIL PROTECTED]> wrote:
> > 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/
>
================================================
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/