Hi
I'm using JServer and JSQL connectionpool to connect to and execute stored procedures.
This has been working well so far, however up until now I've just been passing strings or integers as parameters to the stored procedures.
I now need to store a photo in my SQL Server database and would like to pass the photo blob / binaryarray to the stored procedure which will also handle the insertion of the record with the photo file contents in a record in the database.
As per the this is what we would typically call, however the 3rd parameter i nthe AddInputParameter call seems to take strings only and therefore doesn't like our bmpBtyeArray.
Do you know how we can pass a byte array to a stored proc?
I'm using JServer and JSQL connectionpool to connect to and execute stored procedures.
This has been working well so far, however up until now I've just been passing strings or integers as parameters to the stored procedures.
I now need to store a photo in my SQL Server database and would like to pass the photo blob / binaryarray to the stored procedure which will also handle the insertion of the record with the photo file contents in a record in the database.
B4X:
If sql.IsInitialized Then
Dim storedproc As CallProc
storedproc.ProcedureCall = "exec mobileApp_UploadIncidentPhoto ?, ?, ?, ?"
storedproc.AddInputParameter(1, storedproc.SQLBIGINT, Params.Get("incidentid") )
storedproc.AddInputParameter(2, storedproc.SQLNCHAR, Params.Get("filename") )
storedproc.AddInputParameter(3, storedproc.SQLBIGINT, Params.Get("index") )
storedproc.AddInputParameter(4, storedproc.SQLBINARY, bmpByteArray )
storedproc.ExecProcedure(sql)
End If
As per the this is what we would typically call, however the 3rd parameter i nthe AddInputParameter call seems to take strings only and therefore doesn't like our bmpBtyeArray.
Do you know how we can pass a byte array to a stored proc?