[DDL-Oracle-users] ENABLING/DISABLING constraints in Oracle 7.3.3
Brought to you by:
rvsutherland
|
From: Remke R. <Rem...@br...> - 2001-03-29 14:36:44
|
Hello list-users (Richard)?
This issue concerns version 1.06 of ddl-oracle, containing Oracle.pm version
1.40.
Lines 613-616 of Oracle.pm say:
if ( $oracle_major < 8 )
{
$sql .= "$enable\n";
}
$enable has the value of ENABLE or DISABLE, depending on the state of the
constraint.
However, in Oracle 7.3.3, in an ALTER TABLE ... ADD CONSTRAINT statement you
only need to use DISABLE if the constraint must not be enforced. Default is
enabled and that does not need a keyword.
Eg, the code generated is:
ALTER TABLE myuser.exm_result_category ADD CONSTRAINT
fk_exm_result__exm_result FOREIGN KEY
(
resultid
)
REFERENCES myuser.exm_result
(
resultid
)
ON DELETE CASCADE
ENABLE
;
The line ENABLE should be omitted, or it should read: ENABLE CONSTRAINT
constraintname
I changed line 613-616 in Oracle.pm to:
if ( $oracle_major < 8 )
{
if ( $enable ne 'ENABLE' )
{
$sql .= "$enable\n";
}
}
That seems to work fine.
However, I do not know if this is valid for all older Oracle versions.
Remke Rutgers - Rem...@br...
Technisch Consultant
Bright Alley - Media Park
Sumatralaan 45 / Postbus 10
1200 JB Hilversum
web www.brightalley.com
tel +31 35 6774000 / fax +31 35 6774355
|