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: Mysterious query

Re: Mysterious query

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Fri, 28 Feb 2003 23:07:07 -0800
Message-ID: <3E605C1B.5AE3B909@exesolutions.com>


Peter Michelson wrote:

> "DA Morgan" <damorgan_at_exesolutions.com> wrote in message
> news:3E600878.D7B5A659_at_exesolutions.com...
> > Peter Michelson wrote:
> >
> > > Here's a poser: I have a Delphi 6 Enterprise app using the BDE to
> connect to
> > > Oracle 8.1.7.3. I've been getting sporadic "Ambiguous Column Name"
> errors
> > > from Oracle. When I ran SQL Trace it revealed an impossible query:
> > > somehow, a query which contains all fields from all of my database
> tables
> > > was being processed. This query even contains fields from tables in the
> > > database which aren't being used in the Delphi application. However, it
> > > does not seem to contain any key fields.
> > >
> > > Does anyone have any idea what might cause this behavior? Could this
> result
> > > from bad memory on the database server?
> > >
> > > Would appreciate any help,
> > > -P
> >
> > This sounds like a Delhi/BDE issue rather than an Oracle issue. The
> behavior you
> > describe is not a bug in Oracle and I highly doubt in the operating system
> > unless your server is Win95 or similar which I would doubt.
> >
> > In the future it would be helpful if you posted the SQL sent ... the SQL
> > received at the database ... and the exact error message (full number and
> text).
> >
> > Daniel Morgan
> >
>
> My apologies. For starters you are correct - my OS is not win95, but rather
> win2000 pro.
> The SQL that should have been sent does not coincide even remotely with what
> the trace reported. Here is an excerpt from the trace output:
>
> DIAG [S1000] [Oracle][ODBC][Ora]ORA-00960: ambiguous column naming in
> select list
> (960)
>
> Processid:{3D14 d74-ec8 ENTER SQLErrorW
> HENV 00000000
> HDBC 00000000
> HSTMT 008D4678
> WCHAR * 0x029FEFF4 (NYI)
> SDWORD * 0x029FF098
> WCHAR * 0x029FEBF4
> SWORD 511
> SWORD * 0x029FF096
>
> The statement that preceded this was an extremely long query that contained
> all the fields of all the tables in the database listed in alphabetical
> order of table names. Also, I was mistaken, all key fields are present.
>
> If you are right that it is a Delphi or BDE error, then I think it is likely
> to be due to some BDE malfunction because the Delphi app has absolutely no
> references to some of the tables whose fields are listed in the query.
>
> Thanks for your ideas. Please let me know if the additional information
> conjures up any additional insights.
> -P

One common cause of the ambiguous column name error is a query where a column name appears in two or more tables and the SELECT, WHERE, GROUP BY, HAVING, and/or ORDER BY clause don't qualify which table's column is the one desired.

But what is ODBC doing in here? You should have native connectivity from Delphi.

Daniel Morgan Received on Sat Mar 01 2003 - 01:07:07 CST

Original text of this message

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