IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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

SP Struct Input

  • 1.  SP Struct Input

    Posted Tue April 05, 2016 08:59 PM

    Hello All,

    I have a SP that receives a struct input. Which data I have to pass? I changed struct data type to object, but how can I transform my string or document to acceptable input?

    Thanks!


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 2.  RE: SP Struct Input

    Posted Tue April 05, 2016 09:41 PM

    what is the webMethods, database version Ur using?


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: SP Struct Input

    Posted Tue April 05, 2016 10:39 PM

    Hello Venkata, thanks for helping.

    webMethods: 9.8
    Oracle 9

    Thanks!


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 4.  RE: SP Struct Input

    Posted Tue April 05, 2016 10:43 PM

    Did you try using StoredProcedureWithSignature Adapter service in JDBC Adapter


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: SP Struct Input

    Posted Tue April 05, 2016 10:48 PM

    Yes, i’m using this one. So I putted in my flow service, but I need to know which parameter in pipeline I have to link with my SP input. I know that it’s an object, but how can I transform a string to a valid input?


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 6.  RE: SP Struct Input

    Posted Tue April 05, 2016 10:55 PM

    I think U have to define output field type as java.sql.Struct

    In JDBC Adapter 9.0,

    Support for ARRAY and STRUCT Data Types with Oracle Databases

    The adapter now supports the ARRAY and STRUCT data type objects as input and output parameters in adapter services. In earlier versions of the adapter there was no way to insert or retrieve a record or list as an input or output to an adapter service. To provide this capability, the adapter now supports the java.sql.STRUCT and java.sql.ARRAY data types as input and output parameters for adapter services.

    Important Considerations When Using the Array and Struct Database
    Specific Data Types
    ï?® In an adapter service, when using the java.lang.Object as the output field type for a
    database column of type array or struct, Adapter for JDBC returns the data as a
    java.lang.Object array, provided that the array or struct data in the database table is
    composed of primitive data types.
    ï?® When using the java.sql.Array or java.sql.Struct as the output field type for a database
    column of type array or struct, Adapter for JDBC returns the java.sql.Array and the
    java.sql.Struct objects, respectively, as returned by the driver. However, when
    serializing the data across the JVMs, this returned data may not be serializable and
    may result into a java.io.NotSerializableException. Therefore, before serializing the
    data across the JVMs, it is important that you use a Java or a flow service to process
    the java.sql.Struct and java.sql.Array objects as required, and then drop them from
    the pipeline.


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 7.  RE: SP Struct Input

    Posted Tue April 05, 2016 11:02 PM

    But it isn’t possible to change a string to a object(sql.struct) in pipeline and than link to my input SP (struct) isn’t it?

    PS: The parameter (Struct) it’s SP input.


    #Integration-Server-and-ESB
    #Adapters-and-E-Standards
    #webMethods


  • 8.  RE: SP Struct Input

    Posted Tue April 05, 2016 11:21 PM

    U probably need to write java code to convert from String or Document(IData) to java.sql.Struct java type before passing to the stored procedure.


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: SP Struct Input

    Posted Wed April 06, 2016 12:51 AM

    Another way suggested in empower is,

    Create a dynamic sql service with SELECT query on some temporary table, that return “java.sql.Struct” object with values you pass in.

    pass that output to the StoredProcedureWithSignature service as input


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 10.  RE: SP Struct Input

    Posted Wed April 06, 2016 09:13 AM

    Hi Luis,

    which version of JDBC Adapter are you using? 6.5 or 9.0?

    Which version of the driver?

    Are there any Fixes applied to the JDBC Adapter?

    Additionally you should consider upgrading your database to 11g or 12c as Oracle 9i is quite old and already in EOL-State.

    Regards,
    Holger


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 11.  RE: SP Struct Input

    Posted Wed April 06, 2016 10:41 AM

    Hello Holger von Thomsen,

    JDBC adapter version: 9.0

    Thanks


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: SP Struct Input

    Posted Wed April 06, 2016 01:30 PM

    Hi Luis,

    make sure you have the latest ojdbc7.jar from Oracle 12.1.0.2 placed under WmJDBCAdapter/code/jars.
    Reload Adapter package afterwards.

    Please check if applying latest JDBC-Adapter Fix (currently Fix8) will help here.

    Regards,
    Holger


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods


  • 13.  RE: SP Struct Input

    Posted Wed April 06, 2016 09:32 PM

    HI Luis,

    Any luck with what I and Holger suggested?

    Thanks,
    Venkata


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 14.  RE: SP Struct Input

    Posted Wed April 06, 2016 10:59 PM

    Please find the sample in the empower Knowledge article, search in empower knowledge base with “1744339”

    JDB 6.5 - 1744339 : webMethods JDBC Adapter - Utilize Java.sql.Array as input from Oracle Stored Procedure.


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 15.  RE: SP Struct Input

    Posted Mon April 18, 2016 11:51 AM

    Hello Venkata, sorry for the reply time.

    I don’t have access to empower, so I can’t find this documentation.

    I’m still having problems to call this procedure with struct input.

    Thanks!


    #webMethods
    #Integration-Server-and-ESB
    #Adapters-and-E-Standards


  • 16.  RE: SP Struct Input

    Posted Mon April 18, 2016 04:35 PM

    Please share what sort of errors you are facing with screen shots if possible

    Thanks,


    #Integration-Server-and-ESB
    #webMethods
    #Adapters-and-E-Standards


  • 17.  RE: SP Struct Input

    Posted Mon April 18, 2016 05:21 PM

    Sure.

    I have this SP that i’m calling using storedProcedureWithSignature. (print1.png)

    On my flow service, I have a string “tese” that contains my XML. (print2.png)

    Calling the adapter on next step, I mapped this string to adapter input. (print3.png)
    PS: I tried using object type.

    And now I’m getting this error:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to ‘P_INS_AVISO_SINISTRO’

    But the number of arguments are right and I’m using storedProcedureWithSignature!

    Using java.sql.struct on P_REC_AVISO (SP input) it didn’t work too.




    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 18.  RE: SP Struct Input

    Posted Mon April 18, 2016 05:47 PM

    Can you please change Struct with Nvarchar and give a try. Please update me on the same.

    Thanks,


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 19.  RE: SP Struct Input

    Posted Mon April 18, 2016 06:03 PM

    MR as173d,

    Still the same error!

    Thanks.


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 20.  RE: SP Struct Input

    Posted Tue April 19, 2016 02:08 PM

    My bad, did you try SQL ( STRUCT ) → JDBC/ Java ( java.sql.Struct ) ? If not, can you please

    Thanks,


    #Adapters-and-E-Standards
    #webMethods
    #Integration-Server-and-ESB


  • 21.  RE: SP Struct Input

    Posted Tue April 19, 2016 03:48 PM

    Yeah, I tried and didn’t work.

    I’ve changed SP input to CLOB and JDBC adapter to CLOB (string) and worked.

    Thank you very much!!!


    #webMethods
    #Adapters-and-E-Standards
    #Integration-Server-and-ESB


  • 22.  RE: SP Struct Input

    Posted Tue April 19, 2016 04:02 PM

    Glad to hear, thanks for your update.

    Thanks,


    #Adapters-and-E-Standards
    #Integration-Server-and-ESB
    #webMethods