Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2008
    Posts
    8

    Unanswered: The character "\" is not valid

    hi

    I am in trouble with export to command.
    using db2 v8.1

    its working fine in controlCenter->commandEditor

    query is:

    EXPORT TO F:\exportDB2\CFG_CADCONTEXT.ixf OF IXF MESSAGES log SELECT * FROM ADMIN.CFG_CADCONTEXT;

    but when i execute in my java program , exception is:
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0007N The character "\" following "EXPORT TO F:" is not valid. SQLSTATE=42601

    java code is:

    String FOLDER="F:\\exportDB2\\";
    String SCHEMA="ADMIN";
    String tname="CFG_CADCONTEXT";
    String query = "EXPORT TO "+FOLDER+""+tname+".ixf OF IXF MESSAGES log " +
    "SELECT * FROM "+SCHEMA+"."+tname+"";

    st.execute(query);

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    EXPORT is a DB2 command and not a SQL statement. Hence, you cannot execute it via Statement.execute. Have a look at the ADMIN_CMD procedure instead.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Jan 2008
    Posts
    8
    Thankyou very much...
    got the rightway..

Posting Permissions

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