Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL possible equivalent

Re: SQL possible equivalent

From: Jeff Kish <jeff.kish_at_mro.com>
Date: Wed, 30 May 2007 10:42:48 -0400
Message-ID: <n73r53lf4aovco0qanfckpl45l5aojm096@4ax.com>


On Wed, 30 May 2007 09:34:58 -0500, Brian Peasland <dba_at_nospam.peasland.net> 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.
>
>Even in SQL Server, you can't do this with just SQL statements. You need
>to use T-SQL statements. It may be splitting hairs, but there is a
>distinction here...
>
>> 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?
>
>Sybrand already provided the solution for you. But I would point out
>that one does not insert PL/SQL into SQL, but rather the other way
>around....
>
>Cheers,
>Brian
>
>
>--
>===================================================================
>
>Brian Peasland
>dba_at_nospam.peasland.net
>http://www.peasland.net
>
>Remove the "nospam." from the email address to email me.
>
>
>"I can give it to you cheap, quick, and good.
>Now pick two out of the three" - Unknown
thanks. I thought in ms sql server, t-sql "WAS" sql, at least MS's version of it.
ah.. sql goes into pl/sql, not the reverse.

regards
Jeff Kish Received on Wed May 30 2007 - 09:42:48 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US