Trying to upload image via UniStoredProcedure
Posted: Thu 05 Sep 2013 15:40
I have a table in a PostgreSQL database with a few OID fields. Each OID hold (or can hold) a .png file. The problem I'm having is that I try to upload a new image file using a stored procedure. Or just a UniDac table component for that matter, I get the same error.
Here's a bit of code:
Here's a bit of code:
I've also tried LoadFromFile and AsBlob. The problem is as spPostImage.Execute runs, I get an Access violation at 0000000. I have started a transaction using the connection UniConnection.spPostImage.Prepare;
spPostImage.ParamByName( 'p_object_id' ).AsString := qryImagesobject_id.AsString;
spPostImage.ParamByName( 'p_name' ).AsString := qryImagesname.AsString;
spPostImage.ParamByName( 'p_image' ).LoadFromStream( strImage, ftBlob );
spPostImage.Execute;