Subject Re: [IBO] Re: Changing the Not Null Constraint at run time
Author Helen Borrie (TeamIBO)
At 08:01 AM 01-06-02 +0000, you wrote:
>Thank you for your response.
>I am pretty new to IBO and apologise if I am asking silly questions.
>I still can't change the attributes of a column in my codes.

To clarify:

>I have the following statement in my code:

This is a DDL statement (Data Definition Language). DDL is used to create
objects in the database; although it is not generally a good idea to
create database objects via DSQL in your application.

>I like to add the Not Null Constraint to the Currency Column and have
>done the following:
>IB_DSQL1.Prepared:= True;

This won't do anything. ColumnAttributes act on dataset columns. TIB_DSQL
is not a dataset class. Even if it had been a dataset, it still would only
cause your application to required an entry in that column - it would not
have any effect on the column object in the database. What were you trying
to achieve here?

If you want to apply a Not Null constraint to a column in the database and
you didn't do it at create time, you have no choice but to define a new
column, including that constraint, and move the existing data into
it. This will fail if the existing column contains any nulls.

>I have also tried, Unprepare, OnPrepareSQL in the code without any

What "luck" were you expecting?

Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at