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: Sun, 02 Mar 2003 09:50:49 -0800
Message-ID: <3E624479.EE4F3966@exesolutions.com>


Peter Michelson wrote:

> "DA Morgan" <damorgan_at_exesolutions.com> wrote in message
> news:3E605C1B.5AE3B909_at_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.
> >
> Yes, I am aware of the error's meaning, however, I think it is only
> symptomatic of a larger problem, i.e., the mysterious query. Given that the
> query includes fields from many tables which contain fields with the same
> name, I'm not surprised that this error is generated. In all of the
> legitimate queries, I have renamed ambiguous fields with distinct
> designators.

>

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

> The architecture is Delphi -> BDE -> ODBC -> Oracle. The BDE has a history
> of being problematic, so it wouldn't surprise me if that was the source of
> this problem. When you say "native connectivity" are you refering to the
> use of ADO (OLE DB) to access Oracle? Is there a problem with ODBC?
>
> Thanks for your ongoing dialog. -P

The last time I worked with BDE was when it was with Borland's Paradox ... something like v7 ... so a decade or so old. But then there was a direct link to Oracle ... I think called SQL Link or something like that. We never connected to Oracle through ODBC. I would hope Borland hasn't gone backward.

Daniel Morgan Received on Sun Mar 02 2003 - 11:50:49 CST

Original text of this message

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