Unanswered: Alternate ways to concatenating a string in stored procedures
Using DB2 9.7 fixpack 4 on Windows 7.
I have a situation where I am creating a huge SQL inline query into a 32k VARCHAR. The SQL query string I am generating is so large that apparently the string is cut-off before it has been fully constructed I then execute the SQL query string using:
PREPARE S1 FROM V_SQL;
Are there alternative ways to create a query string? A 32k VARCHAR does not seem to be enough for me. The query has to be executed in one go though...
Introduces the statement string. The statement string is the value of the specified host variable.
Specifies a host variable that is described in the program in accordance with the rules for declaring character string variables. It must be a fixed-length or varying-length character-string variable that is less than the maximum statement size of 2 097 152 bytes. Note that a CLOB(2097152) can contain a maximum size statement, but a VARCHAR cannot.
An expression specifying the statement string. The expression must return a fixed-length or varying-length character-string type that is less than the maximum statement size of 2 097 152 bytes.