Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Function Index > C

CVTYPE

Scroll Prev Top Next More

(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.

 

Example 01.

 

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

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

 

SHOW VARIABLES

 

Variable           = Value            Type

------------------   ---------------  -------

vCustIDType        = INTEGER          TEXT

vEmpCity           = TEXT,20          TEXT

 

Example 02.

 

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

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

 

SHOW VARIABLES

 

Variable           = Value            Type

------------------   ---------------  ------

vEmpCity           = TEXT,20          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.