CALL spQuery_Asignacion_Gasto(12);

DROP PROCEDURE IF EXISTS spQuery_Asignacion_Gasto;
CREATE PROCEDURE spQuery_Asignacion_Gasto(
  varAsignacion int
  )
BEGIN
  select A.id_gasto as CODIGO,
  G.nombre AS GASTO, G.ABREV, 
  A.monto AS COSTO, 1 AS DEL
  from _sv_asignacion_gasto A
  inner join _sv_gasto G ON A.id_gasto = G.id_gasto
  where A.id_asignacion = varAsignacion
  and A._estado = 'A'
  and G._estado = 'A';
END;