home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.ingres
- Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zelator!gamelan!thomas
- From: thf@zelator.in-berlin.de (Thomas Funke)
- Subject: Re: select * with a 3-way join having same column names in ESQL/C
- Message-ID: <1992Jul29.110844.880@gamelan>
- Sender: thomas@gamelan (thomas)
- Reply-To: thf@zelator.in-berlin.de (Thomas Funke)
- Organization: NNU Corp. - NeXT is Not UN*X
- References: <1992Jul29.000202.23983@news.columbia.edu>
- Date: Wed, 29 Jul 1992 11:08:44 GMT
- Lines: 39
-
- In article <1992Jul29.000202.23983@news.columbia.edu>
- alan@curta.cc.columbia.edu (Alan Crosswell) writes:
- > I had a code segment which said:
- >
- > exec sql declare x cursor for
- > select *
- > from hosts h, hwaddr hw, ip i
- > where h.hname=i.hname
- > and i.ipaddr=hw.ipaddr;
- >
- > .. where all three of the referenced tables have a column named hname.
- >
- > I then fetched like this:
- >
- > exec sql fetch x into :hosts,:ip,:hwaddr;
- >
- > where hosts,ip, and hwaddr are structs generated via dclgen.
- >
- > I got random wierd results under 6.3 and 6.4 include garbage data
- > and numeric type conversion error messages until I changed the code to
- > select explicit columns and fetch into explicit struct members in the
- > same order.
- >
- > I assume this is because of the ambiguity of the hname column in the
- three
-
- I had the same problem before. It's not from ESQLC but probably a bug in
- the optimizer. Because the errors do not occur every time.
-
- Only solution: Do not write 'select * from table1, table2, ...'
- but write down all columns explicitely. Annoying ....
-
-
-
- --
- ------------------------------------------------------------------
- Thomas Funke ** E-mail: thf@zelator.in-berlin.de
- NeXT-Developer * Unix-Consultant
- ------------------------------------------------------------------
-