home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / database / ingres / 1031 < prev    next >
Encoding:
Text File  |  1992-07-30  |  1.8 KB  |  52 lines

  1. Newsgroups: comp.databases.ingres
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zelator!gamelan!thomas
  3. From: thf@zelator.in-berlin.de (Thomas Funke)
  4. Subject: Re: select * with a 3-way join having same column names in ESQL/C
  5. Message-ID: <1992Jul29.110844.880@gamelan>
  6. Sender: thomas@gamelan (thomas)
  7. Reply-To: thf@zelator.in-berlin.de (Thomas Funke)
  8. Organization: NNU Corp. - NeXT is Not UN*X
  9. References: <1992Jul29.000202.23983@news.columbia.edu>
  10. Date: Wed, 29 Jul 1992 11:08:44 GMT
  11. Lines: 39
  12.  
  13. In article <1992Jul29.000202.23983@news.columbia.edu>  
  14. alan@curta.cc.columbia.edu (Alan Crosswell) writes:
  15. > I had a code segment which said:
  16. >  exec sql declare x cursor for
  17. >     select *
  18. >       from hosts h, hwaddr hw, ip i
  19. >         where h.hname=i.hname
  20. >           and i.ipaddr=hw.ipaddr;
  21. > .. where all three of the referenced tables have a column named hname.
  22. > I then fetched like this:
  23. > exec sql fetch x into :hosts,:ip,:hwaddr;
  24. > where hosts,ip, and hwaddr are structs generated via dclgen.
  25. > I got random wierd results under 6.3 and 6.4 include garbage data
  26. > and numeric type conversion error messages until I changed the code to
  27. > select explicit columns and fetch into explicit struct members in the
  28. > same order.
  29. > I assume this is because of the ambiguity of the hname column in the  
  30. three
  31.  
  32. I had the same problem before. It's not from ESQLC but probably a bug in  
  33. the optimizer. Because the errors do not occur every time.
  34.  
  35. Only solution: Do not write 'select * from table1, table2, ...'
  36. but write down all columns explicitely. Annoying ....
  37.  
  38.  
  39.  
  40. -- 
  41. ------------------------------------------------------------------
  42. Thomas Funke  ** E-mail: thf@zelator.in-berlin.de
  43. NeXT-Developer * Unix-Consultant
  44. ------------------------------------------------------------------
  45.