Search
 
SCRIPT & CODE EXAMPLE
 

SQL

drop table if exists test

DECLARE								-- Oracle
    existing_table number;			
BEGIN
    SELECT count(*) into existing_table FROM ALL_TABLES
    WHERE TABLE_NAME = 'table_name' AND OWNER = 'owner';
    IF existing_table = 1 then
        EXECUTE IMMEDIATE 'DROP TABLE owner.table_name';
    END IF;
END;
/
CREATE TABLE owner.table_name (BDAY DATE, [...]); 
Comment

if table exists drop

IF EXISTS(SELECT *
          FROM   dbo.Scores)
  DROP TABLE dbo.Scores
Comment

PREVIOUS NEXT
Code Example
Sql :: create table in microsoft sql server 
Sql :: oracle list columns in schema 
Sql :: to date oracle 
Sql :: insert current date sql 
Sql :: begin transaction sql 
Sql :: create stored procedure 
Sql :: t-sql delete view if exists 
Sql :: restart sql server command line linux 
Sql :: mysql show all table from database 
Sql :: string to sql timestamp 
Sql :: sql first 
Sql :: Postgresql get diff between two dates in Months 
Sql :: sql calculate working days between two dates excluding weekends and holidays 
Sql :: where id is in list sql 
Sql :: import mysql dump command line 
Sql :: python postgresQL select table 
Sql :: oracle running queries 
Sql :: mysql update with join 
Sql :: how to insert json value in mysql 
Sql :: rename a table in sql server 
Sql :: check index sql server 
Sql :: multiple like in sql 
Sql :: sum sqlalchemy 
Sql :: how to know the character set of an oracle databes 
Sql :: average sql 
Sql :: list all tables in postgres 
Sql :: oracle free up space in tablespace 
Sql :: sql server to uppercase 
Sql :: SQL Less Than or Equal to Operator 
Sql :: allow null in psql 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =