Re: SERIAL seed value
Posted in 1996
Sandy Spiers writes: * * On May 20, 11:38am, Nigel C. Myers wrote: * > Subject: Re: SERIAL seed value * > Actually, what I am looking for is a way to retrieve the starting number * for * > values in a SERIAL column. For example, if a column was defined as * SERIAL(1001), * > how can I get the '1001' value? * > * >-- End of excerpt from Nigel C. Myers * * Nigel, * * My apologies Nigel, I misunderstood your post. Its not an ideal solution but * if you are needing to know the initial "seed value" then the following select * would return both the inital value and the last value used... * * select min(column_name), max(column_name) from table_name * * I do percieve one problem here however. If data is removed from the table in * question and perhaps transferred out into an archive table/database then you * would lose the "initial seed" value by using a select. I *don't know* if its * stored in the systables but someone from Informix may be able to confirm * this. * * sandys * You basically can't. The seed value is embedded in the IDX file (unknown in Online). And as records are inserted, the value is incremented also, so the initial seed value is no longer valid. Thanks, ----------------------------------------------------------------------------- Robert Minter Data Systems Support Senior Software Engineer A Client Technologies Company E-Mail: rob@dssmktg.com Tel: 714.771.0454 Orange County Emmaus Community Fax: 714.771.3028 De Colores - Walk# OC-13 http://www.dssny.com