[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope
Subject:    Re: [Zope] MySQL Select Statements
From:       Dieter Maurer <dieter () handshake ! de>
Date:       2000-06-30 22:00:08
[Download RAW message or body]

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

_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic