Home » Developer & Programmer » Reports & Discoverer » Error ora-00918
Error ora-00918 [message #327333] Mon, 16 June 2008 02:07 Go to next message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Dear Members

i am facing the problem that when i run the report it gave this error. ORA-00198 column ambiguously defined.
,decode(==>client,'P','H-NO TOWN',DIST_STATE) as distat
I am using developer 6i and 9i database.

Please tell me what is the problem.
Thanks
Re: Error ora-00918 [message #327343 is a reply to message #327333] Mon, 16 June 2008 02:58 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I suspect that query contains two or more tables, and two or more of them contain column with the same name; furthermore, you didn't use table name or its alias while writing the query, so Oracle doesn't know which table you are selecting from.

Here's an example:
SQL> select deptno, ename              --> no table alias
  2  from emp e, dept d
  3  where e.deptno = d.deptno;
select deptno, ename
       *
ERROR at line 1:
ORA-00918: column ambiguously defined


SQL> select d.deptno, e.ename          --> using table alias
  2  from emp e, dept d
  3  where e.deptno = d.deptno;

    DEPTNO ENAME
---------- ----------
        20 SMITH
        30 ALLEN
        30 WARD
        20 JONES
        30 MARTIN
        30 BLAKE
        10 CLARK
        20 SCOTT
        10 KING
        30 TURNER
        20 ADAMS
        30 JAMES
        20 FORD
        10 MILLER

14 rows selected.

SQL>
Re: Error ora-00918 [message #327348 is a reply to message #327333] Mon, 16 June 2008 03:08 Go to previous message
sweetkhaliq
Messages: 189
Registered: April 2006
Senior Member

Thanks Dear Littlefoot
I have done as you say. And know the problem has solved.
Previous Topic: How to find out the character set
Next Topic: double page break
Goto Forum:
  


Current Time: Thu Dec 08 16:25:23 CST 2016

Total time taken to generate the page: 0.09963 seconds