數據庫應用程序通常進行一項確定的工作
以Format
DECLARE Cursor | Procedure
DYNAMIC CURSOR | PROCEDURE
FOR DynamicStagingArea ;
PREPARE DynamicStagingArea FROM SQLStatement
{USING TransactionObject} ;
DESCRIBE DynamicStagingArea
INTO DynamicDescriptionArea ;
OPEN DYNAMIC Cursor | Procedure
USING DESCRIPTOR DynamicDescriptionArea} ;
EXECUTE DYNAMIC Cursor | Procedure
USING DESCRIPTOR DynamicDescriptionArea ;
FETCH Cursor | Procedure
USING DESCRIPTOR DynamicDescriptionArea ;
CLOSE Cursor | Procedure ;
在使用動態SQL語句時
動態SQL語句雖然解能夠在程序運行過程中構造SQL語句
程序代碼
string sql_string
long start_pos=
string old_str //select語句中需要替換的字符串
string new_str //替換字符串
[
From:http://tw.wingwit.com/Article/program/PB/201311/24558.html