I'm trying to add value to a record using the app engine from my text file.
I know that this may be done using the file layout, but my requirement suggests not to use the file layout, but the app engine is required to be recorded on the record using people's code.
I am writing the following PeopleCode in my appengine (here I am trying to add only one field value to my records in this example)
local file & Amp; MYFILE; Local records and REC_ERN; & Amp; MYFILE = GetFile ("c: \ sample.csv", "R",% FilePath_Absolute); If & amp; MYFILE.IsOpen then when & amp; MYFILE.ReadLine (& amp; STRING); Messagebox (0, "", 0, 0, and STRING); & Amp; Source_type_id = substrings (and amp; STRING, 1, 3); & Amp; Stmt = "Include KGS_TEST (ID) values (& source_type_id)"; SQLExec (& amp; Stmt); Rim messagebox (0, "", 0, 0, and source_type_id); While ending; end if; & Amp; MYFILE.Close ();
The problem is facing & amp; Source_type_id = substrings (& amp; STRING, 1, 3); The value of variable & source_type_id is but I need to enter it in this record that I have created, which contains field (id, NAME, AGE, department)
The issue you are raising is that your variable and source_type_id is inside a string and therefore Actually you want the value of the variable to be in the form of a string instead
What you have to do, the bind variable is entered in the string for the value and then the value is to be given as the parameter of SqlExec.
local file and concert; & Amp; MYFILE = GetFile ("c: \ sample.csv", "R",% FilePath_Absolute); If & amp; MYFILE.IsOpen then when & amp; MYFILE.ReadLine (& amp; STRING); Messagebox (0, "", 0, 0, and STRING); & Amp; Source_type_id = substrings (and amp; STRING, 1, 3); & Amp; Stmt = "Include KGS_TEST (ID) values (: 1)"; SQLExec (& amp; Stmt, & source_type_id); Rim messagebox (0, "", 0, 0, and source_type_id); While ending; end if; & Amp; MYFILE.Close ();
Comments
Post a Comment