Home » Developer & Programmer » Precompilers, OCI & OCCI » CURSOR FETCH ERROR SQL-02112
CURSOR FETCH ERROR SQL-02112 [message #150926] Mon, 12 December 2005 00:59 Go to next message
varun_bond
Messages: 1
Registered: December 2005
Junior Member
I'm fecthing using a cursor the following SQL:
SELECT A.PRODUCT_PREFIX,
A.PRODUCT_ID,
NVL(A.SECTION_CODE,' '),
SUBSTR(PG.LISTED_NAME,1,20),
NVL(A.HEADING_CODE,0 ),
SUBSTR(H.HEADING_NAME,1,20),
NVL(PG.TEAM_ID, ' ')
FROM ADS A, PRODUCT_GR PG, HEADING H
WHERE A.PRODUCT_PREFIX = PG.PRODUCT_PREFIX
AND A.PRODUCT_ID=PG.PRODUCT_ID
AND A.HEADING_CODE = H.HEADING_CODE
AND A.DIR_CODE = 'CHH'
AND A.SECTION_CODE = 'YP'
AND A.ISSUE_YEAR = 2005
AND A.ISSUE_MONTH = 10
ORDER BY SUBSTR(H.HEADING_NAME,1,20)

But during the first fetch I'm getting the error:
SQL-02112: SELECT..INTO returns too many rows
Re: CURSOR FETCH ERROR SQL-02112 [message #150981 is a reply to message #150926] Mon, 12 December 2005 07:38 Go to previous message
Frank Naude
Messages: 4565
Registered: April 1998
Senior Member
02112, 00000, "SELECT..INTO returns too many rows"
// *Cause: A SELECT...INTO statement returned more rows than can be stored
//         in the host variable provided.
// *Action: There are 3 possible solutions:
//          1. Use the precompiler option select_error=no.
//          2. Declare a host variable with a larger array dimension.
//          3. Declare a cursor or cursor variable for the select statement.
Previous Topic: Linking problem in OCCI/C++ program
Next Topic: Makefile for Pro*C
Goto Forum:
  


Current Time: Sat Oct 31 14:37:48 CDT 2020