Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2011
    Posts
    3

    Unanswered: import data from csv file in db2 table

    I m novice to db2.

    Import from 'c:\temp\devtest.del' of del insert into devtestone(col1,col2)

    gives the error as:

    15:13:51 [IMPORT - 0 row(s), 0.000 secs] [Error Code: -104, SQL State: 42601] DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=Import from 'c:\temp\devtest.del' of del;BEGIN-OF-STATEMENT;<space>, DRIVER=3.57.82
    ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]


    Please advice,
    Thanks,

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What DB2 version and OS are you using? How are you trying to execute the import statement?

    Andy

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    publish some rows of data from the infile
    and the layout of the table
    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

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    IMPORT is not an SQL statement; it is a CLP command and must be run from the CLP. If you insist on using the SQL interface, consider ADMIN_CMD(): IMPORT using ADMIN_CMD - IBM DB2 9.7 for Linux, UNIX, and Windows

  5. #5
    Join Date
    Dec 2011
    Posts
    3
    thank you for the response.

    Now I m executing:
    CALL SYSPROC.ADMIN_CMD ('Import from c:/temp/devtest.del of del insert into devtestone(col1,col2)')

    I get error as:

    15:07:49 [CALL - 0 row(s), 0.000 secs] [Error Code: -3030, SQL State: ] DB2 SQL Error: SQLCODE=-3030, SQLSTATE= , SQLERRMC=sqlofopn -2029060079, DRIVER=3.57.82
    ... 1 statement(s) executed, 0 row(s) affected, exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors]


    I m using db2 9.7
    and table lay out is

    col1 (decimal) col2(VARCHAR)
    ========== ===
    1 testone
    2 testtwo

  6. #6
    Join Date
    Dec 2011
    Posts
    27
    i tried this in an another method by using "ADOX.Catalog" object .. i got he result

Posting Permissions

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