Re: Drop a table with foreign key constraints

  • From: Uwe Küchler <uwe@xxxxxxxxxxxx>
  • To: Jared Still <jkstill@xxxxxxxxx>
  • Date: Sun, 01 Aug 2010 22:23:15 +0200

Jared,

...that's why I thought of writing that "select *" is a bad idea but
didn't write it on second thought. ;-)

But in the case of many not-so-small apps that I (co-) developed or did
code reviews on, a "select *" does not happen. hugh. And if someone
would do this in one of my current projects anyway, he would get smacked
with a pound of printed development guidelines. X-)

Seriously, though: Making your SQL code dependent on a certain order of
columns IS a bad idea.
Happy rest-of-weekend,

Uwe


Am 01.08.2010 20:10, schrieb Jared Still:
> 2010/8/1 Uwe Küchler <uwe@xxxxxxxxxxxx <mailto:uwe@xxxxxxxxxxxx>>
>
>     Octavian,
>
>     have you considered using a view as an API to the table? This way, you
>     could re-order, rename and even drop columns without caring about FK
>     constraints.
>
>
> A couple of thoughts on that spring to mind:
>
> * any app that does 'select *' and expects columns in the current
> order will break.
> It does not matter that 'select *' is a bad idea, that never stopped
> anyone.
>
> Dang, while typing the first one, I forgot the second one.
>
> Oh well...
>
> Jared Still
> Certifiable Oracle DBA and Part Time Perl Evangelist
> Oracle Blog: http://jkstill.blogspot.com
> Home Page: http://jaredstill.com
>

Other related posts: