Hi,
I have another problem regarding renaming table..
One of my programme (PHP) is to rename a table on certain time, but problem occurs when i want to execute the program, if there is other people accessing the same table on the same time, i cant rename the table.
This is what i do now...
function rename_table($conn,$curr_table,$new_table){
$strSQL = "BEGIN ";
$strSQL .= "LOCK TABLE $curr_table IN EXCLUSIVE MODE;";
$strSQL .= "alter table $curr_table rename to $new_table;";
$strSQL .= "END;";
$stmt = ociparse($conn,$strSQL);
ociexecute($stmt);
commit($conn);
}
But it doesn't work!! 🙁
And, just found from a site..
begin
$sql = "alter table $curr_table rename to $new_table"
execute immediate sql;
end
same.. doesn't work!
Please help me!!