[Zope-DB] How to view a dynamically generated ZSQL query

Jorge O. Martinez jmartinez@eMediaMillWorks.com
Wed, 17 Apr 2002 16:10:00 -0400


Charlie:

Thanks! That is a good idea, and it will help to isolate problems by 
commenting out the suspected offending SQL.

However, I was hoping there was a way to display the 'bad' query like I 
do in php where I put my query in $query, and then just print it at will 
'til the bug is dead, regardless of what's in it or whether it fails or 
succeeds. Guess I have to learn new ways in Zope.

Regards,

Jorge M.

Charlie Reiman wrote:
> Hmmm. I'm no sql (nor zope) expert but: Can you wrap your sql query in a sql
> comment so it always succeeds? I don't think dtml is looking for any kind of
> sql comments, so it will probably do its usual variable substitution no
> matter where it finds the dtml references.
> 
> So something like this:
> 
> select sysdate from dual; /* select my breaking statement <dtml-blah blah>
> */
> 
> 
> 
>>-----Original Message-----
>>From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]On Behalf Of
>>Jorge O. Martinez
>>Sent: Wednesday, April 17, 2002 7:44 AM
>>To: Stuart Bishop
>>Cc: zope-db
>>Subject: Re: [Zope-DB] How to view a dynamically generated ZSQL query
>>
>>
>>Stuart:
>>
>>Thanks a lot; it's almost what I need, but it's only displaying the SQL
>>being used if the query is executed successfully, but if the query fails
>>I only get the Oracle error, it's not showing me the query that caused
>>it (which is what I need to have to figure out what's wrong). I could
>>figure out the problem the long way, but it would have helped to see the
>>bad query.
>>
>>Regards,
>>
>>Jorge M.
>>
>>Stuart Bishop wrote:
>>
>>>On Wednesday, April 17, 2002, at 04:34  AM, Jorge O. Martinez wrote:
>>>
>>>
>>>>Thanks Charlie!
>>>>
>>>><dtml-var REQUEST> is what I needed to display the VARS. Now I hope
>>>>someone knows a trick to display the query in the ZSQL method being
>>>>executed (whether it executes or fails).
>>>>
>>>
>>>http://www.zope.org/Members/Zen/tips/GeneratedSQLSource
>>>
>>>Quick answer: <dtml-var "myzsqlmethod(REQUEST,src__=1)" html_quote>
>>>
>>>--
>>>Stuart Bishop <zen@shangri-la.dropbear.id.au>
>>>http://shangri-la.dropbear.id.au/
>>>
>>>
>>>
>>>_______________________________________________
>>>Zope-DB mailing list
>>>Zope-DB@zope.org
>>>http://lists.zope.org/mailman/listinfo/zope-db
>>>
>>
>>
>>
>>--
>>Jorge O. Martinez
>>MIS Senior Associate
>>eMediaMillWorks
>>1100 Mercantile Lane, Suite 119
>>Largo, MD 20774
>>E-mail  => jmartinez@eMediaMillWorks.com
>>Phone   => (301)883-2482 ext. 105
>>Fax     => (301)883-9754
>>
>>
>>
>>_______________________________________________
>>Zope-DB mailing list
>>Zope-DB@zope.org
>>http://lists.zope.org/mailman/listinfo/zope-db
>>
> 
> 



-- 
Jorge O. Martinez
MIS Senior Associate
eMediaMillWorks
1100 Mercantile Lane, Suite 119
Largo, MD 20774
E-mail  => jmartinez@eMediaMillWorks.com
Phone   => (301)883-2482 ext. 105
Fax     => (301)883-9754