Hi,
I have an xml document with a RequiredDate element in that. I want to map it and then insert that record in the database.
Please, let me know the procedure how to do this.
The problem statement is:
Customer due date must be populated at line level of order. /XML_Order_Submit/POEnvelope/Detail/LineInfo/RequiredDate to database_table REQUEST_DATE
Request_date is the field in the database to which the value should be entered from the sml element RequiredDate.
I assume that you want to get the XML_Order_Submit/POEnvelope/Detail/LineInfo/RequiredDate to the database table field REQUEST_DATE. Now the question is if you have 5 linte itmes, which date do you want to insert? Do you insert 5 rows of request date for 5 line items?
Thanks
Thanks Vinod for reply,
Yes, you are right. I want to get XML_Order_Submit/POEnvelope/Detail/LineInfo/RequiredDate to the database table field REQUEST_DATE. I have 5 line items and I want to insert all those 5 items.
Also let me know if the procedure is same for inserting only one line item. And for 5 line items, I think I have to loop through them.
You will have to loop thru the line items and do an insert to the table using execSQL. Another option is to loop over the line items and create a record list (with the date fields) and then do a pub.db:insert by mapping the recordlist to the data field. This will be faster than individual inserts.
Thanks and Good Luck.
Loop over record list say emp contains empid,ename.After looping
(inside loop) it become as record emp.Now you create insertEmpdetail
service.In this service take input as
empid,ename fields Now click on flow button in this service.
take map,Take temparory field sqlInsert
make it large editor.Now write sql statement
ex:insert into schemaname.tablename(column names in that tableeg:EMPID,ENAME)values(‘%empid%’,‘%ename%’)pl check for
both check boxes in input for sqlSelect box.Then call execSQL
service in wmDB package map this sqlSelect to dbSQL.Drop
everything except updateCount,dbMessage(those are output parameters)
now call insertEmpDetail service into loop.Now map empid,ename
in record emp to empid,ename (input parameters for insertEmpDetail service).Your problem solved.Before call dbConnect,after procees
call close services to open dbconnection,dbclose.