Subject | Re: * - ? |
---|---|
Author | Adam |
Post date | 2005-06-28T23:43:50Z |
When we ported our application to Firebird, I came down pretty hard
on "select *"-ish queries on the principle that the application
usually died when a new field was added to the table or a field was
removed from the table even if these fields are never used.
I was in a similar boat, with a few queries needing to select 30+
fields. I spend 30 mins writing a program that.
1. Had a memo box where you could type (or paste) the select * query
2. The program read all the fields returned and put them in a comma
separated edit box and copied it to clipboard.
So you placed in it
select first 1 * from employee
and it put in your clipboard
ID, FirstName, LastName, DOB, ......
This could then be copied straight into your program, but I imagine a
select * - ? query would be full of nasty surprises when considering
metadata updates. The above approach is not.
Adam
on "select *"-ish queries on the principle that the application
usually died when a new field was added to the table or a field was
removed from the table even if these fields are never used.
I was in a similar boat, with a few queries needing to select 30+
fields. I spend 30 mins writing a program that.
1. Had a memo box where you could type (or paste) the select * query
2. The program read all the fields returned and put them in a comma
separated edit box and copied it to clipboard.
So you placed in it
select first 1 * from employee
and it put in your clipboard
ID, FirstName, LastName, DOB, ......
This could then be copied straight into your program, but I imagine a
select * - ? query would be full of nasty surprises when considering
metadata updates. The above approach is not.
Adam