Hi,I am sending document through TN which in turn executes a processing rule and then inserts data into db. But it inserting null values. I used steps bizdocToRecord –>connect–>execSQL. Query is in the form “insert into table values(?,?,?)”
What are the fields that you are trying to insert into the table? The names specified in the dbParamNames field should have the correct value. Please check the pipeline to make sure you have the right values.
You can test this by creating another service with three steps
stringToDocument
DocumentToRecord
RecordToBizdoc and then invoke the insert service.
good luck.
hi Vinod,
So u r saying that I should take a string as input and map it to xmldata in the service in. Right? Then send xml document through TN and check to see if data is inserted into db. Am I right?
No, I mean for testing, instead of submitting to TN, you can use the three steps and then invoke the flow that you had specified in the processing rule. This way you can step thru and see the variables in the pipeline.
thanks
Hi,
I used these steps but still inserting null into db. I am attaching (image) of the flow.
Steps i am taking:
recordToDocument
stringToDocument
documetToRecord
execSQL
Instead of using execSQL try to use pub.db:insert service and make sure your document Structure exactly matches(case Sensitive) the table columns in your DB,and finally map your document (record structure) to $data (param in insert service)
Hi RMG,
I now used insert instead of execSQL. The input to recordToDocument is the following xml. When it comes to insert statement, it says “com.wm.app.b2b.server.DBException: No info available for column ‘@version’ in table ‘test’”. I have only 3 fields in db which i want to populate.
<?xml>
<information>
<name> AAA </name>
<age> 444 </age>
<address>CCC </address>
</information>
Information record structure:
<information>
<name> AAA </name>
<age> 444 </age>
<address>CCC </address>
</information>
your following fields(name,age,address) have to match exactly the same column names in the table(test) which you are inserting.and map the information record directly to $data param in insert service.
Make sure final record contain values in the pipe, before doing insert.
I am using the same steps, i dont know where this “version” element automatically included in the flow. I am getting output something like in the attached file.
Error is: No info available for column ‘@version’ in table ‘test’
while generating your record using documentToRecord don’t let @version element generated in the boundnode or else place a map step and manually map the final record conents to a temp record with same below structure (exclude the version element).
Create a new record called information and then map the elements in the big record/INFORMATION to the new small one. Then map that to the data structure in insert.
This will work.
Good Luck
Thanks RMG, it worked In documentToRecord step, i set the input value for bound node as
NAME = INFORMATION/NAME
AGE = INFORMATION/AGE
ADDRESS = INFORMATION/ADDRESS
excluding version element.
But, I am still not cleared why version is included in the bound node as my input xml document has no element like that.