Ver Mensaje Individual
  #7  
Antiguo 02-06-2008
santiaguinillo santiaguinillo is offline
Miembro
 
Registrado: abr 2007
Ubicación: Viladecans, Barcelona
Posts: 24
Reputación: 0
santiaguinillo Va por buen camino
Question Pruebas con do suspend KO

Hola duilioisola,

¿pero el commit o rollback quieres decir que lo ponga en el código delphi? Porque he hecho lo siguiente y sigue sin hacerme commit (en el procedure he puesto when EXCEPTION SUPERA_IMPORTE DO SUSPEND):

Código Delphi [-]
      sentencia := 'EXECUTE PROCEDURE PROCESA_VISITA (variables)';
      try
        Q1.Close;
        Q1.SQL.Clear;
        Q1.SQL.Add(sentencia);
        Q1.Prepare;
        Q1.ExecQuery;   //AQUI DA LA EXCEPCIÓN
        Q1.Transaction.CommitRetaining;
        Q1.FreeHandle;
      except
        Q1.Transaction.CommitRetaining; //ESTO LO HE PUESTO AHORA Y NO HACE COMMIT
        Q1.FreeHandle;
        raise;
      end;



Cita:
Empezado por duilioisola Ver Mensaje
Prueba con
* when SQLCODE -803 do SUSPEND ;
* when EXCEPTION SUPERA_IMPORTE DO SUSPEND ;

Cada vez que un procedimiento encuentra un suspend, devuelve los valores que tenga en el RETURNS() y espera a que le pidan el siguiente.

Aunque no devuelvas nada, el SUSPEND hará que devuelva el control a tu programa y puedas hacer un commit o rollback, según te convenga.

Última edición por santiaguinillo fecha: 02-06-2008 a las 16:14:19.
Responder Con Cita