Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2009
    Posts
    1

    Thumbs up Unanswered: SP for importing a flat file

    Hi,

    I am new to db2. Can anyone help me out to create a stored procedure to import a csv file to existing database.

    I used this command and its working fine.

    import from 'C:\test1.csv' of del
    insert into det1 (name,age,salary)

    Now i need to write a sp for this. How to do this??

    I appreciate you kind help.

    thanks,
    Manoj

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    have a look at the documentation for ADMIN_CMD command for your version of the database. If IMPORT is supported, you can call this procedure from your SP to do the import. HTH
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    i think it picks 'C:\test1.csv' from the server path even if you are calling the admin_cmd from client
    Rahul Singh
    Certified DB2 9 DBA / Application Developer

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    yes!!!! All Stored Procs runs on the server

    Quote Originally Posted by rahul_s80
    i think it picks 'C:\test1.csv' from the server path even if you are calling the admin_cmd from client
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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