Hi,
I am getting error becaue multiple fetch while select.
Basically I want to insert into a temporary table in stored procedure
My GTT structure is
declare GTT temp_T1 ( ID_NUM INT , PACK_NUM INT , C3T1 CHAR,C4T1 INT).
I want to insert into GTT data from another table as LP_PACK_DATA
LP_PACK_DATA
PACK_ID PACK_DATE, PACK_BY, SELF_CHECK
23 01/03/02 KIO Y
34 03/05/07 NMK N
25 03/05/04 WEE Y
14 03/01/07 CDE Y
12 09/09/02 NMK -
INSERT INTO TEMP_T1 (PACK_NUM) VALUES (SELECT PACK_ID FROM LP_PACK_DATA WHERE SELF_CHECK ='Y')
I am getting error as
SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES
INTO statement is more than one row.
Do I have to use cursor in this case or kindly suggest me if there is any multiple inserts can be done in above query.