:
[端末から入力した動的単一行SELECT文をstrに格納]
:
EXEC SQL PREPARE STMID FROM :str;
EXEC SQL ALLOCATE DESCRIPTOR 'INDESC' WITH MAX 100;
EXEC SQL ALLOCATE DESCRIPTOR 'OUTDESC' WITH MAX 100;
EXEC SQL DESCRIBE INPUT STMID USING SQL DESCRIPTOR 'INDESC';
EXEC SQL DESCRIBE OUTPUT STMID USING SQL DESCRIPTOR 'OUTDESC';
EXEC SQL GET DESCRIPTOR 'INDESC' :icount = COUNT;
for( i = 1; i <= icount; i++ ) {
EXEC SQL GET DESCRIPTOR 'INDESC' VALUE :i …
:
[動的パラメタ指定の情報をSQL記述子域から取得]
:
EXEC SQL SET DESCRIPTOR 'INDESC' VALUE :i …
:
[端末から入力した動的パラメタ指定の値をSQL記述子域に設定]
:
}
EXEC SQL GET DESCRIPTOR 'OUTDESC' :ocount = COUNT;
for( i = 1; i <= ocount; i++ ) {
EXEC SQL GET DESCRIPTOR 'OUTDESC' VALUE :i …
:
[選択リストの情報をSQL記述子域から取得]
:
EXEC SQL SET DESCRIPTOR 'OUTDESC' VALUE :i …
:
[SQL記述子域の選択リストの情報を変更]
:
}
EXEC SQL EXECUTE STMID INTO SQL DESCRIPTOR 'OUTDESC'
USING SQL DESCRIPTOR 'INDESC';
EXEC SQL GET DESCRIPTOR 'OUTDESC' VALUE :i …
:
[実行結果の値の取得]
:
EXEC SQL DEALLOCATE DESCRIPTOR 'INDESC';
EXEC SQL DEALLOCATE DESCRIPTOR 'OUTDESC';
EXEC SQL DEALLOCATE PREPARE STMID;
: |