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.

When I run a an insert statement with a large "contents" value I get an error "Could not execute statement. Server 'DirectoryServer': No such file or directory SQLCODE=-660, ODBC 3 State="HY000"

Anybody know why I'm erroring out? This happens when "contents" value is over 3000.

asked 11 Sep '12, 19:01

Sunovavic's gravatar image

accept rate: 0%

Please provide more information: it sounds like you are using a directory access proxy table - what is the exact statement that you are trying to execute when you get the error?

(11 Sep '12, 20:39) Mark Culp
Replies hidden

Yes I am using a directory access proxy table.

Here's a shortened version of the statement since it won't let me post everything.

Insert into DBA.Attachments(Contents, File_Name)
    values (0X5768656E20492072756E206120616E20696E736<skipped>206572, 'test.txt')

(Update: data has been truncated to make the page readable.)

(12 Sep '12, 01:44) Sunovavic

Does it work when you assign the file contents to a LONG VARBINARY variable and then use that variable within the insert, such as:

  declare myBlob long varbinary;
  set myBlob = 0x5768656E20492072756E206120616E20696E736<skipped>206572;
  Insert into DBA.Attachments(Contents, File_Name)
    values (myBlob, 'test.txt');
permanent link

answered 12 Sep '12, 10:43

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

Yes that works. Thank you! Do you know why it has to be assigned to a variable for it to work?

(12 Sep '12, 11:12) Sunovavic
Replies hidden

No, that was just wild guessing - similar to that proxy table question... but Mark will know:)

(12 Sep '12, 11:20) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 11 Sep '12, 19:01

question was seen: 1,902 times

last updated: 12 Sep '12, 11:20