OUTBOUND CODE///////
&outfile = GetFile("E:\MOHAN1\OUTBOUND2.CSV", "W", %FilePath_Absolute);
If &outfile.IsOpen Then
If &outfile.SetFileLayout(FileLayout.OUTB) Then
&outfile.WRITELINE("COMPONENT NAME" | "," | "PAGE NAME" | "," | "RECORD NAME" | "," | "RECORD DESC" | "," | "FIELD NAME" | "," | "FIELD LONG LABEL");
&rs1 = CreateRowset(Record.M_COMP_INFO);
&rs1.fill();
&rs2 = &outfile.CreateRowset();
&rs1.copyTo(&rs2);
&outfile.WriteRowset(&rs2);
End-If
End-If
INBOUND CODE//
Local File &myfile;
Local Rowset &rs;
Local Record &rec;
Local SQL &sql1;
&rec = CreateRecord(Record.M_COMP_INFO);
&sql1 = CreateSQL("%insert(:1)");
&myfile = GetFile("E:\MOHAN1\OUTBOUND2.CSV", "r", "a", %FilePath_Absolute);
&rs = &myfile.CreateRowset();
If &myfile.IsOpen Then
If &myfile.SetFileLayout(FileLayout.OUTB) Then
&rs = &myfile.ReadRowset();
While &rs <> Null
&rs.GetRow(1).M_COMP_INFO.CopyFieldsTo(&rec);
&sql1.Execute(&rec);
&rs = &myfile.ReadRowset();
End-While;
End-If;
End-If;
&myfile.Close();
No comments:
Post a Comment