From 293913568e6a7a86fd1479e1cff8e2ecb58d6568 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 15:44:03 +0200 Subject: Adding upstream version 16.2. Signed-off-by: Daniel Baumann --- doc/src/sgml/html/ecpg-sql-execute-immediate.html | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 doc/src/sgml/html/ecpg-sql-execute-immediate.html (limited to 'doc/src/sgml/html/ecpg-sql-execute-immediate.html') diff --git a/doc/src/sgml/html/ecpg-sql-execute-immediate.html b/doc/src/sgml/html/ecpg-sql-execute-immediate.html new file mode 100644 index 0000000..0625450 --- /dev/null +++ b/doc/src/sgml/html/ecpg-sql-execute-immediate.html @@ -0,0 +1,37 @@ + +EXECUTE IMMEDIATE

EXECUTE IMMEDIATE

EXECUTE IMMEDIATE — dynamically prepare and execute a statement

Synopsis

+EXECUTE IMMEDIATE string
+

Description

+ EXECUTE IMMEDIATE immediately prepares and + executes a dynamically specified SQL statement, without + retrieving result rows. +

Parameters

string #

+ A literal string or a host variable containing the SQL + statement to be executed. +

Notes

+ In typical usage, the string is a host + variable reference to a string containing a dynamically-constructed + SQL statement. The case of a literal string is not very useful; + you might as well just write the SQL statement directly, without + the extra typing of EXECUTE IMMEDIATE. +

+ If you do use a literal string, keep in mind that any double quotes + you might wish to include in the SQL statement must be written as + octal escapes (\042) not the usual C + idiom \". This is because the string is inside + an EXEC SQL section, so the ECPG lexer parses it + according to SQL rules not C rules. Any embedded backslashes will + later be handled according to C rules; but \" + causes an immediate syntax error because it is seen as ending the + literal. +

Examples

+ Here is an example that executes an INSERT + statement using EXECUTE IMMEDIATE and a host + variable named command: +

+sprintf(command, "INSERT INTO test (name, amount, letter) VALUES ('db: ''r1''', 1, 'f')");
+EXEC SQL EXECUTE IMMEDIATE :command;
+

+

Compatibility

+ EXECUTE IMMEDIATE is specified in the SQL standard. +

\ No newline at end of file -- cgit v1.2.3