var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Is it possible to execute a string within an SQL stored procedure?
In SQL Server, you can do something like this within an stored procedure:
Set @MyQuery='select * from mytable'
Is is possible to do the same thing in DB2 v8.1? Perhaps by using a system stored procedure?
Thanks a lot in advance.
You can do something like:
DECLARE cursorx CURSOR WITH RETURN FOR s1;
WHEN 0 THEN
SET whereClause = '';
WHEN 1 THEN
SET whereClause = ' where (col1 is NULL) ';
WHEN 2 THEN
SET whereClause = ' where (col1 is NOT NULL) ';
SET stmt = 'select * from mytable ' || whereClause ;
PREPARE s1 from stmt;