Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Another interview question
This is a multi-part message in MIME format.
--------------16631B07DFD7145323458FEB Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit
Michael Serbanescu wrote:
>
> "A production database table contains a column defined as NUMBER(6,2).
> However, at this point in the life of the application using the table,
> *only integer numbers* can be used (although this may change in the
> future, hence the column format). All the values currently contained in
> the column are integers. Can you, the ORACLE DBA, provide as soon as
> possible, a solution to this problem, i.e. allow only integers in that
> column ? Your solution must have minimal or no impact on the
> application, be easy to implement, flexible and generic."
>
> Michael Serbanescu
No.
This is the only solution that fits the MUST HAVE requirements of:
minimal or no impact on the application, easy to implement, flexible and generic
If these non-functional requirements were dropped however, a trigger which truncated values to integers would do the trick. This would slow down performance of the application by a factor dependant upon the number of inserts into this column, hence violating the minimal, or no impact policy.
Also a trigger to do this would be tied to the particular column or the particular table. Not particularly generic.
This approach is however very easy to implement, and quite flexible. It also fulfils the functional requirement nicely.
However, I still wouldn't do it this way.
I'm a very well paid development consultant, I would never want to be a DBA ;-) Bryan
--------------16631B07DFD7145323458FEB Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Bryan Dollery Content-Disposition: attachment; filename="vcard.vcf" begin: vcard fn: Bryan Dollery n: Dollery;Bryan org: ByteSmart Systems Ltd. adr: ;;;;;;England email;internet: bryan_at_bryan.prestel.co.uk note: Consultant Software Engineer=0A=
--------------16631B07DFD7145323458FEB-- Received on Sat Jul 12 1997 - 00:00:00 CDT