Re: Is this the sanctioned way to ascertain a table's existence?

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Sat, 17 Oct 2009 01:48:03 +0200
Message-ID: <4ad9062a$0$83250$e4fe514c_at_news.xs4all.nl>



Ramon F Herrera schreef:
> All my database accesses are done through Pro*C/C++.
>
> Sometimes my code needs to verify whether a table exists. Years ago, I
> was about to post that particular questions here. I then realized
> that the following statements achieve the desired results:
>
> EXEC SQL SELECT COUNT(1) INTO :howMany FROM user_tables WHERE
> table_name = :table_name;
>
> if (howMany == 1)
> doThis();
> else
> doThat();
>
> Is that "the" proper way?
>
> -Ramon
>

I always get a bit worried if an application has to check whether a table exists.... should they not be there just by design?

Shakespeare Received on Fri Oct 16 2009 - 18:48:03 CDT

Original text of this message