Re: rowid and trigger
Posted in 1999
Use a SERIAL type column instead. ROWIDs are an internal value and will not be maintained across any unloar/reload or reorganization of the table 1 so you will be in trouble in the future. Just add a SERIAL column to table 1, insert zero (0) into the serial column in table 1, and copy the serial value that is generated for the new row (retrieved from sqlca.sqlerrd[1] in ESQL or sqlca.sqlerrd[2] in 4GL) into the table 2 row. This is what SERIAL type columns are used for. If you use another development tool you can retrieve the serial number from the DBINFO function immediately after the insert: SELECT DBINFO( 'sqlca.sqlerrd1' ) FROM systables WHERE tabid = 1; Art S. Kagel "Pettersson, Robert" wrote: > > Hi > > Is it posible to use ROWID in a insert trigger ? > I dont have a primary key so i want to use ROWID. > > This is example off my problem > table 1 > char id > char id1 > > table 2 > integer rowid_table1 > char id > > On table 1 i want to have one insert trigger that move information to > table2 whit rowid from table 1 > Is this posible ? > > When i tray this the error message is that new.rowid is no colume ? > > /Robert