SWITCH function doesn't work in access sql -
with code below, i'm trying update table k_tables
. column columntype
doesn't have 0 or null values in it, after run script lot of null valued rows, , number of rows values (such bigint
) larger expected.
update k_tables set columntype = switch( columntype = 'i8' , 'bigint', columntype = 'i' , 'integer', columntype = 'cf' , 'character', columntype = 'd' , 'decimal', columntype = 'i1' , 'byteint', columntype = 'i2' , 'smallint', columntype = 'da' , 'date', columntype = 'ts' , 'timestamp', columntype = 'cv' , 'varchar' );
is there wrong query?
what results of this?
select columntype, count(*) k_tables group columntype
my guess there values in there not mentioned in switch statement? these forced null switch gave no result.
i add clause...
update k_tables set columntype = switch( columntype = 'i8' , 'bigint', columntype = 'i' , 'integer', columntype = 'cf' , 'character', columntype = 'd' , 'decimal', columntype = 'i1' , 'byteint', columntype = 'i2' , 'smallint', columntype = 'da' , 'date', columntype = 'ts' , 'timestamp', columntype = 'cv' , 'varchar' ) columntype in ('i8','i', 'cf', 'd', 'i1', 'i2', 'da', 'ts', 'cv') ;
this mean update rows fit criteria, , leave other rows alone.
Comments
Post a Comment