将记录从 Oracle 数组移动到 Cobol
如何将记录从 oracle 移动到 Cobol 数组? 当我移动一个字段时,一切都会按预期进行。 当我尝试移动 Oracle VARRAY 中的记录时,我不能 让它发挥作用。 PRO*COBOL 预编译器给出以下错误消息:
Error at line 137, column 12 in file ESF3.ordbso07.PCO
EXEC SQL EXECUTE
...........1
PCB-S-00576, PLS-382: expression is of wrong type
Error at line 137, column 12 in file ESF3.ordbso07.PCO
EXEC SQL EXECUTE
...........1
PCB-S-00576, PLS-0: Statement ignored
Oracle 类型:
TYPE QDELSSRD_arr IS VARRAY(30) OF QDELSSRD_typ;
TYPE SODLSSRD_typ IS RECORD ( -- DBSO07 SOK
QDELSSRD QDELSSRD_arr -- 30 x QDELSSRD_typ
OC is SODLSSRD_typ;
TYPE QDELSSRD_typ IS RECORD (
ENAMN arbetssokande.efternamn%type, -- VARCHAR2(30 CHAR)
FNAMN arbetssokande.fornamn%type, -- VARCHAR2(20 CHAR)
);
COBOL ESQL 匿名 PL/SQL 块的片段:
FOR LV IN 1..:RC-ZHITS
LOOP
:QDELSSRD(LV) := OC.QDELSSRD(LV);
END LOOP;
COBOL 变量声明:
15 QSODLSSRD.
18 QDELSSRD OCCURS 30.
21 ENAMN PIC X(030).
21 FNAMN PIC X(020).
How can I move a record from oracle to a Cobol array?
When I move a single field, everything works as expected.
When I try to move a record in an Oracle VARRAY I cannot
get it to work. The PRO*COBOL precompiler gives the following error message:
Error at line 137, column 12 in file ESF3.ordbso07.PCO
EXEC SQL EXECUTE
...........1
PCB-S-00576, PLS-382: expression is of wrong type
Error at line 137, column 12 in file ESF3.ordbso07.PCO
EXEC SQL EXECUTE
...........1
PCB-S-00576, PLS-0: Statement ignored
Oracle types:
TYPE QDELSSRD_arr IS VARRAY(30) OF QDELSSRD_typ;
TYPE SODLSSRD_typ IS RECORD ( -- DBSO07 SOK
QDELSSRD QDELSSRD_arr -- 30 x QDELSSRD_typ
OC is SODLSSRD_typ;
TYPE QDELSSRD_typ IS RECORD (
ENAMN arbetssokande.efternamn%type, -- VARCHAR2(30 CHAR)
FNAMN arbetssokande.fornamn%type, -- VARCHAR2(20 CHAR)
);
Snippet of COBOL ESQL anonymous PL/SQL block:
FOR LV IN 1..:RC-ZHITS
LOOP
:QDELSSRD(LV) := OC.QDELSSRD(LV);
END LOOP;
COBOL variable declaration:
15 QSODLSSRD.
18 QDELSSRD OCCURS 30.
21 ENAMN PIC X(030).
21 FNAMN PIC X(020).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你需要使用 VARYING...例如:
http ://www.pitt.edu/~hoffman/oradoc/server.804/a58232/ch04.htm
I think you need to use VARYING... For example:
http://www.pitt.edu/~hoffman/oradoc/server.804/a58232/ch04.htm