Re: Q: problem applying constraint



Malcolm Dew-Jones schrieb:
I wish to enable a not null constraint, but I can't, and I'm wondering
where I should start looking to solve this. In case it makes a
difference, the column in question has been added and removed several
times during development.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production


SQL> alter table TTT_requests modify RECEIVED_DATE DATE not null ;
alter table TTT_requests modify RECEIVED_DATE DATE not null
*
ERROR at line 1:
ORA-02296: cannot enable (TTT.) - null values found


SQL> select count(*) from TTT_requests where RECEIVED_DATE is null ;

COUNT(*)
----------
0

1 row selected.

So, no nulls, but can't enable a not null constraint. Also, I notice the
message looks odd, "(TTT.)" though I don't know if that is an issue here or irrelevent.

Thanks for feedback.




Does
select * from ttt_requests where received_date is null;
yields "no rows selected" as well?
Did you try
alter table TTT_requests modify RECEIVED_DATE DATE not null exceptions into exceptions;
?

Best regards

Maxim
.



Relevant Pages

  • Re: Updating backend db
    ... case WHEN you have physical access to the back end. ... Making a bunch of queries and append queries is really ... Why not just open and modify the back end. ... go file->get external data after opening the production back end? ...
    (microsoft.public.access.gettingstarted)
  • Re: Adding columns to table with 3 millions rows
    ... First of all, you shouldn't be doing such a production change, using ... You should use the ALTER TABLE command to do this properly. ... run the script with ALTER TABLE commands in production. ... ENTERPRISE MANAGER saves the change. ...
    (microsoft.public.sqlserver.server)
  • Re: modify serial to serial8
    ... When the Database Server Uses the In-Place Alter Algorithm ... that you specify in the ADD, DROP, and MODIFY clauses of the ALTER TABLE ... Betreff: Re: modify serial to serial8 ... r3 smallint, ...
    (comp.databases.informix)
  • Re: [Info-Ingres] Reg:page size--req help
    ... * if your indexes are not persistent you must reconstruct them * ... alter table ... ... modify is ON. ... storage stucture is heap .and this table creates user tables....using ...
    (comp.databases.ingres)
  • Re: SMSS - script to new window uses sp_executesql?!
    ... There is a bigger problem with this "feature" than just having dynamic SQL ... TRUE and then try to modify a stored procedure or script as alter, ...
    (microsoft.public.sqlserver.tools)

Loading