Subject Re: [ib-support] Re: changing a column type to not null
Author ibrahim Bulut
NULLABLE FIELD ==> NOT NULL FIELD
===============================
UPDATE RDB$RELATION_FIELDS
SET
RDB$NULL_FLAG=1
WHERE
(RDB$FIELD_NAME = 'FIELD_NAME') AND
(RDB$RELATION_NAME='TABLE_NAME')



NOT NULL FIELD ==> NULLABLE FIELD
================================
UPDATE RDB$RELATION_FIELDS
SET
RDB$NULL_FLAG=NULL
WHERE
(RDB$FIELD_NAME = 'FIELD_NAME') AND
(RDB$RELATION_NAME='TABLE_NAME');

DELETE FROM RDB$RELATION_CONSTRAINTS
WHERE
(RDB$CONSTRAINT_TYPE = 'NOT NULL') AND
(RDB$RELATION_NAME = 'TABLE_NAME') AND
(RDB$CONSTRAINT_NAME = 'INTEG_7');


Ibrahim Bulut
Software Developer
Republic of Turkey


----- Original Message -----
From: "csswa" <csswa@...>
To: <ib-support@yahoogroups.com>
Sent: Tuesday, May 07, 2002 3:41 PM
Subject: [ib-support] Re: changing a column type to not null


>
> I'm pretty sure you cannot change null/not null for a column, Duilio -
> - certainly not for a table with existing records. What would it do
> with NULL value fields if changed to NOT NULL?!
>
> One solution would be to create a new column and pump the data across
> to it (adding values where NULLs existed), then delete the old column.
>
> Regards,
> Andrew Ferguson
> Andrew Ferguson
> -- Shaking the nuts from the family tree.
>
>
> --- In ib-support@y..., Duilio Foschi <dedalus@y...> wrote:
> > reading the ALTER TABLE ALTER COLUMN command on the langref, I am
> brought
> > into thinking I can change the type of an existing column fron
> nullable to
> > not null.
> >
> > However, I cannot find no way to put this into practice.
> >
> > Any hint ?
> >
> > TIA
> >
> > Duilio Foschi
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>