0 Replies Latest reply: Mar 26, 2012 2:29 PM by 925997 RSS

    External procedure call. PARAMETER MAXLEN doubt

    925997
      Hi, I have the following external function definition:

      CREATE OR REPLACE FUNCTION myfunc (
      tohash IN STRING,
      hashres IN OUT STRING)
      RETURN BINARY_INTEGER AS LANGUAGE C
      LIBRARY myfunc_lib
      NAME "myfunc"
      PARAMETERS (
      strin,
      strinINDICATOR,
      strout,
      strout MAXLEN,
      strout INDICATOR,
      RETURN);

      C prototype: int myfunc(char strin, short strin_ind, char strout, int strout_maxlen, short strout_ind)

      When I call it, the strout_maxlen take the pl/sql variable size value ( v_out CHAR(64) --> strout_maxlen == 64 ). The internal mechanism of call a external function take care of pass a 65 bytes buffer (to store the '\0') or if I know that I'll write 64 characters I must declare the pl/sql variable as CHAR(65)

      Thanks!

      Best regards

      Edited by: user1488139 on 26/03/2012 12:29