Skip to main content

#Vars.in_ob_event_obj0 人がディスカッション中

We have a requirement to call an oracle stored procedure which has two UDT parameters one IN and one OUT. We are doing this in mule 4. I am able to set the Custom Type and pass the UDT parameters to the stored procedure and get the out parameter. But The output Json only has the values, not the column names mapped to it? How do I get the column names also in the payload?

 

Here is the output I am getting I need the column names also

 

{

    "p_return_message_o": null,

    "p_eem_shipind_docs_o": [

        "DOCTESTTIME",

        "TEST",

        "TESTINV",

        null,

        12345,

        "TEST",

        "TESTIRN",

        "USD",

        [ ],

        [ ],

    "p_return_code_o": "SUCCESS"

}

 

Here is my xml

 

<db:config name="dbConfig" doc:name="Database Config" doc:id="8a74e699-6893-45a8-8ef9-9edb24927cb4" >

<db:oracle-connection host="scan-nprd-2023" port="1541" user="apps" password="P0t3ntial" serviceName="DV1CSF_SRVC_OTH.cisco.com" >

<db:column-types >

<db:column-type id="2002" typeName="XXCTS_EEM_OUTBOUND_EVENT_OBJ" />

<db:column-type id="2002" typeName="XXCTS_EEM_SHIPPIND_DOC_OBJ" />

<db:column-type id="2003" typeName="XXCTS_EEM_SHIPIND_DOC_LINE_TAB" />

<db:column-type id="2003" typeName="XXCTS_EEM_SHIPINDOC_ADDR_TAB" />

</db:column-types>

</db:oracle-connection>

</db:config>

<flow name="SharedDBFlow" doc:id="61315463-e2d4-45af-a15b-d3c873885ddb" >

<ee:transform doc:name="Transform Message" doc:id="274ce134-2c91-4321-8bd4-0f321dbe2c47" >

<ee:message >

<ee:set-payload ><![CDATA[%dw 2.0

output application/java

---

[

 payload.Transaction.auditReferenceId,payload.Transaction.locationCode,payload.Transaction.transactionType,

 payload.Transaction.transactionSubType,

 payload.Transaction.conversationId,

 payload.Transaction.canonicalTransactionType,

 payload.Transaction.muleTransactionId,

 payload.Transaction.attribute1,

 payload.Transaction.attribute2,

 payload.Transaction.attribute3,

 payload.Transaction.attribute4,

 payload.Transaction.attribute5,

 payload.Transaction.attribute6,

 payload.Transaction.attribute7,

 payload.Transaction.attribute8,

 payload.Transaction.attribute9,

 payload.Transaction.attribute10,

]

]]></ee:set-payload>

</ee:message>

</ee:transform>

<logger level="INFO" doc:name="Logger" doc:id="92ce9028-798e-41e8-b8cf-085fcb501215" message="#payload"/>

<ee:transform doc:name="Transform Message" doc:id="b9f3ada5-7259-4c9b-94e2-2270c0e13dbf" >

<ee:message >

</ee:message>

<ee:variables >

<ee:set-variable variableName="in_ob_event_obj" ><![CDATA[%dw 2.0

output application/java

---

Db::createStruct("dbConfig","XXCTS_EEM_OUTBOUND_EVENT_OBJ",payload)]]></ee:set-variable>

</ee:variables>

</ee:transform>

<logger level="INFO" doc:name="Logger" doc:id="8a229fd3-f9d8-466d-bf14-74c7b599f135" message="#vars.in_ob_event_obj"/>

<db:stored-procedure doc:name="Stored procedure" doc:id="7fe3f61b-74a6-4503-a59e-cdc643c79229" config-ref="dbConfig">

<db:sql ><![CDATA[{ call xxtest_shipind_docs(:p_outb_event_rec_i,:p_eem_shipind_docs_o,:p_return_code_o,:p_return_message_o) }]]></db:sql>

<db:input-parameters ><![CDATA[#[{ 

p_outb_event_rec_i: vars.in_ob_event_obj

 

}]]]></db:input-parameters>

<db:output-parameters >

<db:output-parameter key="p_return_code_o" type="VARCHAR" />

<db:output-parameter key="p_return_message_o" type="VARCHAR" />

<db:output-parameter key="p_eem_shipind_docs_o" customType="XXCTS_EEM_SHIPPIND_DOC_OBJ" />

</db:output-parameters>

</db:stored-procedure>

<logger level="INFO" doc:name="Logger" doc:id="7d22fdef-1f5f-40f4-9953-b001a1ac40c8" message="#message"/>

<ee:transform doc:name="Transform Message" doc:id="0feed9a7-7e8c-4a4c-ae22-2437d110d0fe" >

<ee:message >

<ee:set-payload ><![CDATA[%dw 2.0

output application/json

---

payload]]></ee:set-payload>

</ee:message>

</ee:transform>

<logger level="INFO" doc:name="Logger" doc:id="a9c7071a-d00c-4c20-ac83-242ec3e20945" message="#payload"/>

</flow>

0/9000