github.com/mithrandie/csvq@v1.18.1/docs/_posts/2006-01-02-built-in.md (about)

     1  ---
     2  layout: default
     3  title: Built-in Commands - Reference Manual - csvq
     4  category: reference
     5  ---
     6  
     7  # Built-in Commands
     8  
     9  | name | description |
    10  | :- | :- |
    11  | [ECHO](#echo)       | Print a value |
    12  | [PRINT](#print)     | Print a value formatted according to the type  |
    13  | [PRINTF](#printf)   | Print a formatted value |
    14  | [SOURCE](#source)   | Load and execute an external file |
    15  | [EXECUTE](#execute) | Execute a string as statements |
    16  | [SHOW](#show)       | Show objects |
    17  | [SHOW FIELDS](#show_fields) | Show fields in a table or a view |
    18  | [CHDIR](#chdir)     | Change current working directory |
    19  | [PWD](#pwd)         | Print current working directory |
    20  | [RELOAD CONFIG](#reload-config) | Reload configuration json files |
    21  | [SYNTAX](#syntax)   | Print syntax |
    22  
    23  ## Command Syntax
    24  
    25  ### ECHO
    26  {: #echo}
    27  
    28  Print a value. This command returns the same result as "PRINTF '%s' USING value".
    29  
    30  ```sql
    31  ECHO value;
    32  ```
    33  
    34  _value_
    35  : [value]({{ '/reference/value.html' | relative_url }})
    36  
    37  
    38  ### PRINT
    39  {: #print}
    40  
    41  Print a value formatted according to the type.
    42  
    43  ```sql
    44  PRINT value;
    45  ```
    46  
    47  _value_
    48  : [value]({{ '/reference/value.html' | relative_url }})
    49  
    50  
    51  ### PRINTF
    52  {: #printf}
    53  
    54  Print a formatted value.
    55  
    56  ```sql
    57  PRINTF format [, replace_value ...];
    58  PRINTF format USING replace_value [, replace_value ...];
    59  ```
    60  
    61  _format_
    62  : [string]({{ '/reference/value.html#string' | relative_url }})
    63  
    64  _replace_value_
    65  : [value]({{ '/reference/value.html' | relative_url }})
    66  
    67  The format is the same as the [FORMAT function]({{ '/reference/string-functions.html#format' | relative_url }})
    68  
    69  
    70  ### SOURCE
    71  {: #source}
    72  
    73  Load and execute an external file as a part of the procedure.
    74  
    75  ```sql
    76  SOURCE file_path;
    77  ```
    78  
    79  _file_path_
    80  : [string]({{ '/reference/value.html#string' | relative_url }}) or [identifier]({{ '/reference/statement.html#parsing' | relative_url }})
    81  
    82  
    83  ### EXECUTE
    84  {: #execute}
    85  
    86  Execute a string as statements.
    87  
    88  ```sql
    89  EXECUTE statements;
    90  EXECUTE statements USING replace_value [, replace_value...];
    91  ```
    92  
    93  _statements_
    94  : [string]({{ '/reference/value.html#string' | relative_url }})
    95  
    96  _replace_value_
    97  : [string]({{ '/reference/value.html#string' | relative_url }})
    98  
    99  If _replace_values_ are specified, then placeholders in _statements_ are replaced with _replace_values_.
   100  The format is the same as the [FORMAT function]({{ '/reference/string-functions.html#format' | relative_url }})
   101  
   102  
   103  ### SHOW
   104  {: #show}
   105  
   106  Show objects.
   107  
   108  ```sql
   109  SHOW {TABLES|VIEWS|CURSORS|FUNCTIONS|STATEMENTS|FLAGS|ENV|RUNINFO};
   110  ```
   111  
   112  TABLES
   113  : Loaded Tables
   114  
   115  VIEWS
   116  : Created [Temporary Tables]({{ '/reference/temporary-table.html' | relative_url }})
   117  
   118  CURSORS
   119  : Declared [Cursors]({{ '/reference/cursor.html' | relative_url }})
   120  
   121  FUNCTIONS
   122  : Declared [User Defined Functions]({{ '/reference/user-defined-function.html' | relative_url }})
   123  
   124  STATEMENTS
   125  : [Prepared Statements]({{ '/reference/prepared-statement.html' | relative_url }})
   126  
   127  FLAGS
   128  : List of [Flags]({{ '/reference/flag.html' | relative_url }})
   129  
   130  ENV
   131  : List of [Environment Variables]({{ '/reference/environment-variable.html' | relative_url }})
   132  
   133  RUNINFO
   134  : List of [Runtime Information]({{ '/reference/runtime-information.html' | relative_url }})
   135  
   136  ### SHOW FIELDS
   137  {: #show_fields}
   138  
   139  Show fields in a table or a view.
   140  
   141  ```sql
   142  SHOW FIELDS FROM table_name;
   143  ```
   144  
   145  _table_name_
   146  : [identifier]({{ '/reference/statement.html#parsing' | relative_url }}) or [Table Object]({{ '/reference/select-query.html#from_clause' | relative_url }})
   147    
   148    table name or view name.
   149  
   150  
   151  
   152  ### CHDIR
   153  {: #chdir}
   154  
   155  Change current working directory.
   156  
   157  ```sql
   158  CHDIR directory_path;
   159  ```
   160  
   161  _directory_path_
   162  : [string]({{ '/reference/value.html#string' | relative_url }}) or [identifier]({{ '/reference/statement.html#parsing' | relative_url }})
   163  
   164  
   165  
   166  ### PWD
   167  {: #pwd}
   168  
   169  Print current working directory.
   170  
   171  ```sql
   172  PWD;
   173  ```
   174  
   175  
   176  ### RELOAD CONFIG
   177  {: #reload-config}
   178  
   179  Reload [configuration json files]({{ '/reference/command.html#configurations' | relative_url }}).
   180  
   181  ```sql
   182  RELOAD CONFIG;
   183  ```
   184  
   185  
   186  ### SYNTAX
   187  {: #syntax}
   188  
   189  Print syntax.
   190  
   191  ```sql
   192  SYNTAX [search_word [, search_word ...]];
   193  ```
   194  
   195  _search_word_
   196  : [string]({{ '/reference/value.html#string' | relative_url }}) or [identifier]({{ '/reference/statement.html#parsing' | relative_url }})