Subject: ODBCResultSet - rs.getvalue(“tablename.field”) does not work
i obviously havent explained myself very well as you have both replied the same. appologies.
i’ve got round the problem now but let me start again cos this is a problem i hit time and time again.
i have an sql statement which reads from 3 tables as follows:
SELECT company., consultant., contact.* FROM (company LEFT JOIN consultant ON company.id = consultant.customerid) LEFT JOIN contact ON company.id = contact.customerid;
Now, my consultant and contact tables each have a field named FirstName. In other languages you would distinguish between the two when accessing the data using a resultset by using tablename.field. eg:
to access the FirstName field from contact table:
rs.getvalue(“contact.FirstName”)
or form the consultant table:
rs.getvalue(“consultant.FirstName”)
…but in Lotus Script all I get returned from the getvalue function is “False”. Which suggests that it is looking for a field called “contact.FirstName”, or “consultant.FirstName”, which isn’t the case.
It appears to me that the only way around this in LS is to alias each duplicate field name, but the draw back of this is that you are not able to use SELECT * FROM table, you have to explicitly list each and every field. Annoying!
Anyway, it doesn’t matter a great deal, it’s not a massive problem, more of a curiosity.
Thanks