Mark D Powell wrote:
> On May 30, 11:10 am, DA Morgan <damor..._at_psoug.org> wrote:
>> Jeff Kish wrote:
>>> I have a script for ms sql server that checks to see if a table exists... if
>>> it does it drops it and recreates it.
>>> I'm wondering how to do this using only sql if possible. I can figure it out
>>> using pl/sql but I'm not sure of the correct approach (or even if it is
>>> possible) using just sql.
>>> I realize you can select from user_tab_cols like this:
>>> select table_name from user_tab_columns where upper(table_name) = 'ASSET'
>>> but how do I fit this into a sort of ifdef else sort of flow control in sql?
>>> Can someone point me in the right direction? Do I need to somehow insert
>>> pl/sql into the sql?
>>> thanks
>>> Jeff Kish
>> The issue isn't how ... the issue is why. Oracle is NOT a Microsoft
>> product rebranded. The concepts are different, the architecture is
>> different, and kludges such as the one you are asking about used in
>> SQL Server only because of its Ingres origins are possible but never
>> done by people who learn the product.
>>
>> So the answer is you can do it using Native Dynamic SQL but you should
>> instead learn Oracle unless you wish to write really really bad code.
>> --
>> Daniel A. Morgan
>> University of Washington
>> damor..._at_x.washington.edu
>> (replace x with u to respond)
>> Puget Sound Oracle Users Groupwww.psoug.org- Hide quoted text -
>>
>> - Show quoted text -
>
> Minor point - The first version of SQL Server was a port of Sybase to
> the Wintel platform, not Ingres. Sybase still calls its version of
> SQL: T-SQL.
Sorry for the lack of clarity in what I wrote. My point was to go back
to the origins of SQL Server which was that Ingres begat both Informix
and Sybase which begat SQL Server. The engine in SQL Server, concepts
and architecture, is Ingres.
--
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Wed May 30 2007 - 19:41:49 CDT