The query I've been sending you could be inside a stored procedure:

create porcedure P_EXEC_SCRPT(CMDS varchar(160000))
as
declare variable CMD varchar(160000))
begin
  for with recursive...

  select CMD from ...
  into :CMD
  do execute statement :CMD;
end

If you are not executing the "execute statement" with autonomous
transaction, they are rolled back all together, if one of them fails.

Now, your stored procedure may collect all statements into a variable
and than call

execute procedure P_EXEC_SCRPT(:YOURVARIABLE);

You might add some error detection if needed; I would have the procedure
return the number of executed commands and an exception handling (when
any) to tell me, if something failed - but that's fine tuning.

Thomas


Am 21.06.2014 09:56, schrieb majst...@yahoo.com [firebird-support]:
>  
> 
> Hello Thomas,
> 
> 
> My SP has and select part which will collect all SQL statement that need
> to execute, but I ca't use UNION ALL because it is not i same table in
> database, but what I need to be is to do it in one transaction, I can
> execute every statemement one by one but if third is failed I need to
> roll back all changes in all tables that was made by SP.
> 
> Thanks for answer...
> 
> 
> 

-- 
Mit freundlichen Grüßen,

Thomas Beckmann
Diplom-Informatiker


Wielandstraße 14c • 23558 Lübeck
Tel +49 (22 25) 91 34 - 545 • Fax +49 (22 25) 91 34 - 604
Mail thomas.beckm...@assfinet.de <mailto:thomas.beckm...@assfinet.de>

ASSFINET-Logo

*ASSFINET Dienstleistungs-GmbH*
Max-Planck-Straße 14 • 53501 Grafschaft bei Bonn
i...@assfinet.de <mailto:i...@assfinet.de> • www.assfinet.de
<http://www.assfinet.de/>

Geschäftsführer: Dipl. Wirtschaftsinformatiker Marc Rindermann
Registergericht Koblenz HRB 23331

Diese E-Mail enthält vertrauliche Informationen. Wenn Sie nicht der
richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist
nicht gestattet.

  • [firebird-s... majst...@yahoo.com [firebird-support]
    • Re: [f... Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
      • Re... Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
        • ... majst...@yahoo.com [firebird-support]
          • ... Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]

Reply via email to