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.

inserting rows within standalone rowset without fill

6 replies [Last post]
Guest's picture
Guest

I see lots of references to filling a rowset via data from a table. Can we insert rows within a standalone rowset without using fill?

Ashar's picture
User offline. Last seen 5 years 1 week ago. Offline
Joined: 03/26/2008
Posts: 227
Re: inserting rows within standalone rowset without fill

Yes. you can use insertrow method of rowset class.

PeopleBooks's picture
PeopleBooks (not verified)
Re: inserting rows within standalone rowset without fill

You can also use the CopyTo method to to insert rows from one rowset into another.

Hari_aindian's picture
User offline. Last seen 7 years 2 weeks ago. Offline
Joined: 08/02/2010
Posts: 84
Re: inserting rows within standalone rowset without fill

Hey guys,

Can we insert rows within a standalone rowset without using fill?
meaning user is expecting the data to store in the DB?
if so we CAN'T use the above said methods like INSERTROW or COPYTO.

If we need to insert the data into the database then we need to use the INSERT function. For this you have to create a record using CREATERECORD method.

We can use the copyto method only to populate the data in the buffer. We cant use this to store the data in the database. Insertrow and copy to are rowset related methods, where as insert is record related method.

Thanks,
Hari.A

kalyan kulkarni's picture
kalyan kulkarni (not verified)
Re: inserting rows within standalone rowset without fill

Hi, I am new to peoplesoft.
I have one query ...How can we insert a row in the record(database) using rowset ??
can somebody give example plz...

ricky b's picture
ricky b (not verified)
Re: inserting rows within standalone rowset without fill

A few ways to this...

1.
A. Create standalone (target) rowset based on the record to be inserted into
B. Then use the copy rowset method to copy rows from the source rowset to the target rowset...

2.
A. Create a insert SQL
B. Loop thru the source rowset, set the values, then perform an insert at the end of each loop.

dmcdonald36's picture
User offline. Last seen 9 years 5 weeks ago. Offline
Joined: 01/25/2012
Posts: 2
Re: inserting rows within standalone rowset without fill

Hello kalyan kulkarni,

Below is an example of how to use the PeopleSoft Tools Function GetRowSet to insert rows of data into a record.

&PayTimeList = GetLevel0().GetRow(1).GetRowset(Scroll.XX_UNAPRVDTM_VW);

&SQL1 = CreateSQL(“SELECT A.BUSINESS_UNIT, A.DEPTID,A.GROUP_ID,A.EMPLID FROM PS_XX_UNAPRVD_TIME);

While &SQL1.Fetch(&Business_Unit, &Deptid, &GroupId, &Emplid);
&PayTimeList.GetRow(1).XX_UNAPRVDTM_VW.BUSINESS_UNIT.Value = &Business_Unit;
&PayTimeList.GetRow(1).XX_UNAPRVDTM_VW.DEPTID.Value = &Deptid;
&PayTimeList.GetRow(1).XX_UNAPRVDTM_VW.GROUP_ID.Value = &GroupId;
&PayTimeList.GetRow(1).XX_UNAPRVDTM_VW.EMPLID.Value = &Emplid;
&PayTimeList.InsertRow(0);
End-While;

&SQL1.Close();