i was running my codes and i received this error
[Doctrine\DBAL\Exception\DriverException]
An exception occurred while executing 'ALTER TABLE
ImportGenius\Entities\SQLite\TradeBase\UnitedStates\UnitedStatesImporterIndex RENAME TO ImportGenius\Entities\SQLite\TradeBa
se\UnitedStates\UnitedStatesImporterIndexTemp_2,
ImportGenius\Entities\SQLite\TradeBase\UnitedStates\UnitedStatesImporterIndexTemp RENAME TO ImportGenius\Entities\SQLite\Tra
deBase\UnitedStates\UnitedStatesImporterIndex
':
SQLSTATE[HY000]: General error: 1 unrecognized token: "\"
This is my codes:
private function switchTable(Connection $connection, $primaryTableName, $tempTableName)
{
$secondaryTempTableName = $tempTableName.'_2';
$rawSqlQuery = "ALTER TABLE
{$primaryTableName} RENAME TO {$secondaryTempTableName},
{$tempTableName} RENAME TO {$primaryTableName}
";
$stmt = $connection->prepare($rawSqlQuery);
$stmt->execute();
}
Aucun commentaire:
Enregistrer un commentaire