[Zope] MySQL Select Statements

Dieter Maurer dieter@handshake.de
Sat, 1 Jul 2000 00:00:08 +0200 (CEST)


Michael Blewett writes:
 > Select Column1, Column2 etc
 > from TableA.
 > 
 > Instead I must use the AS statement ie
 > 
 > Select Column1 AS Column1, Column2 AS Column2
 > from TableA.
Zope should not be responsible for this strange behaviour.

It simply executes the SQL statement and asks the result
for the result column names. It then wraps each result
row in an object that allows to access a column value
as attribute under the respective column name.

You could try:
<dtml-let SQLresult=SQLMethod>
  <dtml-var "SQLresult.names()">
</dtml-in>
to get the list of column names your Z SQL Method
"SQLMethod" returns.

This may give you a hint how your database names result columns.


I recently found out that Oracle returns column names
converted into all uppercase. I needed about 2 hours
to analyse this weird behaviour.



Dieter