Re: Next Serial value ?
Posted in 1998
Nils Myklebust wrote in message <35ea9e9b.32098015@news.newmedia.no>... ... >However what we do is to create a separate table with nothing but a >serial column. We do an insert in that and optain the serial value >from that insert in the regular way (sqlca.sqlerrd[x] x beeing 1 for >ESQL/C and 2 for 4GL or using dbinfo in a select statement). Then we >use this value to insert in whatever table that needs a modified >serial value (in our case simply a check digit, but it could be >anything of course). We do it in the same way, (table with only a serial column) but we change the serial with a unique id for computer/database so that the inserted number is unique across all our (and our clients) databases. > >You can delete all rows from this extra table at any time to keep it >from growing. The next serial value is maintained outside the table >data as you asume, so there is no need for even a single row to exist >in the table between inserts. > Yes. ---- Carlos Costa e Silva <ccs@minimal.pt> Minimal Lda Lisboa, Portugal Tel: 351 1 7575772 Fax: 351 1 7576655