0 Replies Latest reply on Jun 27, 2002 1:22 PM by 294306

    InParameters of type RAW are always right padded with blanks to a length of 128 bytes


      I'm trying to execute a stored procedure with CHAR and RAW IN-parameters using OO4O C++ class library version against a database.
      The parameters are used as placeholders for INSERT statements with raw and char fields of lengths smaller than 128 bytes.
      I tried to set MinimumSize(20) to restrict the passed length, but the parameters are always right padded with blanks to a length of 128 bytes.

      .. code snippet...

      // Parameter 5 is our 20 bytes hashkey
      // lpData is a fixed byte array of length 20
      // dwLen contains the value 20
      OParameter p=db.GetParameters().Add("5", (const char*)lpData, (int)dwLen, OPARAMETER_INVAR, OTYPE_RAW_BIN);
      db.GetParameters().Add("6", dlg.m_dtEntrance.Format(), OPARAMETER_INVAR, OTYPE_DATE);
      db.GetParameters().Add("7", 0, OPARAMETER_OUTVAR, OTYPE_NUMBER);

      if (db.ExecuteSQL("BEGIN :7:=MESCOMMON10.ADD_PERSONAL (:1,:2,:3,:4,:5,:6); END;")==OSUCCESS)

      When executing this section of code error ORA-1401 occures when calling the insert statement...
      After adding a few lines of debug code to the stored procedure I realized that the values of CHAR and RAW data types are always expanded to 128 bytes regardless of what is set using OParameter::MiniumumSize() or OParameter::Add()

      How could I prevent the automatic and unwanted expansion of parameters?
      Thanx in advance