3
我是Oracle新手,遇到以下問題。爲什麼我必須雙引號模式名稱和表名稱才能從表中查詢?有什麼設置可以改變它嗎?爲什麼我必須雙引號模式名稱和表名稱才能從Oracle表中查詢?
謝謝。
SQL> conn sys/[email protected] as sysdba
Connected.
SQL> show user
USER is "SYS"
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> select * from m.album;
select * from m.album
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from M.Album where rownum < 2;
select * from M.Album where rownum < 2;
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from "M"."Album" where rownum < 2;
AlbumId Title
---------- ----------------------------------------------------------------------
1 For Those About To Rock We Salute You
SQL> conn m/[email protected]
Connected.
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
Album
Artist
Customer
Employee
Genre
Invoice
InvoiceLine
MediaType
Playlist
PlaylistTrack
sysdiagrams
TABLE_NAME
------------------------------
Track
12 rows selected.
SQL> select * from album where rownum < 2;
select * from album where rownum < 2;
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from Album where rownum < 2;
select * from Album where rownum < 2
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from m.album where rownum < 2;
select * from m.album where rownum < 2
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from M.Album where rownum < 2;
select * from M.Album where rownum < 2
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> select * from "M"."Album" where rownum < 2;
AlbumId Title
---------- ----------------------------------------------------------------------
1 For Those About To Rock We Salute You
SQL> select * from "Album" where rownum < 2;
AlbumId Title
---------- ----------------------------------------------------------------------
1 For Those About To Rock We Salute You
SQL>
謝謝alfasin。如果我已經有這種表格,我可以將它們的名稱更改爲不區分大小寫的模式嗎? – user133580 2012-08-17 07:08:53
sure:'RENAME TABLE M.「Album」TO M.ALBUM;'read more [* here *](http://docs.oracle.com/javadb/10.6.2.1/ref/rrefsqljrenametablestatement.html) – alfasin 2012-08-17 07:15:25
謝謝! !有用! – user133580 2012-08-17 07:19:43