Before I report this to RDCC can someone please help to verify the
following bug(?):

A view column, Col1, is defined as FLOAT() of a TEXT table column.
Pressing F3 and checking the columns in the view reveals that Col1 is of
type DOUBLE, as it should be.

However, when Col1 is used in an expression such as  SELECT (Col1 - 0.0)
FROM ViewName, error message #2151 appears: -ERROR- TEXT cannot be
subtracted by DOUBLE.

In other words, RBase still thinks col1 is a TEXT type, even though it
lists as and displays floating point values.

Try this:

CREATE TEMPORARY TABLE temp (col1 TEXT 8)
LOAD temp 
NONUM   
'123456'
'234567'
'345678'
'123'
'322'
'52'
'622'
'67222'
END 
CREATE TEMPORARY VIEW tempv (col1) AS SELECT (FLOAT(col1)) FROM temp
SELECT col1 FROM tempv
SELECT (col1-0.7) FROM tempv

The first SELECT lists all the values with their decimal points.

The second SELECT generates the error.

Does anyone else get the error?

NOTE: the problem does NOT occur with the INT function in the view.

Workaround appears to be to not use FLOAT in view definitions. Use FLOAT
in the subsequent expressions. For example, if you wanted to parse out a
REAL value from a text column, the view definition would do the parsing,
but the FLOAT should be done when it's needed:

CREATE TEMPORARY VIEW tempv (col1) AS SELECT (SGET(col1,2,1)) FROM temp
SELECT (FLOAT(col1)-0.7)) FROM tempv

That works.

Thanks for your assistance.


Regards, 

Stephen Markson
ForenSys The Forensic Systems Group
www.ForensicSystemsGroup.com
416 482 2140


================================================
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