Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96

    Unanswered: Oracle sys.DBMSOUTPUT_LINESARRAY

    Hello Sir/Madam,

    Does DB2 has similar collect function as Oracle sys.DBMSOUTPUT_LINEARRAY?

    For example, if I create a db2 function as below here, is there an alternative system function available in db2 : -

    CREATE OR REPLACE FUNCTION "test1" (value1 sys.DBMSOUTPUT_LINESARRAY, value2 VARCHAR2)
    returns VARCHAR2
    EXTERNAL NAME 'MD5Helper.generateHash(java.lang.Object, java.lang.String) return java.lang.String'
    PARAMETER STYLE java LANGUAGE java
    NO EXTERNAL ACTION;

    Thanks in advance!

  2. #2
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96
    Hello,

    I have try to look into this again and found an article to understand the issue.

    I have created a user defined type as dbmsoutput_linesarray as below here.

    CREATE OR REPLACE TYPE oraenv.dbmsoutput_linesarray IS
    VARRAY(2147483647) OF VARCHAR2(32672)#

    CREATE OR REPLACE FUNCTION "test1" (value1 oraenv.DBMSOUTPUT_LINESARRAY, value2 VARCHAR2)
    returns VARCHAR2
    EXTERNAL NAME 'MD5Helper.generateHash(java.lang.Object, java.lang.String) return java.lang.String'
    PARAMETER STYLE java LANGUAGE java
    NO EXTERNAL ACTION#

    When I try to compile the above function, a new error message show as below here

    The length, precision, or scale attribute for column, distinct type, structured type, array type, attribute of structured type, routine, cast target type, type mapping, or global variable "VARCHAR" is not valid.. SQLCODE=-604, SQLSTATE=42611, DRIVER=4.18.60


    Does anyone has any idea what is wrong here?

    Thanks in advance!

  3. #3
    Join Date
    Feb 2004
    Location
    earth
    Posts
    96
    It work in Oracle, but it doesnt work in DB2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •