Error -1225 during conversion OnLine 5.01

Error -1225 during conversion OnLine 5.01

Post by Tom Hogart » Thu, 08 Jun 1995 04:00:00



        Hi,

        Another curiosity !!

        If I...

        create table t1 ( fld1 decimal (8) not null );
        insert into t1 values (0) ; commit work ;
        alter table t1 modify (fld1 char(8) not null) ;

        I get error -1225 ( column does not admit a NULL value)

        I know I can alter to char and then alter to not null,
        I also know that if the first record does not contain 0
        the original alter works fine.

        Why does it do that ?

        Tom Hogarty                     <Standard Disclaimers Apply>
        SNI                              OnLine 5.01.U
        Germany                          ANSI Mode Database
        Tel : +49 52518-11602
        Fax : +49 52548-27905

 
 
 

Error -1225 during conversion OnLine 5.01

Post by Charles Franci » Thu, 08 Jun 1995 04:00:00


The character for the decimal value of 0 (zero) is the NULL character.
In your alter table statement you are altering the field to type character
and disallowing nulls.  When the engine builds the new table and then
trys to insert the records from the old table it returns the error of:

  "-1225  Column does not admit a NULL value.
     This statement attempted to store a null value in a column
     that has been defined as not allowing nulls. Review the definition
     of the table, and revise the statement so it supplies values for all
     required columns."

Do the following:
     create table t1 ( fld1 decimal (8) not null );
     insert into t1 values (0) ; commit work ;
     alter table t1 modify (fld1 char(8) l) ;
     update table t1 set fld1 = "       0" where fld1 is NULL;
      alter table t1 modify (fld1 char(8) not null) ;

Or better yet do:
     create table t1 ( fld1 char (8) not null );
     insert into t1 values ("       0") ; commit work ;

Note:     I assumed you wanted the 0 (zero) right justified.
     if not leave out the leading spaces.

 ----------
From: ilist
To: internet!rmy.emory.edu!informix-list
Subject: Error -1225 during conversion OnLine 5.01
Date: Wednesday, June 07, 1995 2:39PM

        Hi,

        Another curiosity !!

        If I...

        create table t1 ( fld1 decimal (8) not null );
        insert into t1 values (0) ; commit work ;
        alter table t1 modify (fld1 char(8) not null) ;

        I get error -1225 ( column does not admit a NULL value)

        I know I can alter to char and then alter to not null,
        I also know that if the first record does not contain 0
        the original alter works fine.

        Why does it do that ?

        Tom Hogarty                     <Standard Disclaimers Apply>
        SNI                              OnLine 5.01.U
        Germany                          ANSI Mode Database
        Tel : +49 52518-11602
        Fax : +49 52548-27905


 
 
 

1. INET 5.01 for NT and ONLINE 5.01

I'm trying to use INET 5.01 for NT with ONLINE 5.01 for UNIX.
Sometime using the ilogin the connection to database is ok.
Sometime (the most of the times) the connection fails with the error
code -457, "Database server terminated unexpectedly has occurred'
Someboy knows which is the problem?

2. How to select an excel sheet into a SQL FROM clause

3. ESQL/C error -1225

4. Bulk Insert and Key Violations

5. Informix Online 5.01 versus Online 7.x

6. One Week Course on Object Data Management, August 7-11, at Stanford

7. Online config for I-NET PC 5.01 to Online 7.1

8. Using Dsum Function with an SQL expression on the VB platform.

9. rootdbs corruption with Online 5.01

10. Online 5.01 and Unixware 1.1

11. Online 5.01

12. Online STAR 5.01 bug.

13. Solaris 2.3 & Online 5.01