User Tools

Site Tools


Sidebar

**HPL/SQL is included to Apache Hive since version 2.0** * [[home|Home]]\\ * [[why|Why HPL/SQL]]\\ * [[features|Key Features]]\\ * [[start|Get Started]]\\ * [[doc|HPL/SQL Reference]]\\ * [[download|Download]]\\ * [[new|What's New]]\\ * [[about|About]]

hostcode

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== HOSTCODE - PL/HQL Reference ====== HOSTCODE built-in variable contains the return code of the last OS command. <code language=sql> SET plhql.onerror = SETERROR; HOST 'echo hello, world'; IF HOSTCODE <> 0 THEN PRINT 'Error'; END IF; </code> **Notes**: * Typically HOSTCODE is 0 when the process terminated successfully, and 1 if it terminated with an error. * By default [[configuration#plhqlonerror|plhql.onerror]] is set to EXCEPTION, so if the OS command cannot be executed (the process does not exist, no permissions i.e.) the exception is raised and you are not be able to check HOSTCODE in IF statement. For more information, see [[error-handling|Error Handling]]. **Compatibility:** PL/HQL Extension. **See also:** * [[sqlcode|SQLCODE]]