xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

DELETE TAG

Deletes a tag from an index.

Syntax

DELETE TAG <cIndexTag1> [IN <cIndexFile1>]
        [, <cIndexTagN> [IN <cIndexFileN>] ]

Arguments

<cIndexTag>
This is the symbolic name of the index to remove from an index file. It can be specified as a literal name or a character expression enclosed in parentheses.
<cIndexFile>
<cIndexFile> is the name of the file containing the index to remove. If not specified, all index files open in the current work area are searched for the index with the name <cIndexTag>. The file name can be specified as a literal name or a character expression enclosed in parentheses. When the file extension is omitted, it is determined by the database driver that opened the file.

Description

The DELETE TAG command deletes an index from an index file in the current work area. The index is identified by its tag name, which is equivalent to an alias name of a work area. If no index file is specified, all indexes in the current work area are searched for a matching tag name. When the tag name does not exist or the index file is not open, a runtime error is generated.

If the index to delete is the controlling index, the records in the current work area are listed in physical order after index deletion.

Note:  The number of indexes that can be stored in an index file is determined by the replaceable database driver maintaining a work area. While DBFNTX and DBFNDX support only one index per file, the DBFCDX RDD supports many indexes in one index file.

Info

See also:INDEX, OrdDestroy(), SET ORDER, SET INDEX
Category: Database commands , Index commands
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example creates three indexes in one file using the DBFCDX driver.
// The effect of deleting the controlling index is demonstrated.

   REQUEST DBFCDX

   PROCEDURE Main
      RddSetDefault( "DBFCDX" )

      USE Customer
      INDEX ON Upper(FirstName) TAG FName TO Cust01
      INDEX ON Upper(LastName)  TAG LName TO Cust01
      INDEX ON Upper(City)      TAG City  TO Cust01

      FOR n:=1 TO 3
         ? OrdName(n), OrdKey(n)
      NEXT
      WAIT

      SET ORDER TO TAG City
      Browse()

      DELETE TAG City
      Browse()

      USE
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe