I need to load a text file from a location on my system and load it into the IS. Then i should process it and then enter the records into the database.
I am using Wm 6.1
the structure of the text file is as follows,
empname,empid,joindate,dob,salary,designation (this is record one)
empname,empid,joindate,dob,salary,designation (this is record two)
.
.
.
like this there are n records i need to insert all of them from this text file to the database…
Can any one help??
To get the file from your system to IS.You can use built in service getFile which is in wmPublic package may be under file folder.
It takes input
1.Filename :- you give the complete path where it is stored.
2.LoadAs :- in format you want to read the file i.e Stream or Bytes it depends on your requirement.
It gives output
1.body(It contains content of u r file)
after that you can pass the Body(content of file)
to the inbuilt flatfile service convertTovalues, which u can find it in wmFlatfile pakage.
it takes input
1.ffData :- file content interms of Bytes or Stream
2.ffSchema :- provide the entire name space of your Schema where it is stored.(I think uhave idea about name space)
it gives the output
1.ffvalues :- this is a documet it contains document list each document in this list represent each record of your file
after u get each record you can store them in database using your appropriate adapter service
For more information about creating flatfile Dictionary and flatFile Schema, storing ffvalues in to database.
Refer webMethods Flatfile Schema Developers Guide under webMethods documentation
If u have any doubts u can post immediately regarding this
Thank you Rajesh,
I do have some knowledge about the namespaces.
but the interesting thing in your reply has me going no where…
You said
to give the entire path of my schema.what if i am loading from a directory say d:\test rather than a package how can i read it, i mean how can i give the total path of the file to the flatFileSchema.converToValues.
Plz do explain if my understanding of your solutions is wrong.
Thank you
Read the message which i sent to u from wmUsers in u r wmusers Inbox ther i mentioned my mobile number. If u don't have any issuies give your mobile number
Yes,
how to give the record identifier and the CSV. When i have created the schema and dictionary that one reads any file rather than the specified ones. As i am a starter in this arena i dont know much about handling those things. More over if i specify CRLF as the delimiter it also appears in the text thats been read by the flat file schema. And it is my first thing in webMethods so i think an example will suffice with explanation.
Thanks in Advance.