> When I'm generating SQL I just maintain a list of columns and > values (or a hash, or a pair of lists, or whatever is convenient > for the language) and run it through a map/apply operation to > generate the right syntax at the last minute.
I do that as well. Most recently I used that technique to clean up this badly written .NET software someone wrote to update a SQL server >from an Access database. Before I decided to clean it up, the INSERT/UPDATE statements were hardcoded, one field name per line. Twice. I was working on this when I discovered the silliness of the syntax. I think I didn't really notice it before because I was using halfway decent languages to generate SQL instead of .NET, which I hate to begin with. Hatred abounds. -- Jeremy Stephens Computer Systems Analyst I School of Medicine Department of Biostatistics Vanderbilt University