Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, プログラミング・ガイド

ホスト構造体の例

次の例では、ホスト構造体と標識配列の宣言を示し、 その次に 2 つの同等な SQL ステートメントを示しています。 これらのステートメントのどちらかを使用して、 ホスト構造体にデータを取り込むことができます。

  dcl 1 games,
        5 sunday,
          10 opponents char(30),
          10 gtime     char(10),
          10 tv        char(6),
          10 comments  char(120) var;
  dcl indicator(4) fixed bin (15);


  exec sql
       fetch cursor_a
       into :games.sunday.opponents:indicator(1),
            :games.sunday.gtime:indicator(2),
            :games.sunday.tv:indicator(3),
            :games.sunday.comments:indicator(4);


  exec sql
       fetch cursor_a
       into :games.sunday:indicator;

最初の例で、その配列内のすべての標識変数は、最初のメンバー から開始して、順番に指定されることに注意してください。 順番になっていない指標変数があると、エラーとしてフラグが立てられます。


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)