If the file exists on the same computer that is running the SQL Anywhere 12 engine, then see xp_read_file system procedure.
If the file exists on a different computer (say, on a client computer that is connected over the network to dbsrv12.exe running on a server computer) then see READ_CLIENT_FILE function.
answered 24 Jul '14, 07:32
If I understand your situation correctly, you have already a list of image file pathes in the according table but want to store the actual images there, too. So you will need to use xp_write_file() to read the file contents. (Note: That would require the database engine can access these files, i.e. they are not stored on a client computer.)
Here's a good starting point from the docs:
To go on further, you might use a cursor to loop over each row from the table and access the according file and insert its data via an UPDATE statement. There are also ways to do to this in one UPDATE statement, such as
However, that may be a heavy burden in case you have lots of images to store, so a one-by-one approach might be easier.
answered 24 Jul '14, 04:05