Cannot Drop table with lower case name
Hi,
One of my developer created a table through application in oracle 10g R2,
when I list tables
select * from tab;
the table name is shown in lower case or Initcap.
I cannot drop or manipulate that table.
How can I drop that table(s)?
Thanks & Regards,
Fahim
use the same case what your table has used and put double quotes on both sides for example if your table is lower case use like:
DROP TABLE "your_table";HTH
Ghulam Mustafa Butt
Similar Messages
-
How can I check if there is a table with the given name ?
I'm using 8i and 9i.
Could anybody teach me how to check if there is a table with a certain name in SQLPLUS without using SELECT
statement ?
I want to use the following logical procedure.
if exists "table_to_be_deleted" then drop table "table_to_be_deleted"
Or, is there any system table that I can check the names of tables like
count = select "table_to_be_deleted" from "an_oracle_system_table"
if ( count != 0 ) then drop table "table_to_be_deleted"
Thanks,
JohnJust create it, but be aware that DDLs can't be executed directly from Pl/Sql, so you'll have to use dynamic Sql, e.g. :
SQL> create table test(a number);
Table created.
SQL> begin
2 drop table test;
3 exception
4 when others then
5 null;
6 end;
SQL> /
drop table test;
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00103: Encountered the symbol "DROP" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe
SQL> ed
Wrote file afiedt.buf
1 begin
2 execute immediate 'drop table test';
3 exception
4 when others then
5 null;
6* end;
SQL> /
PL/SQL procedure successfully completed.
SQL>Now the table does not exist anymore, but further executions will not generate errors, due to the exception handler :
SQL> desc test
ERROR:
ORA-04043: object test does not exist
SQL> /
PL/SQL procedure successfully completed.
SQL> -
Finding a table with a like %name% in a schema
What is the query I should use to find a table with a like %name% in a schema?
Thank you for any helpselect * from all_tables
where owner = 'YOUR_SCHEMA' and lower(table_name) like '%name%'
/Regards
Dmytro -
Dear All,
I created one table like
create table cls_lrn_tab_unique (F_no number unique UK_F_NO );
after performing some operations I want to delete the same.
At that time i got following error. Please help me and tell what is the reason for the error.
ORA-00604 error occured at recursive level1
ORA-20123 Insufficient privileges: you cannot drop table cls_lrn_tab_unique TABLE,
ORA-06512 at line no 2
Thanks and Regards
Prasad26bffcad-f9a2-4dcf-afa0-e1e33d0281bf wrote:
Dear All,
I created one table like
create table cls_lrn_tab_unique (F_no number unique UK_F_NO );
after performing some operations I want to delete the same.
At that time i got following error. Please help me and tell what is the reason for the error.
ORA-00604 error occured at recursive level1
ORA-20123 Insufficient privileges: you cannot drop table cls_lrn_tab_unique TABLE,
ORA-06512 at line no 2
Thanks and Regards
Prasad
ORA-20123 is a localized/customized error code & message; therefore any solution depends upon what is unique inside your DB now.
I suspect that some sort of TRIGGER exists, which throws posted error, but this is just idle speculation on my part.
How do I ask a question on the forums?
https://forums.oracle.com/message/9362002#9362002 -
Is it possible to have 2 tables with the same name in an Orable database?
Hello,
I'm a complete Oracle newbie so please excuse my question if it's stupid.
I was trying to create 2 tables with the same name using different tablespaces but it does not seem to work. Like this (second time just change the name of the tablespace):
CREATE TABLE test_tbl (
id INTEGER,
status VARCHAR2(10),
last_modified DATE DEFAULT SYSDATE
TABLESPACE tblspc1Is it in general in Oracle possible to acquire this goal?
Thanks a lot!
P.S. I have already created the needed tablespaces
CREATE TABLESPACE tblspc1 DATAFILE 'tblspc1.dbf' SIZE 10MEdited by: 808239 on 02-Mar-2011 02:18It is not possible to create two tables with same name in same schema.
A user can own one schema with his own name and another with the schema name SYS.
For this you have to grant sysdba privilage to the user and then have to connect using sys password or with the password specified in password file.
But this still you have to access to the table in sys schema using sys.table_name.
Hope Answered tthe Question. -
Reference all tables with the same name
If I have multiple worksheets that each have an identically structured table "Test", is it possible to create a formula in a cell of another worksheet that references the same range of cells in every table "Test"? So far I haven't found a way to reference cells in a table with an ambiguous name without having to prepend the worksheet name to the reference like so: 'Worksheet 1' :: Test :: B3:C4. What I want to be able to do is say Test :: B3:C4 and have the formula reference B3:C4 in all "Test" tables.
Thanks!You've picked the correct descriptive term. Such a reference would indeed be "ambiguous".
You might be able to reference a set of disconnected ranges of cells, but each range would have to be explicitly described.
You might be able to collect the values in the cells into a single array in a single table, then reference that array in your formula.
Regards,
Barry
PS: "Sheets" in Numbers have little in common with "Worksheets" in MS Excel. Using the Numbers vocabulary can help keep the distinction more clear, and avoid unwarranted expectations.
B. -
In Pages capitalization doesn't work as described. One can start with lower case and change to upper, but changing from upper case to any of the other options doesn't work. Is there a way around this or is this just a glitch that needs fixing?
I think it does work as described, but the description is not very complete. Capitalization does not change any of the characters that you type; what it does is allow some of the lower case characters to display as capitals. If you copy the result and paste it as plain text, you'll see that the lower case characters are still there. It doesn't actually say anywhere that it can make capitals display as lower case, and it can't.
The obvious way around this is to actually type what you want.
The more powerful way is to install WordService from Devon Technologies which adds the functionality of Pages' capitalization menu as well a lot of other ones. WordService actually changes the character to the one displayed, and it works in most of the applications on your Mac. -
Many to many join table with different column names
Hi have a joint table with different column names as foreign keys in the joining
tables...
e.g. i have a many to many reltnshp btwn Table A and Table B ..and join table
C
both have a column called pk.
and the join table C has columns call fk1 and fk2
does cmd require the same column name in the join table as in the joining table?
are there any workarounds?
thanksHI,
No, the foreign key column names in the join table do not have to match the primary
key names in the joined tables.
-thorick -
Importing table with mixed case on MySQL
I am trying to import a table form MySQL 5.0. Two tables exist with the same name, with first letter capital in one and all lower case in the other (ex. Jobdetails, jobdetails). After hitting the Show ATL button on the data source, all case sensitive settings are Yes. The table with the first letter capital is always imported no matter which table is selected. I can't import the lower case table. I am on Data Services 12.2.
Edited by: Russell Atwood on Feb 8, 2012 2:28 PMI have found that patchSet 9.2.0.3 fixes some bugs in Oracle Text.
One of them is Bug 2684307: "Mixed tokens not uppercased with BASE_LETTER in multibyte database". That's exactly the problem i am dealing with.
I will proceed to install this patchSet and verify that this does not happend anymore. -
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?
CheersC:\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 -
Dynamic creation of table with variable field-names
HI
I am looking for a way in order to create a table during runtime. The problem is that the field names of the table are provided in another table.
TO illustrate the case at hand, an example:
The initial table contains the fields
UserID - attribut_name - attribute_value
Example Data
d00587 - first_name - Jon
d00587 - last_name - Smith
d00587 - age - 48
d00127 - first_name - Jack
d00127 - last_name - Daniels
d00127 - position - Manager
Now I need to create a table per User that looks as follows:
for user d00587
first_name - last_name - age
**Values
Jon - Smith - 48
for user d00127
first_name - last_name - positioin
Jack - Daniels - Manager
I split the initial table by sorting it according to userID and then looping into an itab with an AT END OF userid, thus I receive the table per user:
Example iTab
UserID - attribut_name - attribute_value
Example Data
d00587 - first_name - Jon
d00587 - last_name - Smith
d00587 - age - 48
However I have no clue on how to create a new internal table with field-names = attribute_name.
Does anybody have an idea or example code for this?
Thanks a lot for your help,
Kind regards,
MingoloHello Minima
Here is some sample coding:
DATA:
gt_fcat type lvc_t_fcat,
gdo_data TYPE REF TO data.
FIELD-SYMBOLS:
<gt_itab> TYPE table.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'MARA'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
CHANGING
ct_fieldcat = gt_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
* I_STYLE_TABLE =
it_fieldcatalog = gt_fcat
IMPORTING
ep_table = gdo_data
* E_STYLE_FNAME =
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ASSIGN gdo_data->* TO <gt_itab>.
In your case, you would call the function module with your tables (D00587, D00127). Remove all fields from the fieldcatalog that you do not need before calling the static method.
Regards
Uwe -
View of tables with double column names
Hello,
my problem is that in my database schema the name of the primary-key-column in one table has the same name as the corresponding foreign key-column in another table. Now i want to create a view of those two tables and get an error (double column names).
Is there any chance to avoid this error without rename all my column names (cause this happens many many times)?
Thanks for any help.
ChristophHi,
In SQL you cas prefix the column with its data container. Use this and it'll be OK. This is not an error, it's expected and absolutely normal behaviour.
SQL> desc dual
Name Null? Type
DUMMY VARCHAR2(1)
SQL> select D1.DUMMY, D2.DUMMY
2 FROM DUAL D1, DUAL D2
3 WHERE D1.DUMMY = D2.DUMMY;
D D
X XRegards,
Yoann. -
Stored Procedure to delete a number of tables with a common name attribute
Hi All,
This is my first post so I hope I have posted to the required level with sufficient information. This is my first stored procedure (SP) and is for Oracle 10.
I am trying to write a script to delete 11 tables and some rows from another 3 tables, all of which are named with a number that I would like to input at the point of creation of the SP. Below is the script I have written and edited. My original has been lost by crashing servers!
When I run the script it gives me the following output:
"Warning: execution complete with warning
procedure ScenarioDelete compiled"
The SP hasn't deleted any of the tables and I'm not sure if it's because my script is poor or because of something else. Any help is greatly appreciated!!
-- table delete SP
-- Run begin ScenarioDelete ('x'); with x as the ScenarioId
create or replace procedure ScenarioDelete (ScenarioNo IN varchar2);
countstable := 'C_' || ScenarioNo;
changetable := 'CG_' || ScenarioNo;
countsinfotable := 'CI_' || ScenarioNo;
datatable1 := 'D_0_' || ScenarioNo;
datatable2 := 'D_1_' || ScenarioNo;
datatable3 := 'D_2_' || ScenarioNo;
hietable1 := 'HI_0_' || ScenarioNo;
hietable2 := 'HI_1_' || ScenarioNo;
hietable3 := 'HI_2_' || ScenarioNo;
hielinktable1 := 'HL_1_' || ScenarioNo;
hielinktable2 := 'HL_2_' || ScenarioNo;
AS
execute immediate 'drop table ' || countstable;
execute immediate 'drop table ' || changetable;
execute immediate 'drop table ' || countsinfotable;
execute immediate 'drop table ' || datatable1;
execute immediate 'drop table ' || datatable2;
execute immediate 'drop table ' || datatable3;
execute immediate 'drop table ' || hietable1;
execute immediate 'drop table ' || hietable2;
execute immediate 'drop table ' || hietable3;
execute immediate 'drop table ' || hielinktable1;
execute immediate 'drop table ' || hielinktable2;
execute immediate 'delete from USERACESS where SCENARIOID = ' || ScenarioNo;
execute immediate 'delete from SCENARIO where SCENARIOID = ' || ScenarioNo;
execute immediate 'delete from SCENARIOINFO where SCENARIOID = ' || ScenarioNo;
-- or --
execute immediate 'delete from USERACESS where SCENARIOID = '' || ScenarioNo || ''';
execute immediate 'delete from SCENARIO where SCENARIOID = '' || ScenarioNo || ''';
execute immediate 'delete from SCENARIOINFO where SCENARIOID = '' || ScenarioNo || ''';
END;Hi,
Welcome to the forum!
When you compile a stored procedure, you get only the vaguest of error messages by default.
Always say SHOW ERRORS immediately after compiling, to get more detailed error messages. (And, of course, post the complete error message, including line number, when you need help.)
Remember to specify a datatype (and, in the case of VARCHAR2 variables, a maximum length) for all local variables you declare:
create or replace procedure ScenarioDelete (ScenarioNo IN varchar2) -- no semicolon here
AS -- AS or IS (it doesn't matter which) required here
countstable VARCHAR2 (50) := 'C_' || ScenarioNo;
changetable VARCHAR2 (50) := 'CG_' || ScenarioNo;
...You're not actually wasting any space if you decalre the variable as 50 characters, but only use 3.
It really helps if you format code, so that, for example,
all the local variables are indented before the word BEGIN
everything between BEGIN and its corresponding END is indented
everything between IF and its corresponding END IF is indented,
and so on.
You're probably already doing that, but it doesn't show up on this site unless you type these 6 characters
(small letters only, inside curly brackets) before and after the formatted text.
That's what I did for the code fragement above.
Edited by: Frank Kulash on Mar 23, 2009 12:04 PM
Formatting stuff added. -
Hi,
I've table BP:
CREATE TABLE BP (
BV_ID VARCHAR2 (32) DEFAULT NULL NOT NULL,
BP_ID VARCHAR2 (32) DEFAULT NULL NOT NULL,
CONSTRAINT BP_PK
PRIMARY KEY ( BV_ID, BP_ID )
BP has more 100 records:
Now I'd like to drop table BP:
drop table BP;
ORA-02449: unique/primary keys in table referenced by foreign keys
ALTER TABLE BP DISABLE CONSTRAINT BP_PK;
ORA-02297: cannot disable constraint (BP_PK) - dependencies exist
I tried disable all constraints with:
select 'alter table '||table_name||' disable constraints '||constraint_name||';'
from user_cons_columns
where column_name='BV_ID'
or column_name='BP_ID'
but when I try drop table BP;
ORA-02449: unique/primary keys in table referenced by foreign keys
also truncate table BP:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
How can I drop table BP and disable all referenced by enabled foreign keys on table BP?
Thanks!Or you could disable the foreign key constraint refering to primary key on the table and then drop the PK and then drop the table
G -
Batch Master Creation with lower case letters
Hi,
While creating batch master via msc1n, sytem automatically change lower case letters of bach ID to upper case letters.
Can anyone please guide me, where are the settings in the system for this change?
Regards,
M.S.BaraneedharanConversion Routine
Conversion takes place when converting the contents of a screen field from display format to SAP-internal format and vice versa and when outputting with the ABAP statement WRITE, depending on the data type of the field.
If standard conversion is not suitable, it can be overridden by specifying a conversion routine in the underlying domain.
A conversion routine is identified by its five-place name and is stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:
CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT
The INPUT module performs the conversion from display format to internal format. The OUTPUT module performs the conversion from internal format to display format.
If a screen field refers to a domain with a conversion routine, this conversion routine is executed automatically each time an entry is made in this screen field or when values are displayed with this screen field.
I have to correct myself . if the entry in small letters is allowed or not is already defined in the domain of the field.
You can see this in SE11.
set radio button to Domain and enter CHARG in the domain field and click display.
in the definition tab you can see a box for Lower Case, which means that lower case entries are only allowed if this box is activated. (btw: the field for the conversion routine can be seen above)
Maybe you are looking for
-
Please help! My iPad mini has two different apple ids. My Apple ID in the general settings part and my family's id in the App Store. I need to fix it so that it's just one Apple ID and one password.
-
Hi I'm trying to update my iPhone 5 to the iOS 7 but all when it is activating it doesn't work
Hi I'm trying to update my phone but it won't activate I need help
-
Printing charector mode report
Hi i am genrating the charector mode report in server as file and downloading to client machine and view as notepad. if i give printing on to line printer it is taking more time than opening in edit( dos) and print command. ( notepad is printning in
-
Hello Experts, does anybody know how to integrate a new OM custom object in the infotype 0001? Thank you very much!
-
I have an iPad 2 and I am unable to activate my face time account. Despite having the correct ID and password. Any suggestions?