Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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.

asked 11 Jun '12, 15:23

Angel%20Zero's gravatar image

Angel Zero
15225
accept rate: 0%

edited 11 Jun '12, 15:52

Please tell us exactly what you are executing? e.g. What SQL are you executing? What version & build number are you using?

(11 Jun '12, 15:26) Mark Culp

Im using Sybase IQ ver. 15 with jconn4

(11 Jun '12, 15:28) Angel Zero

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.

permanent link

answered 11 Jun '12, 16:05

John%20Smirnios's gravatar image

John Smirnios
12.0k396166
accept rate: 37%

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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×86
×78
×41
×39

question asked: 11 Jun '12, 15:23

question was seen: 6,044 times

last updated: 12 Jun '12, 11:45