Re: triggers, rowid, & SP's
Posted in 1995
In article <4488sk$1l@cssun.mathcs.emory.edu>, > Allen wrote: > > >Does anyone have any clue how I can "grab" the rowid in the body of a > >trigger? (What I mean is the rowid of the row that is associated with > >the firing of the trigger). > > >I want to either insert this rowid in a physical column in another > >table or pass it as a parameter to a stored procedure. NO NO NO NO NO!! (Get the hint?) You really do NOT want to do this. You want to store the unique key of the first table in the second table. Rowids should NOT used as foreign keys! Consider this: You get nasty corruption in Table A and have to unload all your data, recreate the table, and load it again... All your rowids have now changed. Table B's pointers to Table A rowids are now worthless! And in Version 7 rowids become unique only within dbspaces (or something I'm not an 'Online' guru) and so you can have DUPLICATE ROWIDS IN A TABLE. Have I shouted loudly enough? > >Any help greatly appreciated - please respond to: > > allenj@ndr.com If you expect me to take the time to write a reply, I can expect you to take the time to read it in the NewsGroup. > >A rattled informix DBA Who should read cdi regularly anyway. ------------------------------------,------------------------------------------ Kerry Sainsbury, kerry@kcbbs.gen.nz | THE INFORMIX FAQ v2.2 Mar 95 Quanta Systems, Auckland | kcbbs.gen.nz:/informix/informix.[faq|apx] New Zealand. Work: +64 9 377-4473 | mathcs.emory.edu:/pub/informix/faq/ " " Home: +64 9 279-3571 | http://www.garpac.com/informix.html