Drop tables // sqlplus scripts comments // synonyms

Hello,
I'm several question:
1) I've created three tables just as you can look bellow-->
CREATE TABLE IDIOMA_FABRICANT (
IDIOMA NUMBER(38) NOT NULL,
FABRICANT NUMBER(38) NOT NULL,
WEB VARCHAR(35),
DESCRIPCIO VARCHAR(100),
CONSTRAINT idioma_fabricant_pk PRIMARY KEY (IDIOMA,FABRICANT),
CONSTRAINT idioma_fabricant_fk FOREIGN KEY (IDIOMA) REFERENCES IDIOMA(CODI) ON DELETE CASCADE,
CONSTRAINT fabricant_fabricant_fk FOREIGN KEY (FABRICANT) REFERENCES FABRICANT(CODI) ON DELETE CASCADE
CREATE TABLE IDIOMA (
CODI NUMBER(38),
DESCRIPCIO VARCHAR(15),
CONSTRAINT codi_idioma_pk PRIMARY KEY (CODI)
CREATE TABLE FABRICANT (
CODI NUMBER(38),
NOM VARCHAR(30),
ALIAS VARCHAR(30),
CONSTRAINT codi_fabricant_pk PRIMARY KEY (CODI)
question: If I want drop these tables, Do I Must drop firstly the CONSTRAINTS?
What should the commands to drop these tables are?
2) I've read that to set comments in my PL/SQL scripts I must type /* ... */ or --. But It doesn't work. The lines inside these characters are performed by SQLPlus. What are the correct characters to establish a comment in my scripts?
3) While somebody is creating a database tables for your application, he usually executes this sentence "SELECT TABLE_NAME FROM USER_TABLES" to get the tables that he has created. How can I create a synonym to do it more quickly?
Thanks for all in advance.

Hi
We can create Synonym only for giving alternative name for tables, view, sequence, procedure, stored function, package etc.. not like that you said.
Synonyms are used to hide the name and owner of an object and for providing location transparency for remote objects.
for example
Let EMP be the table name.
If you execute the query given below, then the synonym EMPS will be created for the table name EMP.
Create synonym EmpS for Emp;
So now, you can use the synonym name in DML instead of the table name.
select * from Emps;
Regards
Basheer

Similar Messages

  • How to write errors in sqlplus script into logging table?

    Hi,
    I am having sqlplus script which do some DDL and DML statements.
    Now is there any way to logg errors which pop up when the script is esxecuting?
    For example something like:
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    BEGIN
    /* SOME DDL OR DDL */
    CREATE TABLE A
    COL_1 NUMBER,
    COL_2 NUMBER
    /* Wrong sql statement */
    INSERT INTO TABLE_DOWS_NOT_EXISTS(....);
    EXCEPTION WHEN OTHERS THEN
    INSERT INTO logging_tbl (error_description) VALUES(SQL.SQLCODE);
    END;
    I know, this one will tell sqlplus to exit with sql error code without trapping into exception section, but is there any way to handle it?
    Thanks

    An approach would be to enable spooling in the beginning of your script. Wrap dbms_output into an error_log procedure. The error_log should simple write an errorcode + message to the prompt.<br>Afterwards - a search batchjob or manual search for errorcode occurances in the script spool file(s) should reveal the outcome.

  • Drop table if exists in sql statement

    Oracle: 10G
    Is there a way to check if table exist and then only drop table. Something like:
    drop table (select table_name from user_tables where lower(table_name) = 'o2i_filing_dest')

    As already suggested, you could e.g. use an anonymous PL/SQL block as part of your SQL script, e.g. something like that:
    set echo on
    spool <your_log_file>
    WHENEVER SQLERROR EXIT FAILURE
    DECLARE
      PROCEDURE EXEC_DONT_FAIL( P_CMD IN VARCHAR2 ) IS
        e_table_or_view_does_not_exist exception;
        pragma exception_init(e_table_or_view_does_not_exist, -942);
        e_type_does_not_exist exception;
        pragma exception_init(e_type_does_not_exist, -4043);
        e_sequence_does_not_exist exception;
        pragma exception_init(e_sequence_does_not_exist, -2289);
      BEGIN
        EXECUTE IMMEDIATE P_CMD;
      EXCEPTION
      WHEN e_table_or_view_does_not_exist OR e_type_does_not_exist OR e_sequence_does_not_exist THEN
          NULL;
      END;
    BEGIN
      EXEC_DONT_FAIL('drop type <type_name1> force');
      EXEC_DONT_FAIL('drop view <view_name1>');
      EXEC_DONT_FAIL('drop table <table_name1> purge');
      EXEC_DONT_FAIL('drop sequence <seq_name1>');
    END;
    CREATE TABLE ...Note that the literals in angle brackets are just placeholders for demonstration purposes, you need to use your actual object names/file names there.
    Of course you could also use a FOR ... LOOP in the PL/SQL block that queries e.g. USER_OBJECTS to find out which objects to drop.
    That way it is ensured that only expected exceptions will be ignored but all others will raise and stop your script in that case.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/
    Edited by: Randolf Geist on Sep 25, 2008 10:09 AM
    Clarification regarding angle brackets added

  • Cannot drop table

    Versions are Oracle 11.2.0.1.0 and SQL Developer 4.0.0.12 on Windows 7 Ultimate SP1.
    Hi
    I'm following the CBT Nuggets SQL Fundementals training (video #11) and cannot drop a table I have just created.  The command executed and error are:
    drop table newprods;
    Error starting at line : 1 in command -
    drop table newprods
    Error report -
    SQL Error: ORA-00604: error occurred at recursive SQL level 1
    ORA-20000: Cannot drop object
    ORA-06512: at line 2
    00604. 00000 -  "error occurred at recursive SQL level %s"
    *Cause:    An error occurred while processing a recursive SQL statement
               (a statement applying to internal dictionary tables).
    *Action:   If the situation described in the next error on the stack
               can be corrected, do so; otherwise contact Oracle Support.
    As the HR user I created two tables and created a FK constraint between them.  After truncating the table with this FK, I am unable to drop it.  Even if I remove the FK, the error is the same.  Issing the command in SQL*Plus gives the same error.
    This is the first time I have created any tables since installing Oracle on this machine and is my first attempt at dropping a table.  I have not created any sequences, triggers or views based on these newly created tables.
    Does anyone have any ideas?
    Cheers

    C:\Oracle>sqlplus hr@orcl
    SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 4 18:58:55 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> CREATE TABLE table1 (column1 VARCHAR2(20 BYTE));
    Table created.
    SQL> select * from table1;
    no rows selected
    SQL> drop table table1;
    drop table table1
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20000: Cannot drop object
    ORA-06512: at line 2
    SQL>
    Can I run a query to see if there are any triggeres on the table?
    EDIT: Ok it looks like no triggers:
    SQL> show user
    USER is "SYS"
    SQL> select * from DBA_TRIGGERS where table_name like '%table1%';
    no rows selected
    SQL> select * from USER_TRIGGERS where table_name like '%table1%';
    no rows selected

  • Allowing a user to create/drop tables in another users schema

    We have a central shared schema (TEAM). So we can monitor who is doing what users have there own login(USER1, USER2...). Is there a way to allow a user to create/drop objects in another user.
    I.e.
    SQL> connect USER1
    SQL> create team.table1(col1 char(1));
    SQL> drop table team.table1:
    How can this be set up?
    Ben

    Here is what you can do, If you want to keep track of what users are doing.
    Open the glogin.sql file and set the spool like this
    spool /oracle/audit/SID_&_user.logEverytime user logs in it will be populated and you will be able to see who is doing what.
    You can remove the write permission on glogin.sql so that no one can modify it.
    You also need to create a script like this, which would rename it every time same user would login.
    #!/bin/ksh
    time=`date +"%b"_"%d"_"%H"_"%M"`
    ##you need to pass some more variables and while loop to include all the users## ( This is just for an example)
    if [ -f /oracle/audit/SID_SYS.log ]
    then
    mv /oracle/audit/SYS.log /oracle/audit/SYS.log.$time
    fiEdit the glogin.sql file with this script information like this
    host /oracle/audit/file.kshHope this helps, if you need more information let me know.

  • Dropping Table: ORA-00054

    When going to drop a table in a particular schema, I receive the following error:
    ORA-00054: resource busy and acquire with NOWAIT specified.
    My command:
    drop table schema1.table1;
    I've tried the above drop command several times. No matter what, I keep on getting the same error. How can I successfully drop this table? I also tried logging out & back into my toad session.

    Looks like you were having quite some trouble with your toad connections. This one and the other insert problem.
    Try Oracle SQL Developer and/or SQLPLUS
    Not only there are native Oracle products, but also they are free to use with your database.
    http://www.oracle.com/technology/products/database/sql_developer/index.html

  • DROP TABLE works through SSMS but not via T-SQL Query

    Hello All,
    I am trying to drop a number of tables (1,000+) in a particular database by scripting the actions in T-SQL. When I run the query I get error 3701 on every table which points to a permissions issue. However, I am able to delete tables one by one using
    the tree-view in the SSMS Object Explorer. 
    1. I have tried starting query sessions with both the DBO of the database and the SA account to no avail. (Both had the sysadmin role when I tried.)
    2. Both the DBO account and the SA account are able to drop tables using SSMS Object Explorer.
    Do I need a specific GRANT of permissions to use T-SQL versus SSMS or am I missing something even more fundamental?
    TIA, Simon
    <code>
    DECLARE @Company VARCHAR(max), 
    @ID VARCHAR(max), 
    @NAME VARCHAR(max), 
    @TABLE_CATALOG VARCHAR(max),
    @NAV_DATABASE VARCHAR(max),
    @TABLE_NAME VARCHAR(max), 
    @STATEMENT VARCHAR(max),
    @OBJECT_NAME VARCHAR(max),
    @OBJECT_NAME_BARE VARCHAR(max),
    @OBJECT_TYPE VARCHAR(max);
    SET @TABLE_CATALOG = 'NAV_PENTA_TEST_GAAP';
    SET @NAV_DATABASE = @TABLE_CATALOG
    IF @TABLE_CATALOG <> DB_NAME() 
    BEGIN
    DECLARE @ERRORMSG VARCHAR(max);
    SET @ERRORMSG =  'You are not in the correct database. You specified ' + @TABLE_CATALOG + ' but you are currently in a session for ' + db_name();
    RAISERROR(@ERRORMSG, 18, 1);
    RETURN;
    END;
    -- To hold the object names (tables) from Navision
    CREATE TABLE #NavisionObjects
    [CompanyName]
    VARCHAR(max),
    [ID] VARCHAR(max),
    [Name]
    VARCHAR(max),
    [TABLE_NAME]
    VARCHAR(max)
    -- To hold the object names (tables) from SQL only
    CREATE TABLE #NavisionSQLObjects
    [TABLE_NAME]
    VARCHAR(max)
    -- Holds the list of dependent objects
    CREATE TABLE #DependentObjects
    [name] VARCHAR(max),
    [type] VARCHAR(max)   
    WITH T AS (
    SELECT [Company Name],[ID],[Name],[Company Name]+'$'+[Name] AS TABLE_NAME 
    FROM [Object]   
    WHERE [Name] like '%IT IS%' AND [Company Name]>''
    UNION ALL
    SELECT [Company Name],[ID],[Name],[Name] AS TABLE_NAME 
    FROM [Object]   
    WHERE [Name] like '%IT IS%' AND [Company Name] IN ('',' ')
    INSERT INTO #NavisionObjects SELECT [Company Name],[ID],[Name],[TABLE_NAME] FROM T;
    UPDATE #NavisionObjects SET TABLE_NAME = TABLE_NAME+ID WHERE ID LIKE '1%';
    INSERT INTO #NavisionSQLObjects 
    SELECT TABLE_NAME from INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_CATALOG = @TABLE_CATALOG AND TABLE_NAME LIKE '%IT IS%' AND TABLE_TYPE='BASE TABLE';
    --SELECT * FROM #NavisionObjects where CompanyName like 'E15%' order by TABLE_NAME;
    --SELECT * FROM #NavisionSQLObjects where TABLE_NAME like 'E15%' order by TABLE_NAME;
    DECLARE cTables CURSOR FOR SELECT A.CompanyName,A.ID,A.[TABLE_NAME] FROM #NavisionObjects A
    INNER JOIN #NavisionObjects B ON B.[TABLE_NAME]=A.[TABLE_NAME]
    OPEN cTables;
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
    PRINT 'Storing dependencies for [' + @TABLE_NAME + ']';
    BEGIN TRY
    INSERT INTO #DependentObjects 
    EXEC sp_depends @TABLE_NAME;
    END TRY
    BEGIN CATCH
    PRINT 'Could not get dependencies for table [' + @TABLE_NAME + ']';
    END CATCH
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    END
    CLOSE cTables;
    Drop dependent objects first so that table drops are less likely to fail. 
    DECLARE cdo CURSOR FOR SELECT [Name],[Type] FROM #DependentObjects;
    OPEN cdo;
    FETCH NEXT FROM cdo INTO @OBJECT_NAME, @OBJECT_TYPE;
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
    BEGIN TRY
    SET @OBJECT_NAME_BARE = 
    CASE 
    WHEN CHARINDEX('dbo',@OBJECT_NAME) = 1
    THEN RIGHT(@OBJECT_NAME,LEN(@OBJECT_NAME)-4)
    ELSE @OBJECT_NAME
    END;
    SET @STATEMENT = 'DROP ' + @OBJECT_TYPE + ' [' + @OBJECT_NAME_BARE + ']';
    PRINT @STATEMENT;
    EXEC sys.sp_sqlexec @STATEMENT;
    END TRY
    BEGIN CATCH
    PRINT 'Could not DROP object [' + @OBJECT_NAME + '] of type ' + @OBJECT_TYPE + ', SQL Error ' + CAST(@@ERROR AS VARCHAR(max));
    END CATCH
    FETCH NEXT FROM cdo INTO @OBJECT_NAME, @OBJECT_TYPE;
    END
    CLOSE cdo;
    DEALLOCATE cdo;
    OPEN cTables;
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
    PRINT 'Removing [' + @TABLE_NAME + ']' ;
    BEGIN TRY
    SET @STATEMENT = 'TRUNCATE TABLE dbo.[' + @TABLE_NAME + ']';
    PRINT @STATEMENT;
    EXEC sys.sp_sqlexec @STATEMENT;
    END TRY
    BEGIN CATCH
    PRINT 'Could not truncate table [' + @TABLE_NAME + ']';
    END CATCH
    BEGIN TRY
    SET @STATEMENT = 'DROP TABLE dbo.[' + @TABLE_NAME + ']';
    PRINT @STATEMENT;
    EXEC sys.sp_sqlexec @STATEMENT;
    BEGIN TRY
    SET @STATEMENT = 'DELETE FROM [Object] WHERE [Company Name] = ' + CHAR(39) + @Company + CHAR(39) + ' AND [ID] = ' + CHAR(39) + @ID + CHAR(39) + ' AND [TABLE_NAME] = ' + CHAR(39) +
    @TABLE_NAME + CHAR(39) ;
    EXEC sys.sp_sqlexec @STATEMENT;
    print @STATEMENT;
    END TRY
    BEGIN CATCH
    PRINT 'Could not Delete Object [' + @TABLE_NAME + '], from Object table, SQL Error ' + CAST(@@ERROR AS VARCHAR(max));
    END CATCH
    END TRY
    BEGIN CATCH
    PRINT 'Could not DROP table [' + @TABLE_NAME + '], SQL Error ' + CAST(@@ERROR AS VARCHAR(max));
    END CATCH
    FETCH NEXT FROM cTables INTO @Company,@ID,@TABLE_NAME;
    END
    CLOSE cTables;
    DEALLOCATE cTables;
    DROP TABLE #DependentObjects;
    DROP TABLE #NavisionObjects;
    DROP Table #NavisionSQLObjects;
    </code>

    3701 = ...does not exist or you don't have permission.
    Most of the time it means the former. So there are probably some problems in your DROP TABLE statements. Since there is a whole lot about Navision in the script, I decline from trying to figure out what. But I encourage you to study the PRINT statements.
    I think that it would be a good idea to include the schema name, in cases these tables are not in dbo after all.
    Note: rather than writing:
       SET @STATEMENT = 'DROP ' + @OBJECT_TYPE + ' [' + @OBJECT_NAME_BARE + ']';
    write:
       SET @STATEMENT = 'DROP ' + @OBJECT_TYPE + quotename(@OBJECT_NAME_BARE)
    Somewhat briefer. And it works also when the object name includes a right bracket.
    sp_sqlexec is undocumented, use sp_executesql instead.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Dropping tables in a specified user where in i dont know the SYS privilege

    Hi,
    I have 10 users with each user containing about 120 tables, but i want to drop all the tables without dropping the users and im working on a testing database where in i only have access to ALL_USERS...
    Can anyone help me in this regard......
    Thanks
    - Sri

    Ok, I'll try to be clearer.
    in SQL*Plus, first enter the line:
    sql> spool drop_tables.sql;
    then enter the query as above. This should output a load of lines which read 'drop table owner.table_name; and the last line will be row count.
    Then issue the command:
    sql> spool off;
    you should then see that a file has been created on your filesystem called drop_tables.sql. Take a look inside and it will contain lots of 'drop table' commands.
    return to SQL*Plus and run that script:
    mysql> @drop_tables.sql
    when you are SURE that you are happy with what has been dropped, issue the COMMIT;
    if you are not happy, issue a ROLLBACKl
    regards
    James

  • Generating the DROP TABLE statements in the correct order

    DB Version:11.1.0.7.0
    I have been given a list of 250 unwanted tables to be dropped. Because of the FK dependancy, the DROP TABLE statements has to be in the right order. ie Drop the child table first and then the parent.
    Is there way to generate a script (from a given list of tables names) which will create the DROP TABLE statments in the right order?

    Have you tried CASCADE CONSTRAINTS?
    Cheers
    Ben

  • DROP TABLE performance

    Hello,
    could someone share any tips on improving execution times for dropping tables?
    I have a blank table with over 200 columns and it takes 23-25s to drop. Smaller tables take something around 0.1s of course. Problem is I need to drop thousands of such tables and then recreate them. The recreate itself takes no more than a second.
    What's the origin of a longer time? Is it because of an implicit commit in the drop table command?
    I've tried this in noarchivelog mode with almost identical times. I've also tried different optimizer_mode settings and commit_logging, none have shown any usable results, but I'm still experimenting. The goal is to minimize execution time once I need to run the whole batch, maybe running multiple sessions can work out to be faster (while individual times are maybe longer), not sure yet.
    Here is a sample output:
    SQL> CREATE TABLE "SYSADM"."DRIVERTEST"
      2    (
      3      "PROCESS_INSTANCE"   NUMBER(10,0) NOT NULL ENABLE,
      4      "INTFC_ID"           NUMBER(*,0) NOT NULL ENABLE,
      5      "INTFC_LINE_NUM"     NUMBER(*,0) NOT NULL ENABLE,
      6      "TRANS_TYPE_BI"      VARCHAR2(4 CHAR) NOT NULL ENABLE,
      7      "TRANS_TYPE_BI_SEQ"  NUMBER(*,0) NOT NULL ENABLE,
      8      "HDR_FIELDS_KEY"     VARCHAR2(30 CHAR) NOT NULL ENABLE,
      9      "HDR_FIELDS_BILL_BY" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    10      "ADJ_TRANS_TYPE"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    11      "CREATE_NEW_BILL"    VARCHAR2(1 CHAR) NOT NULL ENABLE,
    12      "TMP_BILL_FLG"       VARCHAR2(1 CHAR) NOT NULL ENABLE,
    13      "ENTRY_TYPE"         VARCHAR2(5 CHAR) NOT NULL ENABLE,
    14      "ENTRY_REASON"       VARCHAR2(5 CHAR) NOT NULL ENABLE,
    15      "ENTRY_EVENT"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
    16      "LOAD_STATUS_BI"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    17      "ERROR_STATUS_BI"    VARCHAR2(4 CHAR) NOT NULL ENABLE,
    18      "BUSINESS_UNIT"      VARCHAR2(5 CHAR) NOT NULL ENABLE,
    19      "BUSINESS_UNIT_GL"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
    20      "BILL_TO_CUST_ID"    VARCHAR2(15 CHAR) NOT NULL ENABLE,
    21      "ADDRESS_SEQ_NUM"    NUMBER(*,0) NOT NULL ENABLE,
    22      "BILL_TO_COPIES"     NUMBER(*,0) NOT NULL ENABLE,
    23      "CNTCT_SEQ_NUM"      NUMBER(*,0) NOT NULL ENABLE,
    24      "NAME1"              VARCHAR2(40 CHAR) NOT NULL ENABLE,
    25      "INTERUNIT_FLG"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    26      "BUSINESS_UNIT_TO"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
    27      "DIRECT_INVOICING"   VARCHAR2(1 CHAR) NOT NULL ENABLE,
    28      "RANGE_SELECTION_ID" VARCHAR2(30 CHAR) NOT NULL ENABLE,
    29      "BILL_SOURCE_ID"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
    30      "BILL_TYPE_ID"       VARCHAR2(3 CHAR) NOT NULL ENABLE,
    31      "BILL_CYCLE_ID"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
    32      "BILL_BY_ID"         VARCHAR2(10 CHAR) NOT NULL ENABLE,
    33      "PAYMENT_METHOD"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    34      "PYMNT_TERMS_CD"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    35      "BANK_CD"            VARCHAR2(5 CHAR) NOT NULL ENABLE,
    36      "BANK_ACCT_KEY"      VARCHAR2(4 CHAR) NOT NULL ENABLE,
    37      "BI_CURRENCY_CD"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    38      "BASE_CURRENCY"      VARCHAR2(3 CHAR) NOT NULL ENABLE,
    39      "CUR_RT_TYPE"        VARCHAR2(5 CHAR) NOT NULL ENABLE,
    40      "RATE_MULT"          NUMBER(15,8) NOT NULL ENABLE,
    41      "RATE_DIV"           NUMBER(15,8) NOT NULL ENABLE,
    42      "CUR_RT_SOURCE"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    43      "INVOICE_DT" DATE,
    44      "ACCOUNTING_DT" DATE,
    45      "ACCRUE_UNBILLED"    VARCHAR2(1 CHAR) NOT NULL ENABLE,
    46      "TARGET_INVOICE"     VARCHAR2(22 CHAR) NOT NULL ENABLE,
    47      "INVOICE"            VARCHAR2(22 CHAR) NOT NULL ENABLE,
    48      "DOC_TYPE"           VARCHAR2(8 CHAR) NOT NULL ENABLE,
    49      "CONSOL_SETID"       VARCHAR2(5 CHAR) NOT NULL ENABLE,
    50      "CONSOL_CUST_ID"     VARCHAR2(15 CHAR) NOT NULL ENABLE,
    51      "CONSOL_KEY"         VARCHAR2(22 CHAR) NOT NULL ENABLE,
    52      "INVOICE_TO_ADJ"     VARCHAR2(22 CHAR) NOT NULL ENABLE,
    53      "ADJ_DELTA_ACTION"   VARCHAR2(3 CHAR) NOT NULL ENABLE,
    54      "LINE_SEQ_TO_ADJ"    NUMBER(*,0) NOT NULL ENABLE,
    55      "LINE_SEQ_NUM"       NUMBER(*,0) NOT NULL ENABLE,
    56      "LINE_DST_SEQ_NUM"   NUMBER(*,0) NOT NULL ENABLE,
    57      "LINE_DFR_SEQ_NUM"   NUMBER(*,0) NOT NULL ENABLE,
    58      "LINE_UAR_SEQ_NUM"   NUMBER(*,0) NOT NULL ENABLE,
    59      "LAST_NOTE_SEQ_NUM"  NUMBER(*,0) NOT NULL ENABLE,
    60      "NOTES_SEQ_NUM"      NUMBER(*,0) NOT NULL ENABLE,
    61      "LINE_TYPE"          VARCHAR2(4 CHAR) NOT NULL ENABLE,
    62      "IDENTIFIER"         VARCHAR2(18 CHAR) NOT NULL ENABLE,
    63      "DESCR"              VARCHAR2(30 CHAR) NOT NULL ENABLE,
    64      "UNIT_OF_MEASURE"    VARCHAR2(3 CHAR) NOT NULL ENABLE,
    65      "QTY"                NUMBER(15,4) NOT NULL ENABLE,
    66      "ORIG_QTY"           NUMBER(15,4) NOT NULL ENABLE,
    67      "UNIT_AMT"           NUMBER(15,4) NOT NULL ENABLE,
    68      "LIST_PRICE"         NUMBER(15,4) NOT NULL ENABLE,
    69      "PPRC_PROMO_CD"      VARCHAR2(20 CHAR) NOT NULL ENABLE,
    70      "MERCH_TYPE"         VARCHAR2(10 CHAR) NOT NULL ENABLE,
    71      "TAX_CD"             VARCHAR2(8 CHAR) NOT NULL ENABLE,
    72      "TAX_EXEMPT_CERT"    VARCHAR2(30 CHAR) NOT NULL ENABLE,
    73      "TAX_EXEMPT_FLG"     VARCHAR2(1 CHAR) NOT NULL ENABLE,
    74      "TAX_EXEMPT_RC"      VARCHAR2(2 CHAR) NOT NULL ENABLE,
    75      "TAX_JOB_NUM"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
    76      "BI_TAX_TIMING"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    77      "CUSTOMER_GROUP"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
    78      "VAT_TXN_TYPE_CD"    VARCHAR2(4 CHAR) NOT NULL ENABLE,
    79      "TAX_CD_VAT"         VARCHAR2(8 CHAR) NOT NULL ENABLE,
    80      "VAT_APPLICABILITY"  VARCHAR2(1 CHAR) NOT NULL ENABLE,
    81      "VAT_PRODUCT_GROUP"  VARCHAR2(10 CHAR) NOT NULL ENABLE,
    82      "PROD_GRP_SETID"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    83      "IST_TXN_FLG"        VARCHAR2(1 CHAR) NOT NULL ENABLE,
    84      "IDENTIFIER_TBL"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    85      "SHIP_FROM_LOC"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
    86      "ORD_ACCEPT_LOC"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
    87      "ORD_ORIGIN_LOC"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
    88      "STORE_LOC"          VARCHAR2(10 CHAR) NOT NULL ENABLE,
    89      "TITLE_PASSAGE"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    90      "TAX_GROUP"          VARCHAR2(10 CHAR) NOT NULL ENABLE,
    91      "TAX_USER_AREA"      VARCHAR2(25 CHAR) NOT NULL ENABLE,
    92      "TAX_TRANS_TYPE"     VARCHAR2(1 CHAR) NOT NULL ENABLE,
    93      "TAX_TRANS_SUB_TYPE" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    94      "NET_EXTENDED_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    95      "GROSS_EXTENDED_AMT" NUMBER(26,3) NOT NULL ENABLE,
    96      "REV_RECOG_BASIS"    VARCHAR2(3 CHAR) NOT NULL ENABLE,
    97      "PROJECT_ID"         VARCHAR2(15 CHAR) NOT NULL ENABLE,
    98      "BUSINESS_UNIT_OM"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
    99      "ORDER_NO"           VARCHAR2(10 CHAR) NOT NULL ENABLE,
    100      "ORDER_INT_LINE_NO"  NUMBER(*,0) NOT NULL ENABLE,
    101      "SCHED_LINE_NBR"     NUMBER(*,0) NOT NULL ENABLE,
    102      "DEMAND_SOURCE"      VARCHAR2(2 CHAR) NOT NULL ENABLE,
    103      "DEMAND_LINE_NO"     NUMBER(*,0) NOT NULL ENABLE,
    104      "BUSINESS_UNIT_RMA"  VARCHAR2(5 CHAR) NOT NULL ENABLE,
    105      "RMA_ID"             VARCHAR2(10 CHAR) NOT NULL ENABLE,
    106      "RMA_LINE_NBR"       NUMBER(*,0) NOT NULL ENABLE,
    107      "PRODUCT_ID"         VARCHAR2(18 CHAR) NOT NULL ENABLE,
    108      "ORDER_DATE" DATE,
    109      "PO_REF"       VARCHAR2(30 CHAR) NOT NULL ENABLE,
    110      "PO_LINE"      NUMBER(*,0) NOT NULL ENABLE,
    111      "CONTRACT_NUM" VARCHAR2(25 CHAR) NOT NULL ENABLE,
    112      "CONTRACT_DT" DATE,
    113      "CONTRACT_TYPE"     VARCHAR2(15 CHAR) NOT NULL ENABLE,
    114      "CONTRACT_LINE_NUM" NUMBER(*,0) NOT NULL ENABLE,
    115      "FREIGHT_TERMS"     VARCHAR2(10 CHAR) NOT NULL ENABLE,
    116      "BILL_OF_LADING"    VARCHAR2(30 CHAR) NOT NULL ENABLE,
    117      "COUNTRY_SHIP_FROM" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    118      "COUNTRY_SHIP_TO"   VARCHAR2(3 CHAR) NOT NULL ENABLE,
    119      "SHIP_TO_CUST_ID"   VARCHAR2(15 CHAR) NOT NULL ENABLE,
    120      "SHIP_TO_ADDR_NUM"  NUMBER(*,0) NOT NULL ENABLE,
    121      "SHIP_ID"           VARCHAR2(10 CHAR) NOT NULL ENABLE,
    122      "SHIP_TYPE_ID"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
    123      "SHIP_FROM_BU"      VARCHAR2(5 CHAR) NOT NULL ENABLE,
    124      "SHIP_DATE" DATE,
    125      "SHIP_TIME" TIMESTAMP (6),
    126      "PACKSLIP_NO"      VARCHAR2(22 CHAR) NOT NULL ENABLE,
    127      "LC_ID"            VARCHAR2(12 CHAR) NOT NULL ENABLE,
    128      "LOC_DOC_ID"       VARCHAR2(15 CHAR) NOT NULL ENABLE,
    129      "SEQUENCE_NBR"     NUMBER(*,0) NOT NULL ENABLE,
    130      "SOLD_TO_CUST_ID"  VARCHAR2(15 CHAR) NOT NULL ENABLE,
    131      "SOLD_TO_ADDR_NUM" NUMBER(*,0) NOT NULL ENABLE,
    132      "BUSINESS_UNIT_PC" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    133      "BUSINESS_UNIT_CA" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    134      "RT_EFFDT" DATE,
    135      "BILL_PLAN_ID"      VARCHAR2(10 CHAR) NOT NULL ENABLE,
    136      "PC_DISTRIB_STATUS" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    137      "BPLAN_LN_NBR"      NUMBER(*,0) NOT NULL ENABLE,
    138      "EVENT_OCCURRENCE"  NUMBER(*,0) NOT NULL ENABLE,
    139      "XREF_SEQ_NUM"      NUMBER(*,0) NOT NULL ENABLE,
    140      "CONTRACT_PPD_SEQ"  NUMBER(*,0) NOT NULL ENABLE,
    141      "ANALYSIS_TYPE"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    142      "RESOURCE_ID"       VARCHAR2(40 CHAR) NOT NULL ENABLE,
    143      "RESOURCE_TYPE"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    144      "RESOURCE_CATEGORY" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    145      "RESOURCE_SUB_CAT"  VARCHAR2(5 CHAR) NOT NULL ENABLE,
    146      "ACTIVITY_ID"       VARCHAR2(15 CHAR) NOT NULL ENABLE,
    147      "ACTIVITY_TYPE"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    148      "DIST_CFG_FLAG"     VARCHAR2(1 CHAR) NOT NULL ENABLE,
    149      "PRODUCT_KIT_ID"    VARCHAR2(18 CHAR) NOT NULL ENABLE,
    150      "SYSTEM_SOURCE"     VARCHAR2(3 CHAR) NOT NULL ENABLE,
    151      "EMPLID"            VARCHAR2(11 CHAR) NOT NULL ENABLE,
    152      "EMPL_RCD"          NUMBER(*,0) NOT NULL ENABLE,
    153      "START_DT" DATE,
    154      "END_DT" DATE,
    155      "FROM_DT" DATE,
    156      "TO_DT" DATE,
    157      "SERVICE_CUST_ID"    VARCHAR2(15 CHAR) NOT NULL ENABLE,
    158      "SERVICE_ADDR_NUM"   NUMBER(*,0) NOT NULL ENABLE,
    159      "NOTE_TYPE"          VARCHAR2(10 CHAR) NOT NULL ENABLE,
    160      "STD_NOTE_FLAG"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    161      "INTERNAL_FLAG"      VARCHAR2(1 CHAR) NOT NULL ENABLE,
    162      "HDR_OR_LINE_NOTE"   VARCHAR2(1 CHAR) NOT NULL ENABLE,
    163      "AR_LVL"             VARCHAR2(1 CHAR) NOT NULL ENABLE,
    164      "AR_DST_OPT"         VARCHAR2(1 CHAR) NOT NULL ENABLE,
    165      "GL_LVL"             VARCHAR2(1 CHAR) NOT NULL ENABLE,
    166      "ENABLE_DFR_REV_FLG" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    167      "BILLING_SPECIALIST" VARCHAR2(8 CHAR) NOT NULL ENABLE,
    168      "BILLING_AUTHORITY"  VARCHAR2(8 CHAR) NOT NULL ENABLE,
    169      "BILLING_FREQUENCY"  VARCHAR2(3 CHAR) NOT NULL ENABLE,
    170      "BILL_INQUIRY_PHONE" VARCHAR2(24 CHAR) NOT NULL ENABLE,
    171      "SALES_PERSON"       VARCHAR2(8 CHAR) NOT NULL ENABLE,
    172      "COLLECTOR"          VARCHAR2(8 CHAR) NOT NULL ENABLE,
    173      "CR_ANALYST"         VARCHAR2(8 CHAR) NOT NULL ENABLE,
    174      "INVOICE_FORM_ID"    VARCHAR2(10 CHAR) NOT NULL ENABLE,
    175      "STD_NOTE_CD"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
    176      "TOT_LINE_DST_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    177      "TOT_LINE_DST_PCT"   NUMBER(5,2) NOT NULL ENABLE,
    178      "TOT_LINE_DFR_PCT"   NUMBER(5,2) NOT NULL ENABLE,
    179      "TOT_LINE_DFR_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    180      "TOT_LINE_UAR_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    181      "TOT_LINE_UAR_PCT"   NUMBER(5,2) NOT NULL ENABLE,
    182      "SSN"                VARCHAR2(9 CHAR) NOT NULL ENABLE,
    183      "CHARGE_FROM_DT" DATE,
    184      "CHARGE_TO_DT" DATE,
    185      "SUBCUST_QUAL1"      VARCHAR2(15 CHAR) NOT NULL ENABLE,
    186      "SUBCUST_QUAL2"      VARCHAR2(15 CHAR) NOT NULL ENABLE,
    187      "REIMB_AGREEMENT"    VARCHAR2(25 CHAR) NOT NULL ENABLE,
    188      "TOT_DISCOUNT_AMT"   NUMBER(26,3) NOT NULL ENABLE,
    189      "TOT_SURCHARGE_AMT"  NUMBER(26,3) NOT NULL ENABLE,
    190      "ACCUMULATE"         VARCHAR2(1 CHAR) NOT NULL ENABLE,
    191      "VAT_TREATMENT_GRP"  VARCHAR2(4 CHAR) NOT NULL ENABLE,
    192      "COUNTRY_VAT_BILLFR" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    193      "COUNTRY_VAT_BILLTO" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    194      "VAT_TREATMENT"      VARCHAR2(4 CHAR) NOT NULL ENABLE,
    195      "PHYSICAL_NATURE"    VARCHAR2(1 CHAR) NOT NULL ENABLE,
    196      "COUNTRY_LOC_BUYER"  VARCHAR2(3 CHAR) NOT NULL ENABLE,
    197      "STATE_LOC_BUYER"    VARCHAR2(6 CHAR) NOT NULL ENABLE,
    198      "COUNTRY_LOC_SELLER" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    199      "STATE_LOC_SELLER"   VARCHAR2(6 CHAR) NOT NULL ENABLE,
    200      "VAT_SVC_SUPPLY_FLG" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    201      "VAT_SERVICE_TYPE"   VARCHAR2(1 CHAR) NOT NULL ENABLE,
    202      "COUNTRY_VAT_PERFRM" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    203      "STATE_VAT_PERFRM"   VARCHAR2(6 CHAR) NOT NULL ENABLE,
    204      "COUNTRY_VAT_SUPPLY" VARCHAR2(3 CHAR) NOT NULL ENABLE,
    205      "STATE_VAT_SUPPLY"   VARCHAR2(6 CHAR) NOT NULL ENABLE,
    206      "STATE_SHIP_FROM"    VARCHAR2(6 CHAR) NOT NULL ENABLE,
    207      "STATE_SHIP_TO"      VARCHAR2(6 CHAR) NOT NULL ENABLE,
    208      "MAST_CONTR_ID"      VARCHAR2(25 CHAR) NOT NULL ENABLE,
    209      "TAX_CUST_ID"        VARCHAR2(15 CHAR) NOT NULL ENABLE,
    210      "BUSINESS_UNIT_AM"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
    211      "BUSINESS_UNIT_AMTO" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    212      "ASSET_ID"           VARCHAR2(12 CHAR) NOT NULL ENABLE,
    213      "PROFILE_ID"         VARCHAR2(10 CHAR) NOT NULL ENABLE,
    214      "COST_TYPE"          VARCHAR2(1 CHAR) NOT NULL ENABLE,
    215      "STATE_VAT_DEFAULT"  VARCHAR2(6 CHAR) NOT NULL ENABLE,
    216      "SO_ID"              VARCHAR2(15 CHAR) NOT NULL ENABLE,
    217      "BUSINESS_UNIT_RF"   VARCHAR2(5 CHAR) NOT NULL ENABLE,
    218      "SOURCE_REF_TYPE"    VARCHAR2(3 CHAR) NOT NULL ENABLE,
    219      "SOURCE_REF_NO"      VARCHAR2(35 CHAR) NOT NULL ENABLE,
    220      "SOURCE_REF_KEY"     VARCHAR2(5 CHAR) NOT NULL ENABLE,
    221      "USER_AMT1"          NUMBER(26,3) NOT NULL ENABLE,
    222      "USER_AMT2"          NUMBER(26,3) NOT NULL ENABLE,
    223      "USER_DT1" DATE,
    224      "USER_DT2" DATE,
    225      "USER1" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    226      "USER2" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    227      "USER3" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    228      "USER4" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    229      "USER5" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    230      "USER6" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    231      "USER7" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    232      "USER8" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    233      "USER9" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    234      "SETID" VARCHAR2(5 CHAR) NOT NULL ENABLE,
    235      "ADD_DTTM" TIMESTAMP (6),
    236      "LAST_UPDATE_DTTM" TIMESTAMP (6),
    237      "DELETE_ROWS" VARCHAR2(1 CHAR) NOT NULL ENABLE,
    238      "BOOK"        VARCHAR2(10 CHAR) NOT NULL ENABLE,
    239      "DTTM_STAMP" TIMESTAMP (6),
    240      "VAT_RVRSE_CHG_GDS"  VARCHAR2(1 CHAR) NOT NULL ENABLE,
    241      "TAX_CD_VAT_RVC"     VARCHAR2(8 CHAR) NOT NULL ENABLE,
    242      "TAX_CD_VAT_RVC_PCT" NUMBER(7,4) NOT NULL ENABLE,
    243      "VAT_AMT_RVC"        NUMBER(26,3) NOT NULL ENABLE,
    244      "VAT_AMT_RVC_BSE"    NUMBER(26,3) NOT NULL ENABLE,
    245      "VAT_AMT"            NUMBER(26,3) NOT NULL ENABLE,
    246      "VAT_AMT_BSE"        NUMBER(26,3) NOT NULL ENABLE,
    247      "TAX_CD_VAT_PCT"     NUMBER(7,4) NOT NULL ENABLE
    248    )
    249    SEGMENT CREATION DEFERRED PCTFREE 10 PCTUSED 80 INITRANS 1 MAXTRANS 255 N
    OCOMPRESS LOGGING STORAGE
    250    (
    251      INITIAL 16384 NEXT 16384 MAXEXTENTS 2147483645 PCTINCREASE 0
    252    )
    253    TABLESPACE "AMAPP" ;
    Table created.
    Elapsed: 00:00:00.76
    SQL> CREATE UNIQUE INDEX "SYSADM"."DRIVERTEST1" ON "SYSADM"."DRIVERTEST"
      2    (
      3      "PROCESS_INSTANCE", "INTFC_ID", "INTFC_LINE_NUM", "TRANS_TYPE_BI", "TRA
    NS_TYPE_BI_SEQ"
      4    )
      5    PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
      6    (
      7      INITIAL 16384 NEXT 106496 MAXEXTENTS 2147483645 PCTINCREASE 0
      8    )
      9    TABLESPACE "PSINDEX" ;
    Index created.
    Elapsed: 00:00:00.04
    SQL>
    SQL> drop table DRIVERTEST;
    Table dropped.
    Elapsed: 00:00:24.90This is Oracle 11.2.0.3 Enterprise on Windows 64bit.
    Thank you for any input.

    >
    Then I hope this is an academic question (and I understand wanting to answer a question from a purely academic standpoint).
    Because ... dropping tables and recreating them -- especially with different structures should be a one-time operation. It would be very easy to spend more time trying to reduce the run time than the non-optimal run time takes. From a business standpoint, it costs more to find a solution than the problem itself is costing. And I'd bet you've already crossed that threshold.
    But again, even without a real business problem, it is sometimes worth while to pursue an answer just so you'll have a better understanding of the processes involved.
    >
    Yes, it is only meant to be run once in a prod environment, eventually. At this point, I'm trying to reduce the execution time to give me options in case I only get a limited maintenance window. Granted, I could have it run for a longer period of time, but it's nice to know of workarounds. After all, this particular script is one of many.
    But in a test enviornment? I can run this as many times as I like without affecting anyone. So yes, it is at least 50% curiosity to see if it is possible, but if it provides me with a solution I decide is worth the saved time, then I'll be a happy camper.

  • Drop tables

    when i say
    drop table tablename
    i am getting error message
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01031: insufficient privileges
    i am having linux 4 and 10g db
    what could be the reson.
    i am not able to drop any objects frmo the db
    please help in this regard

    Hi,
    Can be a "before drop" database trigger ...
    C:\>sqlplus system/manager
    SQL*Plus: Release 10.2.0.1.0 - Production on Sat Feb 23 18:19:33 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SYSTEM@XE> create or replace trigger nodrop before drop on database
      2  begin
      3     if user = 'TEST' then
      4       raise_application_error(-20001,'You don't have permission to perform this operation.');
      5     end if;
      6  end;
      7  /
    Trigger created.
    SYSTEM@XE> connect test/test;
    Connected.
    TEST@XE> create table z (id number);
    Table created.
    TEST@XE> drop table z;
    drop table z
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20001: You don't have permission to perform this operation.
    ORA-06512: at line 3
    Or the current connected user has not the "drop any table" system privilege ...
    SYSTEM@XE> create user adam identified by adam;
    User created.
    SYSTEM@XE> grant connect to adam;
    Grant succeeded.
    SYSTEM@XE> connect test/test
    Connected.
    TEST@XE> grant all on z to adam;
    Grant succeeded.
    TEST@XE> connect adam/adam;
    Connected.
    ADAM@XE> drop table test.z;
    drop table test.z
    ERROR at line 1:
    ORA-01031: insufficient privilegesCheers
    Legatti

  • Cannot Drop Table that Shows in dba_tables

    In my IDE I see two tables that I no longer need. I created them as a test to see the difference between LOGGING vs NOLOGGING. Now I want to drop the tables.
    I issue the command drop table customers_no_logging.
    The system responds with ORA-00942: table or view does not exist.
    However, select table_name from dba_tables returns the table names in question.
    Even in sqlplus I get the same result:
    SQL> select table_name from dba_tables where owner = 'RUB';
    TABLE_NAME
    CUSTOMERS
    INV_ITEM_MASTER
    INV_SITE
    CUSTOMERS_w_log
    CUSTOMERS_no_log
    5 rows selected.
    SQL> drop table CUSTOMERS_no_log;
    drop table CUSTOMERS_no_log
    ERROR at line 1:
    ORA-00942: table or view does not exist
    How can I drop these tables?
    Thanks,
    Gregory

    I was connected as RUB in my IDE and SYS in SQLPlus.
    I have connected as RUB in SQLPlus and tried
    SQL> drop table "RUB.CUSTOMERS_no_log";
    drop table "RUB.CUSTOMERS_no_log"
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Maybe I need to stop and restart the DB?
    Gregory

  • Oracle table creation/script help

    Having a hard time running my script. Essentially I have to create a few table entries into the 3 tables shown in my E/R Diagram and create the "Personnel Emergency Vehicle Shelter" table using the primary keys from the other three tables as a foreign key.
    http://img7.imageshack.us/img7/6443/dynamicenies.png
    notepad+ doesn't have anything for Oracle only SQL.
    drop table emergency_vehicle;
    create table emergency_vehicle(
    e_veh_ID varchar2(8) primary key,
    e_veh_plate varchar2(8),
    e_veh_registered_owner varchar2(50),
    e_veh_make varchar2(50),
    e_veh_model varchar2(50)
    insert into emergency_vehicle values
    ('veh00001','ABA12345','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00002','ANA56844','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00003','TEST8408','City Fire Department','MACK','Model 95');
    insert into emergency_vehicle values
    ('veh00004','EMRGNCEE','City Police Department','Dodge','Charger');
    select * from emergency_vehicle;
    drop table shelter;
    create table shelter(
    shelter_ID varchar2(8) primary key,
    shelter_location varchar2(100),
    shelter_description varchar2(50),
    insert into shelter values
    ('she00001','1660 Main Street','This is the General hospital for the city');
    insert into shelter values
    ('she00002',’100 Wayne Drive’,’Red Cross location #808’);
    insert into shelter values
    ('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’);
    select * from shelter;
    drop table first_responders;
    create table first_responders(
    first_responder_ID varchar2(8) primary key,
    first_responder_name varchar2(50),
    first_responder_function varchar2(50),
    insert into first_responders values
    ('FRP00001',’Jack Smith’,’EMT’);
    insert into first_responders values
    ('FRP00002',’Officer Kimble’,’Police Officer’);
    insert into first_responders values
    ('FRP00003',’John Matthews’,’Firemen’);
    select * from first_responder;

    Using this code
    drop table emergency_vehicle;
    create table emergency_vehicle(
    e_veh_ID varchar2(8) primary key,
    e_veh_plate varchar2(8),
    e_veh_registered_owner varchar2(50),
    e_veh_make varchar2(50),
    e_veh_model varchar2(50)
    insert into emergency_vehicle values
    ('veh00001','ABA12345','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00002','ANA56844','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00003','TEST8408','City Fire Department','MACK','Model 95');
    insert into emergency_vehicle values
    ('veh00004','EMRGNCEE','City Police Department','Dodge','Charger');
    select * from emergency_vehicle;
    drop table shelter;
    create table shelter(
    shelter_ID varchar2(8) primary key,
    shelter_location varchar2(100),
    shelter_description varchar2(50)
    insert into shelter values('she00001','1660 Main Street','This is the General hospital for the city');
    insert into shelter values('she00002',’100 Wayne Drive’,’Red Cross location #808’);
    insert into shelter values('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’);
    select * from shelter;
    drop table first_responders;
    create table first_responders(
    first_responder_ID varchar2(8) primary key,
    first_responder_name varchar2(50),
    first_responder_function varchar2(50)
    insert into first_responders values('FRP00001',’Jack Smith’,’EMT’);
    insert into first_responders values('FRP00002',’Officer Kimble’,’Police Officer’);
    insert into first_responders values('FRP00003',’John Matthews’,’Firemen’);
    select * from first_responder;
    generates these results
    Table dropped.
    Table created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    E_VEH_ID     E_VEH_PLATE     E_VEH_REGISTERED_OWNER     E_VEH_MAKE     E_VEH_MODEL
    veh00001     ABA12345     General Hospital     FORD     E-350
    veh00002     ANA56844     General Hospital     FORD     E-350
    veh00003     TEST8408     City Fire Department     MACK     Model 95
    veh00004     EMRGNCEE     City Police Department     Dodge     Charger
    Table dropped.
    Table created.
    1 row created.
    insert into shelter values('she00002',’100 Wayne Drive’,’Red Cross location #808’)
    ERROR at line 1:
    ORA-00911: invalid character
    insert into shelter values('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’)
    ERROR at line 1:
    ORA-00911: invalid character
    SHELTER_ID     SHELTER_LOCATION     SHELTER_DESCRIPTION
    she00001     1660 Main Street     This is the General hospital for the city
    drop table first_responders
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Table created.
    ('FRP00001',’Jack Smith’,’EMT’)
    ERROR at line 2:
    ORA-00911: invalid character
    ('FRP00002',’Officer Kimble’,’Police Officer’)
    ERROR at line 2:
    ORA-00911: invalid character
    ('FRP00003',’John Matthews’,’Firemen’)
    ERROR at line 2:
    ORA-00911: invalid character
    no rows selected
    Now I don't even see anything for the 2nd or 3rd entry on first table, and nothing for 3rd Table
    Edited by: 875149 on Jul 26, 2011 2:48 PM

  • Capture DB Table and column comments when creating new Business Area/Folder

    Does anyone know if it is possible to pull the DB table and column comments into Discoverer when creating new Business Area/Folders? Our developers take the time to put the information in the Db data dictionary and we would like to leverage it (reduce need for manually adding descriptions) ... has anyone done this?
    If there isn't a way to automatically do it, would there be any harm in using a sql script to populate the description fields from the DB data dictionary directly into the EUL tables appropriate?
    I have been searching through documentation and forums for information - with no luck at this point.
    Thanks!

    Hi Seymour
    You can add column comments to views as well, as this example will show:
    CREATE OR REPLACE FORCE VIEW MY_SEQUENCE
    (SEQ_ID, SEQ_NAME, SEQ_NEXTVAL)
    AS
    SELECT "SEQ_ID","SEQ_NAME","SEQ_NEXTVAL" FROM EUL5_SEQUENCES;
    COMMENT ON COLUMN MY_SEQUENCE.SEQ_NAME IS 'The sequence';
    So you could add the comments at the view level and then refresh Discoverer.
    Best wishes
    Michael

  • Getting return value from sqlplus script while running a unix job

    I am trying to run a unix script that calls sqlplus. The following code outlines the unix/sql code that I trying to execute:
    return_count=`sqlplus $ORACLE_ID/$ORACLE_PWD@$ORACLE_SID <<EOF | grep '^RETURN_VAL' | sed 's/^RETURN_VAL//'
    SET SERVEROUTPUT ON
    VARIABLE ReturnValue NUMBER
    EXEC :ReturnValue := 1
    BEGIN
    UPDATE seq_control_nbr
    SET table_seq_nbr = table_seq_nbr + 1,
    last_updt_dttmstp = systimestamp,
    last_updt_user_id = 'ECVMSONS'
    WHERE table_key = 'ONSTAR';
    IF SQL%ROWCOUNT = 1 THEN
    COMMIT;
    :ReturnValue := 0;
    ELSE
    ROLLBACK;
    :ReturnValue := 99;
    END IF;
    DBMS_OUTPUT.PUT_LINE ('RETURN_VAL '||:ReturnValue);
    END;
    EXIT
    EOF`
    The above outlined sqlplus script does run because the values on the table are updated. However, I cannot get the value of ReturnValue to be displayed, so it can be returned to the unix script.
    Any ideas?

    ok do the following:-
    return_count=`sqlplus $ORACLE_ID/$ORACLE_PWD@$ORACLE_SID <<EOF
    SET SERVEROUTPUT ON
    whenever OSERROR exit 1
    whenever SQLERROR exit 2
    UPDATE seq_control_nbr
    SET table_seq_nbr = table_seq_nbr + 1,
    last_updt_dttmstp = systimestamp,
    last_updt_user_id = 'ECVMSONS'
    WHERE table_key = 'ONSTAR';
    EXIT
    EOF`
    rowsupdated=`echo $return_count|cut -f1 -d' '`
    echo "Rows updated =" $rowsupdated
    retcode=`echo $?`
    case "$retcode" in
    0) echo "Update executed successfully on " ;;
    1) echo "Update failed OSERROR ";;
    2) echo "Update failed SQLError " ;;
    *) echo "Update failed - Unknown Error ";;
    esac

Maybe you are looking for

  • Is Apple allow core plot framework to draw Pie chart in iPhone application?

    Is Apple allow core plot framework to draw Pie chart in iPhone application? http://code.google.com/p/core-plot/wiki/AppsUsingCorePlot

  • Inventory Management Setup Table MC03BF0SETUP

    Is there a limit to the number of records this setup table (MC03BF0SETUP) can hold? I am in the process of rebuilding InfoCube 0IC_C03. Thanks, Brendan.

  • Tools for Photosmart Premium printer

    My old photosmart 2410 had tools: (clean, allign, etc.) which I can't find on my Photosmart Premium???.  I refilled ink cartridges and used the tools after reinserting. ....is there a way on my new printer to access "tools"????? 

  • Edited IP Address changes to 0.0.0.0

    I support our clients with ARD and two of them now have the following problem: Each has a router, with the appropriate ports forwarded. I have the appropriate user id's and passwords to log in. I have done so successfully to these machines in the pas

  • Como tirar a cor cinza no iCloud

    iCloud está na cor cinza e quero tirar essa cor.Como faço? Estou querendo acessar o iCloud e não estou cnseguindo por causa da cor cinza. Obrigada e aguardo resposta urgente. Ah, a resposta vai para o meu email?Porque já fiz perguntas anteriormente e