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

7 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 2 weeks 4 min ago. Offline
Joined: 03/26/2008
Posts: 214
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 3 weeks 6 days ago. Offline
Joined: 08/02/2010
Posts: 78
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 16 weeks 5 days 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();

accessprogram's picture
User offline. Last seen 9 weeks 7 hours ago. Offline
Joined: 03/12/2012
Posts: 5
Re: inserting rows within standalone rowset without fill

here are many ways to insert and update rows into a record either using Application Engine or Component Interfaces.
In Application Engine program, using peopelecode we can create a standalone rowset with the record to be updated. Fill the rowset using rowset.fill method. Manipulate the data and use record.Save() method.

In Component Interfaces, if the record is in the CI buffer. If the data is populated in the buffer, the CI Save method will update or insert the data in the record.

"Life is too short to run proprietary software."

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.