Skip to content
Snippets Groups Projects
Commit dfae5296 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Correction de l'erreur lors de la génération du SQL : ORA-01789: query block...

Correction de l'erreur lors de la génération du SQL : ORA-01789: query block has incorrect number of result columns
parent 7d9d375d
Branches
Tags
No related merge requests found
Pipeline #4749 passed
......@@ -302,7 +302,7 @@ EOS;
$refConstraintsSql = NULL;
if ($refConstraintsIncluded) {
$refConstraintsSql = $this->generateSQLForRefConstraintsCreation($connection);
$refConstraintsSql = $this->generateSQLForRefConstraintsCreation($connection, true);
$refConstraintsSql = <<<EOS
UNION ALL
......@@ -448,16 +448,14 @@ EOS;
/**
* @param Connection $connection
* @param bool $innerSQLOnly
* @return string
*/
function generateSQLForRefConstraintsCreation(Connection $connection)
function generateSQLForRefConstraintsCreation(Connection $connection, $innerSQLOnly = false)
{
$schemaName = $this->extractSchemaNameFromConnection($connection);
return <<<EOS
SELECT sql from (
$sql = <<<EOS
--
-- reference constraints
--
......@@ -472,9 +470,19 @@ SELECT sql from (
where owner = '$schemaName'
and constraint_type = 'R'
EOS;
if (! $innerSQLOnly) {
$sql = <<<EOS
SELECT sql from (
$sql
)
ORDER BY ORD
EOS;
}
return $sql;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment