Re: Can't access a table I just created

  • From: Vit Spinka <vit.spinka@xxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Wed, 07 Jul 2010 20:27:40 +0200

Dne 7.7.2010 20:19, Octavian Rasnita napsal(a):
Hi,

Our sysadmin recently installed Oracle and he created the user "teddy" for me.

I have created a table, but I can't select from it and I can't drop it either.

Here is what I tried after logging with the username "teddy" in sqlplus:

SQL>  CREATE TABLE "tb" (
   "id" number NOT NULL,
   "symbol" varchar2(20) NOT NULL,
   PRIMARY KEY ("id")
);
   3    4    5
Table created.

You created a table called tb - note the lowercase. By default, Oracle creates objects in uppercase, but you can force it to keep the name as-you-entered by using "" (double qoutes). Thus, issuing select * from "tb"; should work.
To recap:
CREATE TABLE tb ... will create table TB
CREATE TABLE TB ... will create table TB
CREATE TABLE "tb" ... will create table tb


Note that using "" in object naming is generally a VERY BAD idea as it just leads to problems, as you can see on your example.

Vit
--
//www.freelists.org/webpage/oracle-l


Other related posts: