If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > The character "\" is not valid

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-08, 02:16
david_david david_david is offline
Registered User
 
Join Date: Jan 2008
Posts: 8
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);
Reply With Quote
  #2 (permalink)  
Old 02-06-08, 04:18
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #3 (permalink)  
Old 02-06-08, 04:58
david_david david_david is offline
Registered User
 
Join Date: Jan 2008
Posts: 8
Thankyou very much...
got the rightway..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On