COPY BULIT-IN [message #435963] |
Sat, 19 December 2009 23:48 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
rkgoyal98
Messages: 39 Registered: October 2009
|
Member |
![rkgoyal_98](/forum/theme/orafaq/images/yahoo.png)
|
|
Hello,
I have a small procedure in which i have to transfer values from the cursor to items on the block
In the cursor ITHEAD column has data like 'basic', 'oppay' ect.
Block blk_pritf16dtl has same items basic,oppay
Code i have tried is like this
PROCEDURE IT_CALC2 IS
ERRNUM NUMBER;
PREFIX VARCHAR2(40) := 'BLK_PRITF16DTL.';
PREFIX1 NUMBER;
ITEM_NAME VARCHAR2(40);
CURSOR C_ITCALCUR IS SELECT B.ITHEAD,MAX(B.PRIORITY) PRIORITY,MAX(B.SEXELIGIBLE) SEXELIGIBLE,
SUM(NVL(AMTMONTH1,0)) + SUM(NVL(AMTMONTH2,0)) + SUM(NVL(AMTMONTH3,0)) + SUM(NVL(AMTMONTH4,0)) +
SUM(NVL(AMTMONTH5,0)) + SUM(NVL(AMTMONTH6,0)) + SUM(NVL(AMTMONTH7,0)) + SUM(NVL(AMTMONTH8,0)) +
SUM(NVL(AMTMONTH9,0)) + SUM(NVL(AMTMONTH10,0))+ SUM(NVL(AMTMONTH11,0)) + SUM(NVL(AMTMONTH12,0)) CALAMT,
MAX(NVL(SUMMING,'N')) SUMMING FROM PRTRITD A,PRMAITR B
WHERE A.FINANCIALYEAR (+) =:BLK_PRTRITDMAS.FINYEAR AND A.ITHEAD(+) = B.ITHEAD AND EMPNO (+) = :BLK_PRMAEMPMAS.EMPNO
GROUP BY B.ITHEAD ORDER BY PRIORITY;
BEGIN
GO_BLOCK('BLK_PRITF16DTL');
SET_BLOCK_PROPERTY('BLK_PRITF16DTL',DEFAULT_WHERE,'EMPNO = '||''''||:BLK_PRMAEMPMAS.EMPNO||''''||'
AND FINANCIALYEAR = '||''''||:BLK_PRTRITDMAS.FINYEAR||''''||'');
EXECUTE_QUERY(NO_VALIDATE);
FOR R_ITCALCUR IN C_ITCALCUR
LOOP
IF R_ITCALCUR.CALAMT > 0 THEN
ITEM_NAME := PREFIX||R_ITCALCUR.ITHEAD;
COPY(R_ITCALCUR.CALAMT,NAME_IN(ITEM_NAME));
END IF;
END LOOP;
END;
However i am getting error that "argument 2 to bulit-in copy cannot be null"
I have also tried like this
COPY(name_in(R_ITCALCUR.CALAMT),NAME_IN(ITEM_NAME));
Kindly help me to resolve this
Regards
[Updated on: Sat, 19 December 2009 23:50] Report message to a moderator
|
|
|
|