1. Rolleiv Sve
  2. SnapDevelop
  3. Tuesday, 16 January 2024 11:55 AM UTC

Hello!

I have developed a REST API using SnapDevelop and I'm looking to add an update function to a table that includes a blob column. Is this feasible in SnapDevelop 2022, or should I explore alternative solutions? The intent is to upload images taken with an iPhone app into the blob column in SQL Anywhere.

Best regards, Rolleiv Sve IT Manager Norsk Sjømat AS rs@norsksjomat.no

Francisco Martinez @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 16 January 2024 15:27 PM UTC
  2. SnapDevelop
  3. # 1

Hi Rolleiv,

If what you want is to to add an update function to a table that includes a blob column, then whether you use SnapDevelop or not, is irrelevant. What matters is the framework you're using for the REST API allows you to do so (which it most likely does) and whether or not you know how to do this. SnapDevelop is just the IDE.

Regards,
Francisco

Comment
There are no comments made yet.
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 17 January 2024 02:17 AM UTC
  2. SnapDevelop
  3. # 2

Hi Rolleiv, 

You can try SqlExecutor.ExecuteAsync to execute a SQL UPDATE statement to update byte[] to the database table.

E.g.:

        public async Task<int> UpdateProductPhotoAsync(int productPhotoId, byte[] photo)
        {
            string sql = "UPDATE Production.ProductPhoto SET LargePhoto = :phote WHERE ProductPhotoID = :productPhotoId";
            
            return await _context.SqlExecutor.ExecuteAsync(sql, photo, productPhotoId);
        }

Regards,

Logan

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.