<<

Contents

Search

>>

 

JDBC_DATA_TYPES$

 

 

Function

 

 

Syntax:

JDBC_DATA_TYPES$(<File Number>)

 

<File Number> = <NUM-EXPRESSION>

 

Meaning:

Returns the data types supported by the JDBC driver in the following format:

 

"<NAME-1> | <TYPE-1> | <MAXLEN-1> | <APPL-1> |
  <NAME-2> | <TYPE-2> | <MAXLEN-2> | <APPL-2> |
 ..."

 

<NAME-n> is the designation for the data type used in the driver. This name must be used in the commands CREATE TABLE and ALTER TABLE.  

 

<TYPE-n> is the ANSI designation of the data type.

 

<MAXLEN-n> is the maximal length of a variable of the data type.  

 

<APPL-n> specifies the usability of the type in WHERE clauses:

 

UNSEARCHABLE

The variable cannot be used in WHERE clauses.

LIKE_ONLY

The variable can only be used in LIKE comparisons.

EXCEPT_LIKE

The variable can only be used in simple comparisons.

SEARCHABLE

The variable can be used unrestrictedly in WHERE clauses.

 

If an error occurs, the variable OK contains the error number and the function JDBC_GET_LAST_ERROR$ returns the error text.

 

Parameter:

File Number

Number of JDBC database

 

Sample:

DATA_TYPES$ = JDBC_DATA_TYPES$(2)

IF OK <> 0

THEN ERRORMES = JDBC_GET_LAST_ERROR$

ENDIF

 

DATA_TYPES$ enthält z.B.

"Logical|BIT|1|EXCEPT_LIKE|

 Memo|LONGVARCHAR|4998|UNSEARCHABLE|

 Numeric|DOUBLE|15|EXCEPT_LIKE|

 Date|DATE|10|EXCEPT_LIKE|

 Char|VARCHAR|254|SEARCHABLE"

 

This example shows the real output of the DBASE driver. You can see that DBASE contains the type 'Numeric', which is equivalent to the ANSI type 'DOUBLE'. Variables of this type are up to 15 bytes long. They can only be used in simple comparisons in WHERE clauses (e.g. WHERE x > 5).

 

See also:

JDBC_TABLE_NAMES$

JDBC_COL_NAMES$