Im trying to load a file into a table calling a Stored Procedure from a Java application, but when I try to load the file it throws this error: SQL Anywhere Error -1006140: I/O Error on file C:I26-03-2012.CSV -- (hos_clientfileio.cxx 137) , sqlstate = QBB40 My code to connect: DriverManager.registerDriver( (Driver) Class.forName("com.sybase.jdbc4.jdbc.SybDataSource").newInstance()); Connection con = DriverManager.getConnection( "jdbc:sybase:Tds:111.1.1.111:1141?ServiceName=Name", "user", "password"); Stored Procedure Load: execute immediate WITH RESULT SET ON 'load into table #Carga( Field1 ' || '''' || ',' || '''' || ',' || 'Field2 ' || '''' || ',' || '''' || ',' || 'Field3 ' || '''' || ',' || '''' || ',' || 'Field4 ' || '''' || ',' || '''' || ',' || 'Field5 ' || '''' || ',' || '''' || ',' || 'Field6 ' || '''' || ',' || '''' || ',' || 'Field7 ' || '''' || '' || 'n' || '''' || ')' || 'using client file ' || '''' || @File || '''' || ' quotes off escapes off with checkpoint on; where @File is the location of the file in the user's machine. |
Although this forum is not for IQ, I know that there was a recent fix that may address the issue you are encountering. See http://search.sybase.com/kbx/changerequests?bug_id=706184 Actually, the description is slightly incorrect. Any operation that is cancelled (explicitly or due to an abnormal disconnect) could cause a future operation such as LOAD TABLE USING CLIENT FILE to fail. -john. Actualy there's no cancel or diconect, it only happens when I call the process from Java, when I call the process on Interactive SQL Java it works fine.
(11 Jun '12, 16:42)
Angel Zero
Replies hidden
I'm not actually sure if jConnect would support client side file access. jConnect is a Sybase ASE product and the client side file access is an ASA feature. It's probably not supported over TDS. You might get it working with the SQLAnywhere JDBC driver but I'm not absolutely certain of that either.
(11 Jun '12, 19:59)
John Smirnios
I'm certain that jConnect does not support client side file access since AFAIK TDS does not have the necessary protocol to support it.
(12 Jun '12, 08:55)
Mark Culp
Yes, after some investigation I reach the same conclusion. Where can I find the SQL Anywhere driver?
(12 Jun '12, 11:45)
Angel Zero
|
Please tell us exactly what you are executing? e.g. What SQL are you executing? What version & build number are you using?
Im using Sybase IQ ver. 15 with jconn4