Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2008
    Posts
    25

    Unanswered: db2 load client from....

    Hi!
    I'm trying to use the command
    Code:
    db2 load client from D:/Uni/Diplomarbeit/workspace/dbi-root/scriptsDB2/Createa-dbX.sql of sql 
          insert into test.a
    So, i try to load the file Createa-dbX.sql from the client to the db2 relation test.a.

    I'm connected with the programm DBVisualizer, and tried there the sql-query.

    But it doesn't work, and i get the error message:
    Code:
     [Error Code: -219, SQL State: 42704]  DB2 SQL error: SQLCODE: -219, SQLSTATE: 42704, SQLERRMC: LANGWIED.EXPLAIN_INSTANCE

    I'm a real newbie in DB2; perhaps my command is wrong. I really don't know...

    Hope, someone has some idea!

    Martin

  2. #2
    Join Date
    Jun 2006
    Posts
    471
    the load command should be used to load data and not execute sql
    of sql... is not a valid type either it should be ixf, del, asc, cursor
    command window can be sued to execute sql
    db2 -tvf infilename
    sql -219 means the explain tables are not created
    see online info center for detailed message
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  3. #3
    Join Date
    Feb 2008
    Posts
    25
    Hi!
    I think the ending sql of the file was missleading. At the end, there are just INSERT-Commands stored, e.g.:
    Code:
    INSERT INTO test.a VALUES (408, 108, 50, 750, '957');
    INSERT INTO test.a VALUES (720, 96, 30, 250, '66');
    INSERT INTO test.a VALUES (768, 60, 60, 500, '726');
    (these insert commands do work, if i try them manually).

    Changing the file types of the load command from sql to asc, del, ixf doesn't work either.

    I also tried to change the "/" in the classpath to "\", but i still get an error message..

    SQL-Command:
    Code:
    db2 load client from D:/Uni/Diplomarbeit/workspace/dbi-root/scriptsDB2/Createa-dbX.txt of asc 
          insert into test.a
    Error-MEssage:
    Code:
     [Error Code: -104, SQL State: 42601]  DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: db2 load client from D:/;BEGIN-OF-STATEMENT;<values>
    Regards,
    Martin

  4. #4
    Join Date
    Jun 2006
    Posts
    471
    if windows why don't you use d:\xx\
    what is the format of the input file, just changing the command at random is not what you want, it should be accordingly the input data
    use del if delimited file ixf if ixf format
    see info center for all details..
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  5. #5
    Join Date
    Feb 2008
    Posts
    25
    Okay, i changed the slashes to backslashes;

    To the input file. It is an ordinary textfile with some INSERT-Statements, as described in my last message:
    Code:
    INSERT INTO test.a VALUES (408, 108, 50, 750, '957');
    INSERT INTO test.a VALUES (720, 96, 30, 250, '66');
    INSERT INTO test.a VALUES (768, 60, 60, 500, '726');
    Now, i get a new error messae:
    Code:
     [Error Code: -7, SQL State: 42601]  DB2 SQL error: SQLCODE: -7, SQLSTATE: 42601, SQLERRMC: \;load client from D:

    Regards,
    Martin

  6. #6
    Join Date
    Jun 2006
    Posts
    471
    this is an sql file, no need for the load command
    just execute it with db2 -tvf filename
    this is all
    Best Regards, Guy Przytula
    DB2 UDB LUW certified V6/7/8

  7. #7
    Join Date
    Feb 2008
    Posts
    25
    Thanks a lot for the help!
    I got it working!

    Martin

Posting Permissions

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