on 2013 Nov 22 4:00 AM
Hi,
I am using SQL Anywhere 16 and connecting to the same using jconn4.jar which is pure jdbc. I am exporting data using follow command
UNLOAD SELECT * FROM TABLE_NAME TO 'D:\\sales.csv'
And want to import in same table of other schema. Using following query
INPUT INTO TABLE_NAME FROM 'D:\\sales.csv' while I am executing the above query using java(jdbc) its giving following error Cause: java.sql.SQLException: SQL Anywhere Error -131: Syntax error near 'INPUT' on line 1
So can you please suggest solution so that i can import the same file using java rather than parsing/ reading csv file and then insering data row by row And same query is working fine on ineractive sql.
Request clarification before answering.
To import data exported with the UNLOAD command you might want to use the LOAD TABLE statement. INPUT, like OUTPUT, is only available within Interactive SQL (aka ISQL).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Reimer,
But When I tried to load the same data using
LOAD TABLE TABLE_NAME FROM 'D:\\sales.csv';
This use to execute for unlimited time and finally I have to stopped it, So its also not working for me.
So can you please suggest the solution for the same or how can i load the imported data using LOAD(mean exact query may be what am I doing is not correct.)
unload is supported in the jConnect driver. The error should be the statement itself. Please use : UNLOAD SELECT * FROM TABLE_NAME TO 'D:\\\\sales.csv' or UNLOAD SELECT * FROM TABLE_NAME TO 'D:/sales.csv'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem is with INPUT which is not a SQL statement... it is a command only recognized by the client application ISQL.
Thanks. Unload and Load should work. But not INPUT and OUTPUT.
User | Count |
---|---|
87 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.