[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ic] Database transaction?


Hi there
I need to delete items from multiple tables in *one* sql query (must
be a transaction).
How can I do that?
The [query] tag only seem sto accept one statement (i.e. max 1 semicolon).

Is there some way to do that from withing a perl tag?

I found this (http://www.icdevgroup.org/interchange-doc-5.2.0/frames/ictemplates_17.html):
--
[perl products]
            my $dbh = $Sql{products}
                or return "Database not shared.";
            my $sth = $dbh->prepare('select * from products')
                or return "Couldn't open database.";
            $sth->execute();
            my @record;
            while(@record = $sth->fetchrow()) {
                foo();
            }
            $sth = $dbh->prepare('select * from othertable')
                or return "Couldn't open database.";
            $sth->execute();
            while(@record = $sth->fetchrow()) {
                bar();
            }
          [/perl]
--

It seems to me, that a query from inside a perl statement is limited
to one table (since the table has to be passed in the [perl] tag.
When I give it a try it always throws the "Database not shared" at me.

thx in advance...

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.