At 11:29 AM 9/27/2007, Dennis McGrath wrote:

Works like a charm, even in RBDOS 7.5

Problem is, it does not show up in RBDOS help.

I suspect I'm missing a lot of goodies this way.


Did you notice the mention of "undocumented"?

FYI, if you didn't know already, there is a special session on:

Demonstrating the Undocumented Features of R:BASE!

http://www.rbase.com/conference/highlights.php

Enjoy the R:BASE you have always wanted!

Very Best R:egards,

Razzak.



Wednesday, September 27, 2007

Tip of the Day: Finding Data Type for a given Column or Variable

Did you know that you can find the data type for a given column
name or variable by using the undocumented CVTYPE function?

Here's how:

Syntax:

(CVTYPE('colvarname',flag))

Returns the data type for a given column or variable name.

To return the data type for a given column, a zero "0" flag
must be used. To return the data type for a given variable,
the one "1" flag must be used.

Start R:BASE for DOS or Windows

After CONNecting to ConComp or RRBYW14, try the following
two examples at the R> prompt:

Example 01.

   SET VAR vCustIDType TEXT = (CVTYPE('CustID',0))
   SET VAR vEmpCity TEXT = (CVTYPE('EmpCity',0))

   SHOW VARIABLES

   vCustIDType = INTEGER  TEXT
   vEmpCity    = TEXT,16  TEXT

Example 02.

   SET VAR vCustIDType TEXT = (CVTYPE('CustID',0))
   SET VAR vVarInquiry TEXT = (CVTYPE('vCustIDType',1))

   SHOW VARIABLES

   vCustIDType = INTEGER TEXT
   vVarInquiry = TEXT,7  TEXT

NOTES:

. When using the zero flag to return column data types,
   you must be CONNected to a database.

. When returning a TEXT data type, the length is
   included and is separated with a comma. When returning
   a NUMERIC data type, the precision and scale are
   separated with commas.

Very Best R:egards,

Razzak.

Reply via email to