2009年4月14日星期二

Re: [fw-db] Create SQL script (export sql instead of execute)

Exporting the queries isn't tricky - $query->__toString() will do it for you.
Creating the delete queries might be trickier, I've never tried anything
like that. Easy enough on inserts, I guess, as you can just capture the ID
and create a delete based on that, but updates, especially nested updates or
multiple updates on the same table, seem like more of a nightmare as you've
potentially got order dependencies. And you've always got the potential for
leaving orphaned rows in databases - XREf tables without parent rows, that
kind of thing.

M

Matthias W. wrote:
>
> Hi,
>
> I want to export a set of SQL statements into a SQL-Script instead of
> executing the statements.
>
> Because I'm workin with modules and now I'm implementing an installation
> script which executes SQL. While executing this SQL statements I want to
> create the deinstallation SQL script. This means that I have to create the
> delete-Statements when I create the insert statements, but the delete
> statements must not be executed, they have to be logged in a file or in a
> database table to be executed on deinstallation.
>
> Is this possible?
>

--
View this message in context: http://www.nabble.com/Create-SQL-script-%28export-sql-instead-of-execute%29-tp23034599p23034980.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: