lookuptable

Enumerates and outputs the data stored in a mapping table as records.

Command properties

ItemDescription
Command typeDriver query
Required permissionRead permission on the mapping table
License usageNon-licensed command
Parallel executionNot supported
Distributed executionNot supported

Syntax

lookuptable TABLE [offset=LONG] [limit=LONG] [FIELD, ...]

Options

offset=LONG
Number of records to skip. Only natural numbers are allowed.
limit=LONG
Maximum number of records to retrieve. Only natural numbers are allowed.

Target

TABLE
Name of the mapping table to look up
[FIELD, ...]
List of fields to output. Multiple fields can be specified separated by commas (,). If omitted, all fields of the mapping table are output.

Error codes

Parse errors
Error codeMessageDescription
20705lookuptable 조회 대상의 이름을 입력해야 합니다.When the mapping table name is not specified
20706[name]은 존재하지 않는 룩업 테이블 이름입니다.When a non-existent mapping table name is specified
20707[name]은 데이터 조회가 지원되지 않는 룩업 테이블 이름입니다.When the mapping table does not support data enumeration
20708[name]에 대한 lookuptable 권한이 없습니다.When there is no read permission for the mapping table
20709lookuptable의 offset 옵션 값은 자연수만 허용됩니다.When the offset value is 0 or less, or not a number
20710lookuptable의 limit 옵션 값은 자연수만 허용됩니다.When the limit value is 0 or less, or not a number
20711[name]은 조회 불가능한 룩업 테이블 필드입니다.When a field that does not exist in the mapping table is specified
Runtime errors

N/A

Description

The lookuptable command enumerates and outputs data stored in a mapping table as records. While the lookup command looks up values from a mapping table using the key field of input records, the lookuptable command outputs the entire data of a mapping table as records.

You can paginate using the offset and limit options. When a field list is specified, only those fields are output.

Only mapping tables that support data enumeration can be used.

Examples

  1. Retrieve all data from a mapping table

    lookuptable ip_asset
    

    Outputs all records from the ip_asset mapping table.

  2. Retrieve only the top N records

    lookuptable ip_asset limit=10
    

    Outputs up to 10 records from the ip_asset mapping table.

  3. Apply offset and limit

    lookuptable ip_asset offset=100 limit=50
    

    Skips the first 100 records from the ip_asset mapping table and outputs the subsequent 50 records.

  4. Retrieve specific fields only

    lookuptable ip_asset ip, hostname, department
    

    Outputs only the ip, hostname, and department fields from the ip_asset mapping table.