Administrative API Reference

sqledosd - Open Database Directory Scan

Stores a copy of the system database directory or the local database directory in memory, and returns the number of entries. This copy represents a snapshot of the directory at the time the directory is opened. This copy is not updated, even if the directory itself is changed later.

Use sqledgne - Get Next Database Directory Entry to advance through the database directory, examining information about the database entries. Close the scan using sqledcls - Close Database Directory Scan. This removes the copy of the directory from memory.

Authorization

None

Required Connection

None

Version

sqlenv.h

C API Syntax



/* File: sqlenv.h */
/* API: Open Database Directory Scan */
/* ... */
SQL_API_RC SQL_API_FN
  sqledosd (
    _SQLOLDCHAR * pPath,
    unsigned short * pHandle,
    unsigned short * pNumEntries,
    struct sqlca * pSqlca);
/* ... */
 

Generic API Syntax



/* File: sqlenv.h */
/* API: Open Database Directory Scan */
/* ... */
SQL_API_RC SQL_API_FN
  sqlgdosd (
    unsigned short PathLen,
    struct sqlca * pSqlca,
    unsigned short * pNumEntries,
    unsigned short * pHandle,
    _SQLOLDCHAR * pPath);
/* ... */
 

API Parameters

PathLen
Input. A 2-byte unsigned integer representing the length in bytes of the path parameter. Set to zero if no path is provided.

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

pNumEntries
Output. Address of a 2-byte area where the number of directory entries is returned.

pHandle
Output. Address of a 2-byte area for the returned identifier. This identifier must be passed to sqledgne - Get Next Database Directory Entry for scanning the database entries, and to sqledcls - Close Database Directory Scan to release the resources.

pPath
Input. The name of the path on which the local database directory resides. If the specified path is a NULL pointer, the system database directory is used.

REXX API Syntax



OPEN DATABASE DIRECTORY [ON path_name] USING :value

REXX API Parameters

path_name
Name of the path on which the local database directory resides. If the path is not specified, the system database directory is used.

value
A compound REXX host variable to which database directory information is returned. In the following, XXX represents the host variable name.

XXX.0
Number of elements in the variable (always 2)

XXX.1
Identifier (handle) for future scan access

XXX.2
Number of entries contained within the directory.

Sample Programs

C
\sqllib\samples\c\dbcat.c

COBOL
\sqllib\samples\cobol\dbcat.cbl

REXX
\sqllib\samples\rexx\dbcat.cmd

Usage Notes

Storage allocated by this API is freed by sqledcls - Close Database Directory Scan.

Multiple OPEN DATABASE DIRECTORY SCAN APIs can be issued against the same directory. However, the results may not be the same. The directory may change between openings.

There can be a maximum of eight opened database directory scans per process.

See Also

sqledcls - Close Database Directory Scan

sqledgne - Get Next Database Directory Entry.


[ Top of Page | Previous Page | Next Page ]