Power

 View Only
  • 1.  IBM Web Administration for i

    Posted Fri April 21, 2023 11:02 AM

    I have created an API on using "SQL as a Web service" in "IBM Web Administration for i" to insert JSON input parameters into a table on the i.

    It is identical to this example from:

    https://developer.ibm.com/tutorials/creating-rest-apis-based-on-sql-statements/

    INSERT INTO STUDENTDB
    ("studentID", "firstName", "lastName", "gender")
    VALUES(?,?,?,?)

    How can I modify the API to accept a JSON array to insert multiple input rows from a JSON array into the IBM i table?

    JSON Input Example:

    [
        {
            "studentID": "A1234567",
            "firstName": "John",
            "lastName": "Deere",
            "gender": "male"
        },
        {
            "studentID": "B9876543",
            "firstName": "Jane",
            "lastName": "Doe",
            "gender": "female"
        }
    ]



    ------------------------------
    Rodney Gaylor
    ------------------------------


  • 2.  RE: IBM Web Administration for i

    Posted Mon April 24, 2023 08:08 AM

    You might have better luck in the IBM i Global Community at:  https://community.ibm.com/community/user/power/communities/community-home/digestviewer?communitykey=f0246bc4-08f3-43c5-a7f8-b6a64d387894



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 3.  RE: IBM Web Administration for i

    Posted Mon April 24, 2023 09:36 AM

    Thanks, Robert Berendt!

    My first post in the Community... I thought I had posted in IBM i Global. I'll figure this out and post it over there.



    ------------------------------
    Rodney Gaylor
    ------------------------------