Home » Developer & Programmer » Forms » COPY BULIT-IN (DS 10G, DB 10G , WIN2003)
COPY BULIT-IN [message #435963] Sat, 19 December 2009 23:48 Go to next message
rkgoyal98
Messages: 39
Registered: October 2009
Member

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

Re: COPY BULIT-IN [message #435982 is a reply to message #435963] Sun, 20 December 2009 14:01 Go to previous message
magnetic
Messages: 324
Registered: January 2003
Senior Member

you dont need to copy
just do :block.item:= cursor.item;
just beware that the item cand hold big values
Previous Topic: failed to open file ifrun60_dump_1224
Next Topic: POST-CHANGE Trigger
Goto Forum:
  


Current Time: Thu Dec 08 22:11:37 CST 2016

Total time taken to generate the page: 0.23944 seconds