1. Arturo Quiroga
  2. PowerServer Mobile (Obsolete)
  3. Tuesday, 14 July 2020 01:19 AM UTC

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

 

 

 

 

 

Attachments (2)
Accepted Answer
Arturo Quiroga Accepted Answer Pending Moderation
  1. Tuesday, 14 July 2020 01:34 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # Permalink

Hello, apologizes it was my mistake, the table name was incorrect, beginner error. The updateblob works very well!

 

updateblob ACTIVITIES
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

 

Case solved.

 

 

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 14 July 2020 02:31 AM UTC
Thanks for sharing the solution!
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.