There will be no need to create the sequence and there will be no need to create trigger , creating the table intended to use the sequence in the below manner will give the solution expected from the sequence and trigger
create table smou
(id SERIAL not null,
name varchar(30) default NULL,
time varchar(100) default NULL);
"id SERIAL not null" this makes informix provides every inserted record
with a unique number, so there is no need to create sequence or trigger.
unfortunately , with IDS is not possible to execute any command differ of INSERT,DELETE,UPDATE,EXECUTE PROC/FUNC inside a Trigger.
You need create a SPL to get the nextval .
CREATE SEQUENCE Y;
create procedure sp_smou_auto() returning integer
return y.nextval ;
CREATE TRIGGER smou_auto INSERT on smou
referencing new as n
for each row
when (n.id is null) (
execute procedure sp_smou_auto() into id