Re: Keys larger than 2 Billion -How do you do it?
Posted in 1996
Topics: Stored Procedures & SPL, Triggers, Constraints & Referential Integrity
Peter Tashkoff wrote: > > I have asked this question of Mark > Stock off list but my mail appears not > to have gotten through. Perhaps > someone else can clarify a question for > a dummy like me. > Mark refers to an ability to affect the > value of a insert record using the > before clause in an insert trigger. > Nils seems to support that this can be > done by saying 'Don't do it!'. Sorry Peter, probably my delay but there is a reply on it's way. It went like this: > Yes, your right. I've been checking the manuals and trying some code. > You CANNOT affect an inserted record with a trigger, because it has > already been inserted. The code I remembered obviously acted on the > record AFTER it had been inserted. > > The only other solution to this would be to write a stored procedure > that looked up the next key and did the actual insert. Of course with this method you could use a DECIMAL primary key. Cheers, -- Mark. +-------------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | | |mailto:marks@west.co.za +------------------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work... force it! | |Fax: +27 11 803 2189 |If it breaks... it needed replacing anyway! | |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+------------------------------------------------+