I'm setting up a program wherein it will read a csv file from a directory and it will be loaded into a peoplesoft table.
Local SQL &SQL;
Local File &FileSetid;
Local array of string &Columns_array;
Local string &RowSetid;
&FileSetid = GetFile("\\CBRTPWDAPU218\psoft\fspsdev\custhome\sqr\testdata.csv", "R", %FilePath_Absolute);
If &FileSetid.IsOpen Then
While &FileSetid.ReadLine(&RowSetid);
&Columns_array = Split(&RowSetid, ",");
SQLExec("INSERT INTO PS_FT_TRN_ITEM_CLM (BUSINESS_UNIT, CUST_ID, ITEM, ENTRY_TYPE, ENTRY_REASON) VALUES (:1,:2,:3,:4,:5)", &Columns_array [1], &Columns_array [2], &Columns_array [3], &Columns_array [4], &Columns_array [5]);
End-While;
End-If;
I am getting "Fetching Array Element 2: Index is not in range 1 to 1."
The input file I have contains this:
BUSINESS_UNIT,CUST_ID,ITEM,ENTRY_TYPE,ENTRY_REASON 10000,ARTEST,ITEM01,NEW,NEW