Re: column name can't include character '-'

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 19 Feb 2004 17:41:26 -0800
Message-ID: <2687bb95.0402191741.50904bbd_at_posting.google.com>


"Mark C. Stock" <mcstockX_at_Xenquery .com> wrote in message news:<OLWdnaELQvHqVKndRVn-uA_at_comcast.com>...
> | SQL> select a, b, a-b, "a-b" from marktest3;
> |
> | A B A-B a-b
> | ---------- ---------- ---------- ----------
> | 6 4 2 9
> |
> | SQL>
> | SQL> drop table marktest3;
> |
> | Table dropped.
> |
> | If you need a col "a-b" it would be better to name it a_minus_b,
> | diff_a_b, or some such than use double quotes to create potential
> | problems for users.
> |
> | HTH -- Mark D Powell --
>
> unless there's a specific identified processing advantage to storing a
> derived value, the "a-b" or a_minus_b column really should be implemented
> via a view, not included in the table.
> (function-based indexes would be an alternative if searches are often done
> on the derived value, if an index would be effective in those searches)
>
> -- mcs

Mark, very true. I was just trying to make a point about meaningful names and should have thought of that also.

Saving calculated values should only be done where either the variables of the calculation are not retained with the result such as in a history table OR the cost of calculating the result is too expensive. Our electronics and prototype lab calculates values that often take significant time per calculation so even it the variable values are saved it is not feasible to recalculate the results for display.

  • Mark D Powell --
Received on Fri Feb 20 2004 - 02:41:26 CET

Original text of this message