webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Insert into oracle db

webMethods Community Member

webMethods Community MemberThu July 17, 2003 07:15 PM

webMethods Community Member

webMethods Community MemberThu July 17, 2003 08:24 PM

  • 1.  Insert into oracle db

    Posted Wed July 16, 2003 08:18 PM

    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(?,?,?)”

    Any Ideas?

    Thanks


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 2.  RE: Insert into oracle db

    Posted Wed July 16, 2003 08:29 PM

    pls,make sure the bizdoc record Structure is having enough data which you are trying to load to DB,before passing to execSQL service…

    or could be mapping related issue,check the pipeline if any errors…

    HTH.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: Insert into oracle db

    Posted Wed July 16, 2003 08:35 PM

    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

    1. stringToDocument
    2. DocumentToRecord
    3. RecordToBizdoc and then invoke the insert service.
      good luck.

    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Insert into oracle db

    Posted Wed July 16, 2003 08:53 PM

    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?

    Thanks


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 5.  RE: Insert into oracle db

    Posted Wed July 16, 2003 09:19 PM

    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


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 6.  RE: Insert into oracle db

    Posted Thu July 17, 2003 06:30 PM

    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

    Thanks


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 7.  RE: Insert into oracle db

    Posted Thu July 17, 2003 06:37 PM

    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)

    try this scenario,this will work…


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: Insert into oracle db

    Posted Thu July 17, 2003 07:00 PM

    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>

    Thanks


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Insert into oracle db

    Posted Thu July 17, 2003 07:15 PM

    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.

    HTH.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 10.  RE: Insert into oracle db

    Posted Thu July 17, 2003 07:30 PM

    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’

    Thanks


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 11.  RE: Insert into oracle db

    Posted Thu July 17, 2003 07:41 PM

    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).

    Just send below structure to $data.

    <information>
    <name> AAA </name>
    <age> 444 </age>
    <address>CCC </address>
    </information>

    HTH.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: Insert into oracle db

    Posted Thu July 17, 2003 07:49 PM

    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


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 13.  RE: Insert into oracle db

    Posted Thu July 17, 2003 08:00 PM

    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.

    Thanks


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 14.  RE: Insert into oracle db

    Posted Thu July 17, 2003 08:12 PM

    If your input xml shown below
    <?xml?>
    <information>
    <name> AAA </name>
    <age> 444 </age>
    <address>CCC </address>
    </information>

    documentToRecord will not let you create version element.
    Only it will create when you are passing <?xml>.

    Any way hope you are now successful inserting the data to DB,which is your goal.

    HTH,


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 15.  RE: Insert into oracle db



  • 16.  RE: Insert into oracle db

    Posted Thu July 17, 2003 08:33 PM