Difference between revisions of "SEEK"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
 
 
==Purpose==
 
==Purpose==
 
Search for specified key in the master index and if found, position the record pointer in the table
 
Search for specified key in the master index and if found, position the record pointer in the table
 
  
 
==Syntax==
 
==Syntax==
 
SEEK <key expression>
 
SEEK <key expression>
 
  
 
==See Also==
 
==See Also==
[[DBXDESCEND()]], [[DESCEND()]], [[DESCENDING()]], [[DTOS()]], [[EOF()]], [[FIND]], [[INDEX]], [[FOUND()]], [[KEY()]], [[KEYMATCH()]], [[LTOS()]], [[REFERENCES()]], [[SEEK()]], [[SET EXACT]], [[SET TALK]], [[STR()]]
+
[[DBXDESCEND()]], [[DESCEND()]], [[DESCENDING()]], [[DTOS()]], [[EOF()]], [[INDEX]], [[FOUND()]], [[KEY()]], [[KEYMATCH()]], [[LTOS()]], [[REFERENCES()]], [[SEEK()]], [[SET EXACT]], [[STR()]]
 
+
  
 
==Description==
 
==Description==
Line 18: Line 13:
 
In the Recital/4GL, you can build indexes on any data type or any combination of data types.  The conversion functions STR(), DTOS() and LTOS() are used to build indexes on mixed data types.  The DESCEND() function can also be used to build indexes in descending key order.  If the DESCEND() function is used to create the index key, it must also be used in the search <key expression>.  Tag indexes built with the DESCENDING keyword require the use of the DBXDESCEND() function in the <key expression>.  The DESCENDING() function can be used to determine whether a particular tag was built with the DESCENDING keyword.
 
In the Recital/4GL, you can build indexes on any data type or any combination of data types.  The conversion functions STR(), DTOS() and LTOS() are used to build indexes on mixed data types.  The DESCEND() function can also be used to build indexes in descending key order.  If the DESCEND() function is used to create the index key, it must also be used in the search <key expression>.  Tag indexes built with the DESCENDING keyword require the use of the DBXDESCEND() function in the <key expression>.  The DESCENDING() function can be used to determine whether a particular tag was built with the DESCENDING keyword.
  
If SET TALK ON is in effect and the specified key is not found,  then the system displays a message on the screen.  If SET EXACT is OFF, then the Recital/4GL will match partial keys.  If SET EXACT is ON, then the Recital/4GL will match only complete keys.
+
If SET EXACT is OFF, then the Recital/4GL will match partial keys.  If SET EXACT is ON, then the Recital/4GL will match only complete keys.
 
+
  
 
==Example==
 
==Example==
Line 34: Line 28:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]

Revision as of 06:06, 10 February 2012

Purpose

Search for specified key in the master index and if found, position the record pointer in the table

Syntax

SEEK <key expression>

See Also

DBXDESCEND(), DESCEND(), DESCENDING(), DTOS(), EOF(), INDEX, FOUND(), KEY(), KEYMATCH(), LTOS(), REFERENCES(), SEEK(), SET EXACT, STR()

Description

The SEEK command is identical to the FIND command, except that you can specify any valid expression as the key without the need to use macros. The SEEK command looks up the specified key in the master index file. If the key is found, then the FOUND() function will return .T., and the EOF() function will return .F.. If the key is not found, then the FOUND() function will return .F., and the EOF() function will return .T..

In the Recital/4GL, you can build indexes on any data type or any combination of data types. The conversion functions STR(), DTOS() and LTOS() are used to build indexes on mixed data types. The DESCEND() function can also be used to build indexes in descending key order. If the DESCEND() function is used to create the index key, it must also be used in the search <key expression>. Tag indexes built with the DESCENDING keyword require the use of the DBXDESCEND() function in the <key expression>. The DESCENDING() function can be used to determine whether a particular tag was built with the DESCENDING keyword.

If SET EXACT is OFF, then the Recital/4GL will match partial keys. If SET EXACT is ON, then the Recital/4GL will match only complete keys.

Example

use patrons
index on event to events
seek "BALLET"
 
index on date to dates
seek ctod("01/01/2000")
 
index on dtos(eventdate) + "/" + event to dates
seek "20010101/BALLET"