Subject RE: [IBO] Ambiguous field name?
Author Steve Harp
Thanks Helen,

I don't begin to understand it, but here it is:

/*---
PREPARE STATEMENT
TR_HANDLE = 16342000
STMT_HANDLE = 21905836

Select mc.MenuCategoryID, mi.MenuItemID, mc.CategoryName, mi.ItemCode,
mi.ItemName, mi.Price, mi.Sales
, XMENUITEM.RDB$DB_KEY
From xMenuCategory mc JOIN xMenuItem mi
ON (mc.MenuCategoryID = mi.MenuCategoryID)
and (mc.LocationID = 2)
and (mi.LocationID = 2)
ORDER BY mc.CategoryName ASC
, mi.ItemCode ASC

PLAN SORT (JOIN (MC INDEX (RDB$FOREIGN16),MI INDEX (RDB$FOREIGN17)))

FIELDS = [ Version 1 SQLd 8 SQLn 59
XMENUCATEGORY.MENUCATEGORYID = <NIL>
XMENUITEM.MENUITEMID = <NIL>
XMENUCATEGORY.CATEGORYNAME = <NIL>
XMENUITEM.ITEMCODE = <NIL>
XMENUITEM.ITEMNAME = <NIL>
XMENUITEM.PRICE = <NIL>
XMENUITEM.SALES = <NIL>
XMENUITEM.DB_KEY = <NIL> ]
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 16342000
STMT_HANDLE = 21905836

Select mc.MenuCategoryID, mi.MenuItemID, mc.CategoryName, mi.ItemCode,
mi.ItemName, mi.Price, mi.Sales
, XMENUITEM.RDB$DB_KEY
From xMenuCategory mc JOIN xMenuItem mi
ON (mc.MenuCategoryID = mi.MenuCategoryID)
and (mc.LocationID = 2)
and (mi.LocationID = 2)
WHERE (LocationID = 2)
ORDER BY mc.CategoryName ASC
, mi.ItemCode ASC

FIELDS = [ Version 1 SQLd 8 SQLn 59
XMENUCATEGORY.MENUCATEGORYID = <NIL>
XMENUITEM.MENUITEMID = <NIL>
XMENUCATEGORY.CATEGORYNAME = <NIL>
XMENUITEM.ITEMCODE = <NIL>
XMENUITEM.ITEMNAME = <NIL>
XMENUITEM.PRICE = <NIL>
XMENUITEM.SALES = <NIL>
XMENUITEM.DB_KEY = <NIL> ]

SECONDS = 0.010

ERRCODE = 335544569
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 16342000
STMT_HANDLE = 21905836

Select mc.MenuCategoryID, mi.MenuItemID, mc.CategoryName, mi.ItemCode,
mi.ItemName, mi.Price, mi.Sales
, XMENUITEM.RDB$DB_KEY
From xMenuCategory mc JOIN xMenuItem mi
ON (mc.MenuCategoryID = mi.MenuCategoryID)
and (mc.LocationID = 2)
and (mi.LocationID = 2)
WHERE (LocationID = 2)
ORDER BY mc.CategoryName ASC
, mi.ItemCode ASC

FIELDS = [ Version 1 SQLd 8 SQLn 59
XMENUCATEGORY.MENUCATEGORYID = <NIL>
XMENUITEM.MENUITEMID = <NIL>
XMENUCATEGORY.CATEGORYNAME = <NIL>
XMENUITEM.ITEMCODE = <NIL>
XMENUITEM.ITEMNAME = <NIL>
XMENUITEM.PRICE = <NIL>
XMENUITEM.SALES = <NIL>
XMENUITEM.DB_KEY = <NIL> ]

ERRCODE = 335544569
----*/
/*---
INTERPRETE BUFFER =

ERRCODE = 17
----*/
/*---
INTERPRETE BUFFER = Dynamic SQL Error

ERRCODE = 21
----*/
/*---
INTERPRETE BUFFER = SQL error code = -204

ERRCODE = 69
----*/
/*---
INTERPRETE BUFFER = Ambiguous field name between table XMENUCATEGORY and
table XMENUITEM

ERRCODE = 10
----*/
/*---
INTERPRETE BUFFER = LOCATIONID

ERRCODE = -1
----*/
/*---
COMMIT
TR_HANDLE = 16341600
----*/

-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Tuesday, November 05, 2002 10:33 AM
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Ambiguous field name?


At 10:21 AM 05-11-02 -0500, you wrote:
>How can I show you what SQL is "actually going across the wire"? Also, if
I
>don't have any KeyLinks defined, how can I show you what KeyLinks are being
>imposed?

Drop an IB_SQLMonitorDialog on your form and call its Show method in your
FormCreate. You can use copy/paste to transfer the SQL statement which IBO
presents to the API at Prepare time.

You *need* to have KeyLinks defined. Inspect the KeyLinks property to see
what IBO's "best guess" is - but it won't be correct, because of the joins
and the error you are getting involving a column that is not in your query.

Helen



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/