SQL Interface Objects 

Subordinate SQL Objects

 

Subordinate objects include the following: Idxinfo, Colinfo and Tblinfo. The methods and properties belonging to these objects are described below.

Idxinfo

Below is a list of Idxinfo methods and properties:

Idxinfo - Provides a common means to describe the indexes for a definition (table) or file

Idxinfo Methods

Description

AddSegment(n)

Adds a new index segment at the position specified by n. If n is null, then a new index segment will be added at the end. Your index object's SegNo will be positioned to the new segment added.

DropSegment(n)

Removes an index segment at the position specified by n. If n is null, then the last index segment will be removed. Your index object's SegNo will be positioned to the removed segment.

GetValues$(iol_obj$)

Return value of queried property or properties as a data record:

iol_obj$ = CPL("iolistname$")
X$ = Object'GetValues(iol_obj$)
X$ = Value found in name$ for this object

InitValues( )

Initializes the object's properties. Strings will be set to null, numeric and Booleans to zero.

Segment(n)

Simple method to change segments. Returns object ID after setting SegNo. Allows the user to code:

Obj'Segment(4)'ColumnWidth

or
 

X$ = Obj'Segment(3)'Attributes$

SetValues(val$, iol_obj$)

Set object's properties to the value or values specified:

iol_obj$ = CPL("iolistname$, attributes$")
val$ = "newname"+SEP+"Enter your Name"

Object'SetValues(val$, iol_obj$) will return 1 if passed, 0 if failed.

Idxinfo Properties

Description

Attributes$

Attribute string for current index:

U

Unique

" "

Not Unique

ColumnAttr$

Attribute string for current segment:

A

Ascending

D

Descending

ColumnName$

Name of column based on current segment

ColumnNullCharacter$

(Not Used)

ColumnOffset

Offset into current segment's column (zero-based)

ColumnWidth

Width to use of current segment's column (zero indicates full column)

IsExternal

(Not Used)

IsUnique

Boolean indicator for unique index

Name$

Name of the index

NullCharacter$

(Not Used)

NullSuppress

(Not Used)

SegCount

(Read Only) Number of segments for index

SegNo

Current segment number being referenced

Colinfo

Below is a list of Colinfo methods and properties:

Colinfo - Provides a common definition of a data element and provides for common data validation rules

Colinfo Methods

Description

GetValues$(iol_obj$)

Return value of queried property or properties as a data record:

iol_obj$ = CPL("iolistname$")
X$ = Object'GetValues(iol_obj$)
X$ = Value found in Name$ for this object

InitValues( )

Initializes this object's properties. Strings will be set to null, numeric and Booleans to zero.

SetValues(val$, iol_obj$)

Set object's properties to the value or values specified:

iol_obj$ = CPL("iolistname$, attributes$")
val$ = "newname"+SEP+"Enter your Name"

Object'SetValues(val$, iol_obj$) will return 1 if passed, 0 if failed.

Validate(val | val$)

Validate the contents of the column. Will return 1 if valid, 0 if not. Reason for rejection will be in ErrorCode$ / ErrorMessage$.

Colinfo Properties

Description

AlternateName$

(Not Used)

Class$

(Not Used)

ColumnNo

Column number

DefaultValue$

(Not Used)

Description$

(Not Used)

ErrorCode$

(Not Used)

ErrorMessage$

(Not Used)

Extension$

(Not Used)

ExternalFormat$

(Not Used)

Help$

(Not Used)

InputLength

(Read Only) Length required to allow user to input this data

InternalFormat$

Valid formats include:

ODBC Types

"AUTONUMBER"

"DATE"

"INT"

"NUMERIC"

"TEXT"

"BIGINT"

"DATETIME"

"INTEGER"

"NVARCHAR"

"TIMESTAMP"

"BINARY"

"DATE/TIME"

"LONG VARCHAR"

"OLE OBJECT"

"TINYINT"

"BIT"

"DECIMAL"

"MEMO"

"REAL"

"UNIQUEIDENTIFIER"

"CHAR"

"DOUBLE PRECISION"

"MONEY"

"SMALLDATETIME"

"VARBINARY"

"CHARACTER"

"FLOAT"

"NCHAR"

"SMALLINT"

"VARCHAR"

"COUNTER"

"HYPERLINK"

"NTEXT"

"SMALLMONEY"

"YES/NO"

"CURRENCY"

"IMAGE"

"NUMBER"

"SQL_VARIANT"

 

OCI Types

"BFILE"

"NCLOB"

"BLOB"

"NUMBER"

"CHAR"

"NVARCHAR2"

"CLOB"

"RAW"

"DATE"

"ROWID"

"FLOAT"

"UROWID"

"LONG"

"VARCHAR2"

"LONG RAW"

"XMLTYPE"

"NCHAR"

 

DB2 Types

"BIGINT"

"INTERGER"

"BLOB"

"LONG VARCHAR"

"CHARACTER"

"REAL"

"CLOB"

"SMALLINT"

"DATE"

"TIME"

"DECIMAL"

"TIMESTAMP"

"DOUBLE"

"VARCHAR"

IsExternal

(Not Used)

IsRequired

(Not Used)

IsUpperCase

(Not Used)

Length

Length of data in total bytes/digits

Name$

Name of the column

Notes$

(Not Used)

Occurs$

(Not Used)

ODBCOption$

(Not Used)

Query$

(Not Used)

Scale

(Numeric Type Only) Number of decimal points

Security$

(Not Used)

ShortName$

Short name to be used for column headers

Tag$

(Not Used)

Type$

Type of data:

S

String

N

Numeric

Validation$

(Not Used)

Variable$

(Read Only) Variable name to be used to store data. Name plus $ if string.

ViewsExpression$

(Not Used)

Tblinfo

Below is a list of Tblinfo methods and properties:

Tblinfo - Provides information about the file

Tblinfo Methods

Description

GetValues$(iol_obj$)

Return value of queried property or properties as a data record:

iol_obj$ = CPL("iolistname$")
X$ = Object'GetValues(iol_obj$)
X$ = Value found in name$ for this object

InitValues( )

Initialize this object's properties. Strings are set to null, numeric and Booleans are set to zero.

SetValues(val$, iol_obj$)

Set object's properties to the value or values specified:

iol_obj$ = CPL("iolistname$, description$")
val$ = "newname"+SEP+"Enter your Name"

Object'SetValues(val$, iol_obj$) will return 1 if passed, 0 if failed.

Tblinfo Properties

Description

BlockSize$

(Not Used)

Description$

Short description of the table contents

Extension$

(Not Used)

Group$

(Not Used)

IOProgram$

(Not Used)

IsDataCompression

(Not Used)

IsExtendedRecords

(Not Used)

LastChangeBy$

(Not Used)

LastChangeDate$

(Not Used)

Name$

Logical file name

Notes$

(Not Used)

Options$

(Not Used)

PhysicalFile$

(Not Used)

Security$

(Not Used)

Separator$

(Not Used)