aspose file tools*
The moose likes JDBC and the fly likes Need a set of eyes... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Need a set of eyes..." Watch "Need a set of eyes..." New topic
Author

Need a set of eyes...

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I've posted below the SQL I am using. I have checked and re-checked my statement but
I can find nothing wrong with it. Can someone else please give it a glance and tell me
why I am getting the ORA-01747 error message?


SQL> DESC DEV.MY_USERS
NameNull? Type
--------------------------------------- --------- -------------------
USER_IDNOT NULL VARCHAR2(20)
GROUP NUMBER(10)

SQL> SELECT *
2 FROM DEV.MY_USERS;

USER_ID GROUP
----------------- --------
MyUse 9

SQL> SELECT MY_USERS.GROUP
2 FROM DEV.MY_USERS
3 WHERE MY_USERS.USER_ID = 'MyUse';
SELECT MY_USERS.GROUP
*
ERROR at line 1:
ORA-01747: invalid user.table.column, table.column, or column specifications
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I don't know why it works but I renamed the column GROUP to GRP and now everything works.
Christa Koch
Greenhorn

Joined: Dec 06, 2005
Posts: 5
Hi Pat, I'm eager to help you and so I tried to create your table in my database but I couldn't: the attribute name "group" was not accepted, probably because it's a reserved word. That lead me to the solution of your problem: Try changing the beginning of you statement to

SELECT "GROUP" ...
Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
Thanks Christa, That's it exactly. I can't use 'GROUP'. I don't know why it let me name the column that but it isn't a good idea from what I can see. Changed the name and everything works fine now
Christa Koch
Greenhorn

Joined: Dec 06, 2005
Posts: 5
Pat, that's what I asked myself: Why did Pat's database accept the attribute name group and mine doesn't? I managed to create the table with this trick:

create table my_users (user_id varchar2(20) not null,"GROUP" number(10));
 
wood burning stoves
 
subject: Need a set of eyes...