By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,159 Members | 1,880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,159 IT Pros & Developers. It's quick & easy.

How to reference table/view that has "slashes" in its name!

P: n/a
I'm new to Oracle, so this question may sound silly. I have been given a
list of Oracle tables (they may be views, I'm not sure) that are available
to me. I can run simple SQL select statements against most of them in SQL
Plus. But some of them have "slashes" in their names such as /XYZ/CUSTOMERS
or /XYZ/ADDRESSES . When I try to use the name the way it's listed (with
slashes) I get an error. I even tried replacing the slashes with dots, but
that didn't work either. My question is how do I reference a table/view (in
a SQL select statement for instance) that has slashes in its name. I'm not
sure if this is relevant, but I think the Oracle database runs on a Unix
box. Thanks in advance.

Alex
Jul 19 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
TC
"/XYZ/ADDRESSES"

/tc

"Alex" <sh****@yahoo.com> wrote in message
news:9y********************@twister.austin.rr.com. ..
I'm new to Oracle, so this question may sound silly. I have been given a
list of Oracle tables (they may be views, I'm not sure) that are available
to me. I can run simple SQL select statements against most of them in SQL
Plus. But some of them have "slashes" in their names such as /XYZ/CUSTOMERS or /XYZ/ADDRESSES . When I try to use the name the way it's listed (with
slashes) I get an error. I even tried replacing the slashes with dots, but
that didn't work either. My question is how do I reference a table/view (in a SQL select statement for instance) that has slashes in its name. I'm not
sure if this is relevant, but I think the Oracle database runs on a Unix
box. Thanks in advance.

Alex

Jul 19 '05 #2

P: n/a
"Alex" <sh****@yahoo.com> wrote
I'm new to Oracle, so this question may sound silly. I have been given a
list of Oracle tables (they may be views, I'm not sure) that are available
to me. I can run simple SQL select statements against most of them in SQL
Plus. But some of them have "slashes" in their names such as /XYZ/CUSTOMERS
or /XYZ/ADDRESSES . When I try to use the name the way it's listed (with
slashes) I get an error.

SQL> create table "ABC/def" ( x char(1) );

Table created.

SQL> select * from "ABC/def";

no rows selected
--
Billy
Jul 19 '05 #3

P: n/a
Hi Alex,
Try this :

/XYZ/CUSTOMERS -----------> "/XYZ/CUSTOMRRS"

like wise all..
to remove meaning of special characters use " "..but write other
characters in capitals only ..

Prashant.
"Alex" <sh****@yahoo.com> wrote in message news:<9y********************@twister.austin.rr.com >...
I'm new to Oracle, so this question may sound silly. I have been given a
list of Oracle tables (they may be views, I'm not sure) that are available
to me. I can run simple SQL select statements against most of them in SQL
Plus. But some of them have "slashes" in their names such as /XYZ/CUSTOMERS
or /XYZ/ADDRESSES . When I try to use the name the way it's listed (with
slashes) I get an error. I even tried replacing the slashes with dots, but
that didn't work either. My question is how do I reference a table/view (in
a SQL select statement for instance) that has slashes in its name. I'm not
sure if this is relevant, but I think the Oracle database runs on a Unix
box. Thanks in advance.

Alex

Jul 19 '05 #4

P: n/a
"Alex" <sh****@yahoo.com> wrote:
I'm new to Oracle, so this question may sound silly. I have been given a
list of Oracle tables (they may be views, I'm not sure) that are available
to me. I can run simple SQL select statements against most of them in SQL
Plus. But some of them have "slashes" in their names such as /XYZ/CUSTOMERS
or /XYZ/ADDRESSES . When I try to use the name the way it's listed (with
slashes) I get an error. I even tried replacing the slashes with dots, but
that didn't work either. My question is how do I reference a table/view (in
a SQL select statement for instance) that has slashes in its name. I'm not
sure if this is relevant, but I think the Oracle database runs on a Unix
box. Thanks in advance.

Alex

In addition to all the good advice you have been given about using " " to enclose the badly formed name, speak to the DBA who
created such a non-compliant piece of S*** .
There is no reason to make users jump through hoops because of a lack of Oracle knowledge - If it was a purchased app that
did it, ask for your money back - who knows what other non-standard stuff may be hidden in the coding.

Jul 19 '05 #5

P: n/a
Thank you all for your help. I've tried your suggestions (double quotations,
caps, etc) but none seem to work. I think I'll try to find the person who
created these objects and see if he has a solution.

Thanks again,

Alex

"Alex" <sh****@yahoo.com> wrote in message
news:9y********************@twister.austin.rr.com. ..
I'm new to Oracle, so this question may sound silly. I have been given a
list of Oracle tables (they may be views, I'm not sure) that are available
to me. I can run simple SQL select statements against most of them in SQL
Plus. But some of them have "slashes" in their names such as /XYZ/CUSTOMERS or /XYZ/ADDRESSES . When I try to use the name the way it's listed (with
slashes) I get an error. I even tried replacing the slashes with dots, but
that didn't work either. My question is how do I reference a table/view (in a SQL select statement for instance) that has slashes in its name. I'm not
sure if this is relevant, but I think the Oracle database runs on a Unix
box. Thanks in advance.

Alex

Jul 19 '05 #6

P: n/a
"Alex" <sh****@yahoo.com> wrote in message
Thank you all for your help. I've tried your suggestions (double quotations,
caps, etc) but none seem to work. I think I'll try to find the person who
created these objects and see if he has a solution.


Alex, the solution *is* double quotes. Simply make sure that you spell
the object name _exactly_ as it is. When using double quotes, you are
telling Oracle that the name is case sensitive. Is the case you enter
correct? Maybe there are trailing spaces in the name?

What also could be a problem is the use of special characters
(non-display ones). This will make accessing these table damn
difficult. But you will still need double quotes.

Try the following. Get the *exact* name of these tables from the data
dictionary itself:
select
table_name,
length(table_name) LENGHT,
dump( table_name) ACTUAL
from user_tables
order by 1

Check ACTUAL for the real length and real content of TABLE_NAME.

PS. Feel free to borrow my lead pipe to beat the crap out of the
developer that uses non-standard table names. Slashes and case have
_no_ place in table names - that should be reserved to no-case A..Z &
0..9 & underscore characters only.

PPS. The DBA From Hell Manual states that in such a case, the DBA has
no choice but to rebuild such tables calling it "TABLE1", "TABLE2"
with columns names as "C1", "C2" etc. This ensures that the developer
never repeats his mistake.

--
Billy
Jul 19 '05 #7

P: n/a

Billy Verreynne wrote:
"Alex" <sh****@yahoo.com> wrote in message
Thank you all for your help. I've tried your suggestions (double quotations,
caps, etc) but none seem to work. I think I'll try to find the person who
created these objects and see if he has a solution.
Alex, the solution *is* double quotes.

<snipped>


You are correct of course ... but the real solution is to find the person that
came up with this naming and send them back to take Computer Science 100. There is
no excuse for using slashes in object names.

--
Daniel Morgan
http://www.outreach.washington.edu/e...ad/oad_crs.asp
da******@x.washington.edu
(replace 'x' with a 'u' to reply)
Jul 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.