Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Product Manuals » ElevateDB Version 2 SQL Manual » SQL/PSM Statements » EXECUTE IMMEDIATE |
EXECUTE IMMEDIATE <SQLStatement> [USING <Value> [,<Value>]]
-- This procedure executes a -- CREATE TABLE statement to create a -- temporary table CREATE PROCEDURE CreateTestTable() BEGIN EXECUTE IMMEDIATE 'CREATE TEMPORARY TABLE "TestTable" ( "FirstColumn" INTEGER, "SecondColumn" VARCHAR(30), "ThirdColumn" CLOB, PRIMARY KEY ("FirstColumn") ) DESCRIPTION ''Test Table'''; END -- This function returns the user-defined -- version for a given table, or NULL if -- the table does not exist FUNCTION "GetTableVersion" (IN TableName VARCHAR) RETURNS DECIMAL(19,2) BEGIN DECLARE Version DECIMAL(19,2) DEFAULT 0; EXECUTE IMMEDIATE 'SELECT Version INTO ? FROM Information.Tables WHERE Name=?' USING Version,TableName; RETURN Version; END
Deviation | Details |
Dynamic SQL | The use of dynamic SQL for DDL, DML, and administrative statement execution instead of static SQL in procedures and functions is both an ElevateDB extension and a deviation from the standard. |
This web page was last updated on Thursday, November 16, 2023 at 10:39 AM | Privacy PolicySite Map © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |