Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How would I write this sql

Re: How would I write this sql

From: Hans Forbrich <forbrich_at_telusplanet.net>
Date: Sat, 07 Jun 2003 03:32:06 GMT
Message-ID: <3EE15B59.2E389A6E@telusplanet.net>


Jake wrote:

> How can I write this sql?
>
> SQL> SELECT user.id
> 2 FROM organization user
> 3 WHERE userid = 'myname'
> 4 /
> SELECT user.id
> *
> ERROR at line 1:
> ORA-00923: FROM keyword not found where expected
>
> I'm not able to change the table alias. And I know the error is from "user"
> being a pseudo column.

Actually I believe that the error might from USER being a reserved word (reserved in ANSI as well), as described in the SQL Reference Manual (Doc ID A96540), as much as it being a psuedo-column.

Counter-question, is case sensitivity important?

I have verified that the standard rules apply in Oracle9i (and this can be done). On the off-hand that this is a homework question - I refer you to the SQL Reference Manual (Documument A96540 for Oracle9i) section titled "Schema Object Naming Rules"

> but is there some sort of quoting, or something I could do, and leave the
> table alias?

There is at least one circumstance I can think of where changing the alias could potentially matter. But to enforce this limitation (not permitting the change of the alias) does not make sense even in that case.

Assuming that this is more than a hypothetical or classroom assignment situation, please tell us .... what kind of environment are you working with that requires a deliberate violation of an ANSI standard? Received on Fri Jun 06 2003 - 22:32:06 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US