COLUMNEXISTS()

From Lianjapedia
Revision as of 10:48, 5 February 2013 by Helen.george (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Purpose

Function to check whether a specific column exists

Syntax

COLUMNEXISTS(<expC1>, <expC2>, <expC3> [, <expN1> [, <expN2>]])

See Also

CLOSE DATABASES, CREATE DATABASE, DATABASE(), DATABASEEXISTS(), DBC(), DBF(), FILE(), OPEN DATABASE, TABLEEXISTS(), USE, USED()

Description

The COLUMNEXISTS() function returns .T. if the specified column exists and .F. otherwise.

Parameters Required Description
<expC1> Yes Database name
<expC2> Yes Table name
<expC3> Yes Column name
<expN1> No Column width
<expN2> No Column decimal places

Example

if columnexists("southwind","customers","customerid",5,0)
    open database southwind
    use customers
else
    open database southwind
    alter table customers (...)
endif