Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007
    Posts
    56

    Unanswered: text File into db table

    Hello All,

    Well the Heading looks like it says it all, What I would like to know is How to read/transfer coma separated data from a text file into an existing table in db2 database.Also using a command in the dos window will do.

    Thanks All

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    this page has it all
    IMPORT
    db2 import from xx.yy of del insert into schema.table(cols)
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Sep 2007
    Posts
    56
    Thanks prytula_guy

    but me also what to know how to write in a txt file, i.e I would like to create a log file, while executing the procedure so after running some part of code in the procedure i need to write out some information on to the log file, please let me know about this i had a look with export, do you think by creating a temp table and inserting the process in this table and at the end of the procedure, use this export command to export all records to a text file,

    if possible also provide me with some links to where i can find more information about this.

    :-)

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    from import you can not write to a log file, only the import messages can be saved to a message file. if custom messages are needed, try using a stored proc and write message to a file as described here
    Yet Another Article on Advanced Scripting
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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