create stored procedure return all childs to avoid recursive call get_amount