Re: Is it possible to use several statements in one query?
Thank you for example.
It was bad example from my side :) But your example is helpful.
how about prepare/execute?
i need to execute 10 000 complicated queries.
i want to prepare one big batch :) then do big work :)
or can i do it such way?
$sth1=$dbh->prepare('SET @a=?');
$sth2=$dbh->prepare('SMTH using @a');
$sth3=$dbh->prepare('SMTH using @b(from prev query)');
$sth4=$dbh->prepare('INSERT using @c(from prev query)');
$sth5=$dbh->prepare('SMTH using LAST_INSERT_ID()'); #<-----------
while(1) {
$sth1->execute($data);
$sth2->execute();
$sth3->execute();
$sth4->execute();
$sth5->execute();
}
does LAST_INSERT_ID() belongs to this session? (checked -it is :)
I have tryed to write program like this example and it worked ok. But i thinked that maybe i don't know something. Looks like PHP is splitting queries so it works as one big query just visually.
tested once more! :) it works! :)))))))))))))))
Am i right?
######## IT DOES 2x SPEED UP on my test :) i thinked i will only save some memory :)
Edited 2 time(s). Last edit at 06/14/2006 04:26PM by Zuko Zukoff.
Subject
Written By
Posted
Re: Is it possible to use several statements in one query?
June 14, 2006 03:00PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.