[ Informix Logo ] Архив интересных статей по Informix
Пред. по дате ] [ След. по дате ] [ Пред. по нити ] [ След. по нити ][ Индекс по датам ][ Индекс по нитям ]

Re: modifying field types Smallint to integers

From "Shulzhenko Vasyl" <vasilis@softline.kiev.ua>
Date Mon, 19 Apr 1999 12:20:43 +0300


judah wrote:
> 
> Art S. Kagel wrote:
> 
> > judah wrote:
> > >
> > > Hi all,
> > >
> > > I have to modify a field that is currently a small integer to integer
> > > (or anything bigger). Everytime I use a query or dbaccess I get a -201
> > > error
> > >
> > > #finderr -201    A syntax error has occurred.
> > >
> > > anyone have any suggestions?
> >
> > -201 is indeed a syntax error.  Post one or two of the offending
> > queries and a table schema and someone will surely tell you what went
> > wrong.
> >
> > Art S. Kagel
> 
>   Thank you everyone for your help. I am now using this sytnax ;
> 
> ALTER TABLE table_name
>         MODIFY (field_name INTEGER   NOT NULL)
> 
> does anyone know the implications of changing from a smallint to an int?

Just that your row get two bytes longer and with normal page slack 
there should be no noticeable difference in storage or fetch 
performance.  Note that if you are using a later version the rows will 
not actually be altered until they have been updated.  Then engine will 
convert each row for output on the fly until then and there MAY be some 
fetch penalty for that, though I do not know if anyone has benchmarked 
the behavior.  If you notice any slowdown you can force all rows to 
be converted by running:

update table_name set field_name = field_name where 1=1;

The column updated can be any column in the table but the WHERE 1=1 is 
required or the optimizer will realize the update is noop and do 
nothing.

Art S. Kagel


Home ] Сайт создан при поддержке Украинского представительства Informix Software Inc. Hosted by ANTEC