Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Engine Peoplecode

Status
Not open for further replies.

rolivier

Programmer
Oct 14, 2002
1
US
I am using app engine to read a flat file for purposes of populating a PeopleSoft table. I have created a file definition layout using the CUST_EXEMPT_DTL table. My question is how should I represent the effective date in my flat file so that when the the record is read and copied using the CopyFieldsTo method the date will properly be loaded in my record object which has an EFFDT field of type date. Im running this on an Oracle database. Here is the code I'm using. Everything else seems to load properly except for the date.

Local File &file1;
Local Rowset &file_rowset;
Local Record &rec_custexemptdtl;
Local SQL &SQL1;

&rec_custexemptdtl = CreateRecord(Record.CUST_EXEMPT_DTL);
&SQL1 = CreateSQL("%INSERT:)1)");
&file1 = GetFile("I:\IT_Special_Projects\Yellow Projects\PS Billing\Conversion\WOC flat files\Sundance\CUST_EXEMPT_DTL.txt", "R", %FilePath_Absolute);
&file_rowset = &file1.CreateRowset();
If &file1.IsOpen Then
If &file1.SetFileLayout(FileLayout.CUST_EXEMPT_DTL_LAYOUT) Then
&file_rowset = &file1.ReadRowset();
While &file_rowset <> Null
&file_rowset.GetRow(1).CUST_EXEMPT_DTL.CopyFieldsTo(&rec_custexemptdtl);
&rec_custexemptdtl.GetField(Field.ADD_DTTM).Value = %Datetime;
&rec_custexemptdtl.GetField(Field.LAST_UPDATE_DTTM).Value = %Datetime;
&SQL1.Execute(&rec_custexemptdtl);
&file_rowset = &file1.ReadRowset();
End-While;
Else
Error (&quot;PKT_BISCRUB: failed SetFileLayout&quot;);
End-If;
Else
Error (&quot;PKT_BISCRUB: failed file open&quot;);
End-If;
&file1.Close();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top