adil abd بتاريخ: 22 نوفمبر 2017 تقديم بلاغ مشاركة بتاريخ: 22 نوفمبر 2017 DECLARE AppID PLS_INTEGER; ConvID PLS_INTEGER; RCount Number := 0; CURSOR c1 IS --*--------------------------------- down insert select from block-------------------------- select * from ( select parno,MA_NAME MANAME ,sum(nvl(oldbala,0)) oldbala ,sum(nvl(sale,0)) sale ,sum(nvl(buy,0)) buy ,sum(nvl(oldbala,0)-nvl(sale,0)+nvl(buy,0)) newbala ,sum(nvl(bala,0)) bala from (select parno,sum(nvl(inqty,0)-nvl(ouqty,0)) oldbala,0 sale,0 buy,0 bala from matbala where indate<(SELECT edaterep from parm) group by parno union all select parno,0 oldbbala,sum(nvl(ouqty,0)) sale,0 buy,0 bala from matbala where indate=(SELECT edaterep from parm) and type in ('2','6','8','10') group by parno union all select parno,0 oldbbala,0 sale,sum(nvl(inqty,0)) buy,0 bala from matbala where indate=(SELECT edaterep from parm) and type in ('1','0','11','5') group by parno union all select parno,0 oldbbala,0 sale,0 buy,sum(nvl(inqty,0)-nvl(ouqty,0)) bala from matbala group by parno ),MAT WHERE PARNO=MA_PARNO group by parno,ma_name) where nvl(sale,0)!=0 order by maname; --*--------------------------------- end -------------------------- PROCEDURE INSERTROW (invalue VARCHAR2, incol NUMBER) IS BEGIN DDE.POKE(ConvID, 'R'||TO_CHAR(RCount)||'C'||TO_CHAR(incol), invalue, DDE.CF_TEXT, 1000); END INSERTROW; BEGIN RCount := 1; --*--------------------------------- path excel on windows-------------------------- AppID := DDE.APP_BEGIN('C:\Program Files\Microsoft Office\Office12\EXCEL.EXE', DDE.APP_MODE_MAXIMIZED); ConvID := DDE.INITIATE('EXCEL', 'system'); --*--------------------------------- path excel file seve on windows-------------------------- DDE.EXECUTE(ConvID, '[save.As("' || 'f:\REFERENCE_LIST.XLS' || '",1)]',10000); ConvID := DDE.INITIATE('EXCEL', 'f:\mattran.XLS'); --*--------------------------------- down cloumn name arabic -------------------------- INSERTROW ('ÇÓã ÇáãÇÏÉ', 1) ; INSERTROW ('ÑÕíÏ ÇáãÇÏÉ ÇáÓÇÈÞ', 2) ; FOR INV IN c1 LOOP RCount := RCount + 1; INSERTROW(NVL(INV.MANAME,' '), 1); INSERTROW(NVL(INV.oldbala,' '), 2); END LOOP; END; 4 اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.