Returning parameter error - character string buffer too small

I'm trying to get a large string parameter back to my C++ Builder program. As soon as the length of returning string goes over 4103 bytes, I'm getting an EOracleError with message 'ORA-06502: PL/SQL:numeric or value error:character string buffer too small'

The code fragment is below. I started with "" place holders in the OPENARRY macro. Tried switching to AnsiString and then tried setting the length to 10000 but still hitting the Oracle error on the returning parameter.

AnsiString MessageOut, EmailFrom, EmailReply, Subject, BodyText;
BodyText.SetLength(10000);
result = MainDM->CustomerEmailPkg->CallIntegerFunction("email_text"
, OPENARRAY(Variant, (MainDM->CustomerEmailSetCUSTOMER_EMAIL_KID->Value
, MessageOut, EmailFrom, EmailReply, Subject, BodyText
) )
);
 
You cannot pass long strings (> 4000 bytes) to TOraclePackage.CallIntegerFunction. You will have to use a TOracleQuery with the corresponding call, and define a variable of type otPLSQLString, which can be up to 32KB.
 
Back
Top