Hello, I have an issue with a mobile app, the database is MySQL 5.7, when I try to upload a photo from the smartphone doing an updateblob I got this error:
Error code: 10999 Object reference not set to an instance of an object.
The database field is a longblob type, the size of the blob file is aprox. 167kb, the AEM Datasource is MySQL Native Driver, the transaction is Autocommit = true.
Here is the code:
eon_mobile_str_cameraoption lstr_option
eon_mobile_cameraex ln_camera
String ls_filepath
Integer li_return
blob lb_data
lstr_option.i_filetype = 1 // Takes the photo
lstr_option.b_allowedit = true // The photo is editable after picture-taking
ln_camera = create eon_mobile_cameraex
li_return = ln_camera.of_takefile (lstr_option, ls_filepath, lb_data)
if li_return <= 0 then return
long v_id_activity, v_row, v_ret
vi_currlocation = uo_google.of_getcurrentlocation( )
if ds_activities_max.retrieve() <= 0 then
v_id_activity = 1
Else
v_id_activity = ds_activities_max.getitemnumber(1,"max_activity")
if v_id_activity = 0 then
v_id_activity = 1
End if
End if
ds_activities.reset()
v_row = ds_activities.insertrow(0)
ds_activities.setitem(v_row,"id_company",vg_id_company)
ds_activities.setitem(v_row,"id_activity",v_id_activity)
ds_activities.setitem(v_row,"date_activity",datetime(today(),now()))
ds_activities.setitem(v_row,"type_activity",1)
ds_activities.setitem(v_row,"id_sales_rep",vg_id_sales_rep)
ds_activities.setitem(v_row,"id_cust",vi_id_cust)
ds_activities.setitem(v_row,"gps_latitude",vi_currlocation.latitude1)
ds_activities.setitem(v_row,"gps_longitude",vi_currlocation.longitude1)
v_ret = ds_activities.update()
if v_ret = -1 then
rollback;
ds_activities.of_errmsg()
return
Else
commit;
End if
updateblob VISITS
set photo = :lb_data
Where id_company = :vg_id_company
and id_activity = :v_id_activity using db_blob;
if db_blob.sqlcode = -1 then
gf_errmsg(db_blob,true)
Else
commit;
End if
Thanks in advance for your help.
Arturo Quiroga