You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

CI inserting extra 3 blank rows with today's EFFDT while insering tow rows in to delievered table

1 reply [Last post]
Guest's picture
Guest

CI inserting extra 3 blank rows with today's EFFDT while insering tow rows in to delievered table

hi this is my code,my target is to run the CI to insert the rows from cloned table to delieverd table,while inserting only for the following code it inserts an blank row with todays effdt don kno y please help,below is my code

rem ***** Set/Get VNDR_ADDR_SCROL Collection Field Properties -- Parent: PS_ROOT Collection *****;
      &RECORD_VALUE55 = CreateSQL("SELECT DESCR,VNDR_ADDRESS_TYPE,CCR_ADDR_TYPE FROM PS_BF_VNDR_ADD_SCR where BF_REQUEST_ID= :1", &BF_REQUEST_ID, &DESCR, &VNDR_ADDRESS_TYPE, &CCR_ADDR_TYPE);
      Local integer &i1166;
      &i1166 = 0;
      While &RECORD_VALUE55.FETCH(&DESCR, &VNDR_ADDRESS_TYPE, &CCR_ADDR_TYPE);
         rem  For &i1166 = 1 To &oVndrAddrScrolCollection.Count;
         &oVndrAddrScrolCollection = &oBfAddvndrId.VNDR_ADDR_SCROL;
         &i1166 = &i1166 + 1;
         rem &oVndrAddrScrol = &oVndrAddrScrolCollection.Item(&i1166);
         &oVndrAddrScrol = &oVndrAddrScrolCollection.insertItem(&i1166);
         &oVndrAddrScrol.DESCR = &DESCR;
         &fileLog.WriteLine("&oVndrAddrScrol.DESCR = " | &oVndrAddrScrol.DESCR);
         &oVndrAddrScrol.VNDR_ADDRESS_TYPE = &VNDR_ADDRESS_TYPE;
         &fileLog.WriteLine("&oVndrAddrScrol.VNDR_ADDRESS_TYPE = " | &oVndrAddrScrol.VNDR_ADDRESS_TYPE);
         &oVndrAddrScrol.CCR_ADDR_TYPE = &CCR_ADDR_TYPE;
         &fileLog.WriteLine("&oVndrAddrScrol.CCR_ADDR_TYPE = " | &oVndrAddrScrol.CCR_ADDR_TYPE);
         rem End-For;
         
      End-While;
     
      rem ***** Set/Get VENDOR_ADDR Collection Field Properties -- Parent: VNDR_ADDR_SCROL Collection *****;
      &RECORD_VALUE51 = CreateSQL("SELECT ADDRESS_SEQ_NUM,EFFDT, EMAILID,COUNTRY,ADDRESS1,ADDRESS2,ADDRESS3,CITY,COUNTY,STATE,POSTAL,ADDRESS_SEQ_NUM FROM PS_BF_VENDOR_ADDR where BF_REQUEST_ID= :1", &BF_REQUEST_ID, &ADDRESS_SEQ_NUM, &EFFDT, &EMAILID, &COUNTRY, &ADDRESS1, &ADDRESS2, &ADDRESS3, &CITY, &COUNTY, &STATE, &POSTAL, &ADDRESS_SEQ_NUM);
     
      Local integer &i2171;
      &i2171 = 0;
      While &RECORD_VALUE51.FETCH(&ADDRESS_SEQ_NUM, &EFFDT, &EMAILID, &COUNTRY, &ADDRESS1, &ADDRESS2, &ADDRESS3, &CITY, &COUNTY, &STATE, &POSTAL, &ADDRESS_SEQ_NUM);
         REM Local integer &i2171;
         REM For &i2171 = 1 To &oVendorAddrCollection.Count;
         &oVendorAddrCollection = &oVndrAddrScrol.VENDOR_ADDR;
         &i2171 = &i2171 + 1;
         &oVendorAddr = &oVendorAddrCollection.Item(&i2171);
         &oVendorAddrCollection.insertItem(&i2171);
         &oVendorAddr.ADDRESS_SEQ_NUM = &ADDRESS_SEQ_NUM;
         &fileLog.WriteLine("&oVendorAddr.ADDRESS_SEQ_NUM = " | &oVendorAddr.ADDRESS_SEQ_NUM);
         &oVendorAddr.EFFDT = &EFFDT;
         &fileLog.WriteLine("&oVendorAddr.EFFDT = " | &oVendorAddr.EFFDT);
         &oVendorAddr.EMAILID = &EMAILID;
         &fileLog.WriteLine("&oVendorAddr.EMAILID = " | &oVendorAddr.EMAILID);
         &oVendorAddr.COUNTRY = &COUNTRY;
         &fileLog.WriteLine("&oVendorAddr.COUNTRY = " | &oVendorAddr.COUNTRY);
         &oVendorAddr.ADDRESS1 = &ADDRESS1;
         &fileLog.WriteLine("&oVendorAddr.ADDRESS1 = " | &oVendorAddr.ADDRESS1);
         &oVendorAddr.ADDRESS2 = &ADDRESS2;
         &fileLog.WriteLine("&oVendorAddr.ADDRESS2 = " | &oVendorAddr.ADDRESS2);
         &oVendorAddr.ADDRESS3 = &ADDRESS3;
         &fileLog.WriteLine("&oVendorAddr.ADDRESS3 = " | &oVendorAddr.ADDRESS3);
         &oVendorAddr.CITY = &CITY;
         &fileLog.WriteLine("&oVendorAddr.CITY = " | &oVendorAddr.CITY);
         &oVendorAddr.COUNTY = &COUNTY;
         &fileLog.WriteLine("&oVendorAddr.COUNTY = " | &oVendorAddr.COUNTY);
         &oVendorAddr.STATE = &STATE;
         &fileLog.WriteLine("&oVendorAddr.STATE = " | &oVendorAddr.STATE);
         &oVendorAddr.POSTAL = &POSTAL;
         &fileLog.WriteLine("&oVendorAddr.POSTAL = " | &oVendorAddr.POSTAL);
         rem &oVendorAddrCollection.insertItem(&i2171);
         rem &oVendorAddr = &oVendorAddrCollection.insertItem(&i2171);
         
      End-While;

output:
VNDR_ADDR_SCROL:
papa 0000066573 1 BUSN (this is blank row which i dont want)
papa 0000066573 2 Payment(REMIT) BUSN
papa 0000066573 3 Ordering(ORDERNING) BUSN

VENDOR_ADDR:
papa 0000066573 1 07-APR-11 A GBR (this is blank row which i dont want)
papa 0000066573 1 01-JAN-01 A customercare@App.com GBR 46 BERKELEY ROAD UXBRIDGE
papa 0000066573 2 07-APR-11 A GBR (this is blank row which i dont want)
papa 0000066573 2 01-JAN-01 A customercare@App.com GBR 46 BERKELEY ROAD UXBRIDGE
papa 0000066573 3 07-APR-11 A GBR (this is blank row which i dont want)

please help me

apoliset's picture
User offline. Last seen 8 years 19 weeks ago. Offline
Joined: 04/25/2011
Posts: 3
Re: CI inserting extra 3 blank rows with today's EFFDT while ...

try this and reply back :
________________________________________________________

rem ***** Set/Get VNDR_ADDR_SCROL Collection Field Properties -- Parent: PS_ROOT Collection *****;

&RECORD_VALUE55 = CreateSQL("SELECT DESCR,VNDR_ADDRESS_TYPE,CCR_ADDR_TYPE FROM PS_BF_VNDR_ADD_SCR where BF_REQUEST_ID= :1", &BF_REQUEST_ID, &DESCR, &VNDR_ADDRESS_TYPE, &CCR_ADDR_TYPE);

Local integer &i1166;

&i1166 = 0;

While &RECORD_VALUE55.FETCH(&DESCR, &VNDR_ADDRESS_TYPE, &CCR_ADDR_TYPE);

rem For &i1166 = 1 To &oVndrAddrScrolCollection.Count;

&oVndrAddrScrolCollection = &oBfAddvndrId.VNDR_ADDR_SCROL;

&i1166 = &i1166 + 1;

rem &oVndrAddrScrol = &oVndrAddrScrolCollection.Item(&i1166);

&oVndrAddrScrol = &oVndrAddrScrolCollection.insertItem(&i1166);

&oVndrAddrScrol.DESCR = &DESCR;

&fileLog.WriteLine("&oVndrAddrScrol.DESCR = " | &oVndrAddrScrol.DESCR);

&oVndrAddrScrol.VNDR_ADDRESS_TYPE = &VNDR_ADDRESS_TYPE;

&fileLog.WriteLine("&oVndrAddrScrol.VNDR_ADDRESS_TYPE = " | &oVndrAddrScrol.VNDR_ADDRESS_TYPE);

&oVndrAddrScrol.CCR_ADDR_TYPE = &CCR_ADDR_TYPE;

&fileLog.WriteLine("&oVndrAddrScrol.CCR_ADDR_TYPE = " | &oVndrAddrScrol.CCR_ADDR_TYPE);

rem End-For;

End-While;

&oVndrAddrScrol = &oVndrAddrScrolCollection.deleterow(&i1166);

rem ***** Set/Get VENDOR_ADDR Collection Field Properties -- Parent: VNDR_ADDR_SCROL Collection *****;

&RECORD_VALUE51 = CreateSQL("SELECT ADDRESS_SEQ_NUM,EFFDT, EMAILID,COUNTRY,ADDRESS1,ADDRESS2,ADDRESS3,CITY,COUNTY,STATE,POSTAL,ADDRESS_SEQ_NUM FROM PS_BF_VENDOR_ADDR where BF_REQUEST_ID= :1", &BF_REQUEST_ID, &ADDRESS_SEQ_NUM, &EFFDT, &EMAILID, &COUNTRY, &ADDRESS1, &ADDRESS2, &ADDRESS3, &CITY, &COUNTY, &STATE, &POSTAL, &ADDRESS_SEQ_NUM);

Local integer &i2171;

&i2171 = 0;

While &RECORD_VALUE51.FETCH(&ADDRESS_SEQ_NUM, &EFFDT, &EMAILID, &COUNTRY, &ADDRESS1, &ADDRESS2, &ADDRESS3, &CITY, &COUNTY, &STATE, &POSTAL, &ADDRESS_SEQ_NUM);

REM Local integer &i2171;

REM For &i2171 = 1 To &oVendorAddrCollection.Count;

&oVendorAddrCollection = &oVndrAddrScrol.VENDOR_ADDR;

&i2171 = &i2171 + 1;

&oVendorAddr = &oVendorAddrCollection.Item(&i2171);

&oVendorAddrCollection.insertItem(&i2171);

&oVendorAddr.ADDRESS_SEQ_NUM = &ADDRESS_SEQ_NUM;

&fileLog.WriteLine("&oVendorAddr.ADDRESS_SEQ_NUM = " | &oVendorAddr.ADDRESS_SEQ_NUM);

&oVendorAddr.EFFDT = &EFFDT;

&fileLog.WriteLine("&oVendorAddr.EFFDT = " | &oVendorAddr.EFFDT);

&oVendorAddr.EMAILID = &EMAILID;

&fileLog.WriteLine("&oVendorAddr.EMAILID = " | &oVendorAddr.EMAILID);

&oVendorAddr.COUNTRY = &COUNTRY;

&fileLog.WriteLine("&oVendorAddr.COUNTRY = " | &oVendorAddr.COUNTRY);

&oVendorAddr.ADDRESS1 = &ADDRESS1;

&fileLog.WriteLine("&oVendorAddr.ADDRESS1 = " | &oVendorAddr.ADDRESS1);

&oVendorAddr.ADDRESS2 = &ADDRESS2;

&fileLog.WriteLine("&oVendorAddr.ADDRESS2 = " | &oVendorAddr.ADDRESS2);

&oVendorAddr.ADDRESS3 = &ADDRESS3;

&fileLog.WriteLine("&oVendorAddr.ADDRESS3 = " | &oVendorAddr.ADDRESS3);

&oVendorAddr.CITY = &CITY;

&fileLog.WriteLine("&oVendorAddr.CITY = " | &oVendorAddr.CITY);

&oVendorAddr.COUNTY = &COUNTY;

&fileLog.WriteLine("&oVendorAddr.COUNTY = " | &oVendorAddr.COUNTY);

&oVendorAddr.STATE = &STATE;

&fileLog.WriteLine("&oVendorAddr.STATE = " | &oVendorAddr.STATE);

&oVendorAddr.POSTAL = &POSTAL;

&fileLog.WriteLine("&oVendorAddr.POSTAL = " | &oVendorAddr.POSTAL);

rem &oVendorAddrCollection.insertItem(&i2171);

rem &oVendorAddr = &oVendorAddrCollection.insertItem(&i2171);

End-While;

&oVendorAddrCollection.deleterow(&i2171);

Regards
Aditya