DUAL¶
Description
The stored procedure DUAL
is a special procedure that only returns
one field called dummy
of type text
. It does not have input
parameters and it returns an empty row.
Its main uses are:
Executing low-cost queries used as ping queries by external clients that access Virtual DataPort via the JDBC and ODBC interfaces.
Executing VQL functions.
Syntax
Dual()
Privileges Required
No privileges are required to execute this procedure.
Examples
Example 1
SELECT CURRENT_DATE
FROM DUAL()
This query projects the function CURRENT_DATE, which returns the today’s date.
Example 2
SELECT 1
FROM DUAL()
This query is a very low-cost query that can be used as ping query by external clients.
Example 3
SELECT 1
This query returns the same as the previous example. That is because the
Server assumes that a query that does not have a FROM
clause is referencing the Dual()
procedure.