host

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

host [2015/09/23 20:27] (current)
Line 1: Line 1:
 +====== Execute OS Command or External Process ======
 +
 +PL/HQL allows you to execute an OS command or external process from a PL/HQL script:
 +
 +**Syntax**:
 +
 +! command:
 +
 +<code language="​sql">​
 +!cmd [arguments];​
 +</​code>​
 +
 +HOST statement:
 +
 +<code language="​sql">​
 +HOST string_expr
 +</​code>​
 +
 +**Parameters:​**
 +
 +| **Parameter** | **Description** |
 +| cmd | Any OS command or process |
 +| arguments | Optional argument list | 
 +| string_expr | Command line for HOST statement |
 +
 +**Notes**:
 +
 +  * Blank characters are allowed between ! and cmd
 +  * The ! command must be terminated by a semicolon (;)
 +
 +**Example:​**
 +
 +Using ! command:
 +
 +<code language="​sql">​
 +!echo Hello, world;
 +</​code> ​
 +
 +Using HOST statement:
 +
 +<code language="​sql">​
 +HOST 'echo Hello, world';​
 +</​code>​
 +
 +**Compatibility**:​ Apache Hive (! command), Oracle (HOST statement).
 +
 +**Version**:​ PL/HQL 0.01