Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2005
    Posts
    10

    Question Unanswered: read text file with db2 stored procedure

    Hello!
    I want to know if itīs possible to read a text file using a db2 stored procedure?

    I konw how to make it using Oracle with the commands:
    vr_file := utl_file.fopen('e:\ftp_home\utl_dados', vr_arquivo, 'W'); -> open file
    utl_file.get_line(vr_file, vr_linha); -> read line
    utl_file.put_line(vr_file, vr_linha); -> insert line
    utl_file.fflush(vr_file2); -> "commit" line
    utl_file.fclose(vr_file); -> close file

    Is there anyone who know how I can make it?
    Thanks!

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by tessyabs
    I want to know if itīs possible to read a text file using a db2 stored procedure?
    yes
    Quote Originally Posted by tessyabs
    how I can make it?
    Use Java or C to create a stored procedure

  3. #3
    Join Date
    Nov 2005
    Posts
    10

    Exclamation Sql Pl

    But I want to know a way to read a text file using SQL PL.
    Do you know if itīs possible?

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    No, there are no means in SQL to do that.

  5. #5
    Join Date
    Nov 2005
    Posts
    10

    java stored procedure

    Can you give me some example of a java stored procedure that read/write a text file?
    Thanks

  6. #6
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    There are some examples shipped with the DB2 Development Client; they're usually in sqllib/samples.

  7. #7
    Join Date
    Nov 2005
    Posts
    10

    send me the examples, please

    I didnīt find any example at this directory...
    Could you send me some examples?
    Do you mind to send it to tessyabs@hotmail.com?
    Or paste the examples here if you prefer... please!
    Thanks!!

  8. #8
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

Posting Permissions

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