My mysql stored procedure row_count() inside another stored Procedure always returns zero

32
February 11, 2019, at 10:00 AM

Mysql ROW_COUNT() returns zero even if the update changes the database. I have a Stored Procedure A which call's another Stored Procedure B which has a Update Statement. I also used set AUTOCOMMIT =0 and start transaction in stored procedure A.

In procedure A

DECLARE done INT DEFAULT 0;
DECLARE CONTINUE HANDLER FOR NOT FOUND 
SET done = 1;
DECLARE EXIT HANDLER FOR SQLEXCEPTION,sqlwarning
BEGIN
GET CURRENT DIAGNOSTICS CONDITION 1 errno = MYSQL_ERRNO, msg = MESSAGE_TEXT;
set Message = concat(errno , msg);
ROLLBACK;
END;    
set autocommit = 0 ;
start transaction;

call test_update(@Inv_Header_gid,@Message1);                                                                                        
select @Message1 into @out_SOINV_Msg;
if @out_SOINV_Msg <> 'SUCCESS' then
set Message = concat('Error On SOInvoice Update ',@out_SOINV_Msg);
rollback;
leave sp_DispatchProcess_Set;
end if;
if @out_SOINV_Msg = 'SUCCESS' then                                                                              
set Message = 'SUCCESS';
end if;

In Procedure B

declare Query_Updatee varchar(1000);
declare update_countt int;
set INV_Header_Gid = '999';
set  Query_Updatee= Concat('Update gal_mst_tdealerprice set dealerprice_status = ''no136jj''
where dealerprice_gid = ',INV_Header_Gid,'');

         set @Query_Updatee = Query_Updatee;
         PREPARE stmtr FROM @Query_Updatee;
         EXECUTE stmtr;  
         set update_countt =  (select ROW_COUNT());
         select found_rows();
         DEALLOCATE PREPARE stmtr;                     
         if update_countt > 0 then
            set Messagee = 'SUCCESS';
         else 
            set Messagee ='FAILZrtttt';
            select update_countt;
            rollback;
READ ALSO
FreeRADIUS 3 stores # in groupname as =23 for %{SQL-Group}

FreeRADIUS 3 stores # in groupname as =23 for %{SQL-Group}

i have a user bipin linked to a usergroup called #dl#-daily-plan which FR is able to read from mysql DB but it stores it as =23dl=23-daily-plan in %{SQL-Group}Is there any specific reasoning for this as im on the vanilla config of FR and it seems to happen...

60
How to send GPS location to mysql table every x minutes

How to send GPS location to mysql table every x minutes

I'm working on a bit of code to save the user's current GPS coordinates to a mysql table every 5 minutesI'm familiar with PHP and learning javascript at the moment so I need some assistance with the javascript portion of the code

44
Efficient DB calls to update recycler view

Efficient DB calls to update recycler view

I have a MYSQL database holding my dataIt consists of various texts and a couple of image urls for each row

26
MySQL: Calculate width date in column

MySQL: Calculate width date in column

I want to define a cron that freqently delete specific data from a MySQL column if date in date_added column is older than 60 days, but don't find any infomation if MySQL supports calculation width dateIs that possible and if yes how to do?

32