#Call stored procedure that return CLOB as result

1 messages · Page 1 of 1 (latest)

flint roost
#

Hello everyone.

Hello everyone.

I created a client using the oracleDb module.

Then I want to execute a stored procedure that returns a clob.

The thing is that the execution result returns an error with the following message:

"ORA-22835: Buffer is too small for conversion from CLOB to CHAR or from BLOB to RAW (real: 12488, maximum: 4000)"

I verified that the stored procedure is returning the correct information by using another software to retrieve the data.

In Ballerina, I declared the procedure call as follows:


    string uuid = "value from function param"; 

    sql:ClobValue sqlFileContentA = new(rccA);              // <--- rccA = io:ReadableCharacterChannel
    sql:ClobValue sqlFileContentB = new(rccB);              // <--- rccB = io:ReadableCharacterChannel

    sql:ClobOutParameter returnedDbData = new();
    sql:IntegerOutParameter returnedDbProcessCode = new();
    sql:VarcharOutParameter returnedDbProcessMessage = new();

    sql:ProcedureCallResult result = check oracleClient->call(`CALL PKG_PROCESS.P_INIT_PROCESS(${uuid}, ${sqlFileContentA}, ${sqlFileContentB}, ${returnedDbData}, ${returnedDbProcessCode}, ${returnedDbProcessMessage})`);

From what I've investigated, the CLOB data type must be returned in a JDBC as a data stream, and looking at the module sources, I haven't found any method that does so.

Would it be possible for you to help me resolve this or give me an alternative or guide to this case?

twilit gorge
#

@flint roost I tried to reproduce with the stored procedure that return a CLOB type. but still didn't get the error. I will try further and get back to you.

flint roost
#

Hello @twilit gorge. Thanks to checking out my case. If you need additional data please let me know.

strong vapor
#

Hello everyone.
Im encountering the same issue with sql:ClobOutParameter being processed as a varchar with limit of 4000 symbols.

twilit gorge
#

Is it possible to share the sample stored procedure, which I can reproduce the issue please.

strong vapor
#

hello, sending sample stored procedure and example call from ballerina to reproduce the issue.

twilit gorge
#

Thanks @strong vapor. I will check and get back soon.

twilit gorge
twilit gorge
#

We released patch 1.17.1 for the SQL module on top of update 12, which includes a fix. Please check. We are still returning the CLOB value as a string. We will look into improving it so it returns as a stream.