ORA-01007: variable not in select list

0 Likes
over 6 years ago

Problem:

In a COBOL Cobsql Oracle program, the following SELECT statement compiles OK but when run gets an ORA-01007: variable not in select list error.

       WORKING-STORAGE SECTION.

           10 VARCHAR-DATA.

49 VARCHAR-DATA-LEN  PIC S9(4) USAGE COMP.

49 VARCHAR-DATA-TEXT  PIC X(100).

       PROCEDURE DIVISION.

                 SELECT  VARCHAR

                 INTO    :VARCHAR-DATA                       

                 FROM  XXX

                 WHERE XXX

Resolution:

The SELECT column VARCHAR is defined as VARCHAR datatype. The INTO host variable VARCHAR-DATA is a group item with a length and string field. There is a Pro*COBOL option VARCHAR that needs to be set to YES to make the program accept user-defined VARCHAR group items. The default value of VARCHAR option is NO. An example of the compiler directives to set would be: P(cobsql) csqlt=oracle end-c VARCHAR=YES P(cp) endp.

SI2810621

Comment List
Anonymous
Related Discussions
Recommended