Home » SQL & PL/SQL » SQL & PL/SQL » Is "a" a keyword in oracle
Is "a" a keyword in oracle [message #314852] Fri, 18 April 2008 01:06 Go to next message
ssunda6
Messages: 28
Registered: June 2007
Junior Member
Hi,

In sql developer, whenever we type, the keywords automatically get highlighted. I was trying to alias a table name with "a" and this letter got highlighted along with the other keywords like select, from etc.

Is "a" also a keyword or some reserved word in oracle?
Please let me know.

Regards,
ssunda.
Re: Is "a" a keyword in oracle [message #314857 is a reply to message #314852] Fri, 18 April 2008 01:19 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If you check V$RESERVED_WORDS, you'll find 'A' in there. I believe that's a view which is used by SQL Developer; however, I've never seen that 'a' can not / should not be used for your own purposes (which also suggests a record from the view):
SQL> desc v$reserved_words;
 Name                                      Null?    Type
 ----------------------------------------- -------- ------------------

 KEYWORD                                            VARCHAR2(30)
 LENGTH                                             NUMBER
 RESERVED                                           VARCHAR2(1)
 RES_TYPE                                           VARCHAR2(1)
 RES_ATTR                                           VARCHAR2(1)
 RES_SEMI                                           VARCHAR2(1)
 DUPLICATE                                          VARCHAR2(1)

SQL> select * From v$reserved_words where keyword = 'A';

KEYWORD                            LENGTH R R R R D
------------------------------ ---------- - - - - -
A                                       1 N N N N N

SQL>
Re: Is "a" a keyword in oracle [message #314895 is a reply to message #314852] Fri, 18 April 2008 03:48 Go to previous messageGo to next message
ssunda6
Messages: 28
Registered: June 2007
Junior Member
Thanks.

Yes..even i have used "a" as alias name to tables several times and it worked properly.

The actual problem is I ran a sql

select b.check from firstTable a, Secondtable b where a.check = b.check;

and this returned 10 rows.
But I try to fetch some other column using the following query,

select b.different from firstTable a, Secondtable b where a.check = b.check;

It is returning 0 rows.

Not able to figure out why this is happening. The only difference between 'check' and 'difference' columns is that the latter is a primary key.

(Just was thinking can 'a' keyword give any problem.)
Thanks,
ssunda.
Re: Is "a" a keyword in oracle [message #314898 is a reply to message #314895] Fri, 18 April 2008 03:51 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
"a" is not the problem.

First, are they real tables or views?
If they are real tables, post a test case we can reproduce.

Then, copy and paste your session.

Regards
Michel
Re: Is "a" a keyword in oracle [message #314901 is a reply to message #314895] Fri, 18 April 2008 04:12 Go to previous messageGo to next message
dr.s.raghunathan
Messages: 540
Registered: February 2008
Senior Member
i checked it is not giving problem.

is there any specific version gives this type of problem

i like to know out of curiosity

yours
dr.s.raghunathan
Re: Is "a" a keyword in oracle [message #314906 is a reply to message #314901] Fri, 18 April 2008 04:20 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hello,

desc v$reserved_words

This command not working on my system.
Wht is the Reason, can anyone tell me?

i m using oracle 9.2.0.1.0

Re: Is "a" a keyword in oracle [message #314923 is a reply to message #314906] Fri, 18 April 2008 04:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
This command not working on my system.

This is of very little use to know why "it is not working". An error message would be useful, don't you think?

Check if you have the privilege to query it.

Regards
Michel
Re: Is "a" a keyword in oracle [message #314924 is a reply to message #314852] Fri, 18 April 2008 05:00 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hello,
i get this error message.

SQL> desc v$reserved_words;
ERROR:
ORA-04043: object SYS.V_$RESERVED_WORDS does not exist
Re: Is "a" a keyword in oracle [message #314926 is a reply to message #314924] Fri, 18 April 2008 05:20 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So you have not the privilege to query it.
Ask you DBA to grant it to you.

Regards
Michel

Re: Is "a" a keyword in oracle [message #314940 is a reply to message #314924] Fri, 18 April 2008 06:02 Go to previous messageGo to next message
ttparavindh
Messages: 22
Registered: December 2006
Location: Bangalore,India
Junior Member

Hi,
better can you check your user privilege,

SQL> select * from session_privs;

Regards,
Aravindh
Re: Is "a" a keyword in oracle [message #314944 is a reply to message #314940] Fri, 18 April 2008 06:25 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This does not give you object privileges only system ones.

Regards
Michel
Re: Is "a" a keyword in oracle [message #315007 is a reply to message #314940] Fri, 18 April 2008 10:10 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
ttparavindh wrote on Fri, 18 April 2008 13:02
Hi,
better can you check your user privilege,

SQL> select * from session_privs;

Regards,
Aravindh

Even if you would query the correct privs view, it would only confirm what you already know: you don't have privs on the reserved_words view
Previous Topic: What function to use to round character?
Next Topic: order of element in a string array (collection)
Goto Forum:
  


Current Time: Sat Dec 03 04:08:46 CST 2016

Total time taken to generate the page: 0.08404 seconds