Changing serial value
Posted in 1997
Suppose you have a table employee (emp_id serial, name char(10), salary
integer)
select name, salary
from employee
where emp_id = 10
into temp mytemptable;
insert into employee(name, salary)
select name, salary from mytemptable;
drop table mytemptable;
Informix detects during the insert that the serial value is missing and
supplies one itself.
The following insert works as well:
insert into employee(emp_id, name, salary)
select 0, name, salary from mytemptable;
> -----Original Message-----
> From: marko kopac [SMTP:marko.kopac@mais.si]
> Posted At: Tuesday, August 19, 1997 10:15 AM
> Posted To: informix
> Conversation: Changing serial value
> Subject: Changing serial value
>
> I don't know how to change a serial value in a table (Informix
> database). I need this to copy a record to the same table. First I
> copy
> a record to a temp table. There I try to change the serial value and
> then to insert to the original table. This is my idea. Has anybody
> some
> another idea hove to solve this problem?
>
> Marko