From: Dave C. <da...@cr...> - 2002-07-07 11:07:41
|
On Sat, 2002-07-06 at 17:35, Dennis Fleurbaaij wrote: > The point is that the data you now have is full of 0's and the database > won't allow you to insert them as they refer to non-existant tasks (0 is not > a possible task, SQL starts couting at 1). So as I've said before we need a > script to take all the 0's and convert them into NULL's. I hasten to add this is not a good example of my coding, but anyway. Attached is a very quick, highly untested perl hack which ought to read in create_database.sql, spot the REFERENCES (ACtually the trigger statements), parse them according to my weak knowledge of what these are, and then - hopefully - generate reasonable SQL statements which should fix up the database, replacing non-existent values with NULL. As I say, I haven't tested it *AT ALL*. If someone wants to send me a suitable candidate test database to run it on, I'll happily do so. I apologise profusely for the appalling hack that this is, but I figured it was possibly quicker than identifying each REFERENCES manually. Dave. |