1 Reply Latest reply on Dec 18, 2002 4:21 PM by 19045

    PL/SQL VARCHAR2 OUT Parameters limited to 127 Bytes?

    19045
      Hello,

      I just tried to call a stored procedure through OO4O in an MFC C++ App. This procedure takes an IN parameter of type NUMBER and an OUT parameter of type VARCHAR2.

      I created an OParameterCollection, added my 2 parameters, and executed the SQL Statement
      "begin SOME_PROC(:MY_NUMBER, :MY_OUTPUT); end;".
      Then I retrieved the value with the GetParameter() method of OParameterCollection into an OValue object, and type-casted it to a const char*, because this operator is overloaded by OValue.

      The strange thing is: Everything works fine, when the size of the returned varchar2 is smaller than 127 characters. If the varchar2 is bigger, I receive an empty object.

      Can anybody help me with this???

      Thanks in advance,
      Martin Zuckerstaetter
        • 1. Re: PL/SQL VARCHAR2 OUT Parameters limited to 127 Bytes?
          19045
          I just found out how it works, respectively why it did not work before. Still this seems VERY strange to me.

          The thing is, that where you add the parameters to the OParameterCollection, it seems you have to pass an adequately large value, even for an OUT parameter. I originally passed an empty string, because I thought this is not used afterwards anyway.

          However, resulting from an empty string, a return value of max. 127 characters was possible. When I passed an char[4000], I could also retrieve values of 4000 characters.

          As I said, it still seems strange to me!

          If anybody can give me more insight?

          Thanks,
          Martin Zuckerstaetter