[Zope] Help with Nested ZSQL methods

2000-11-29 Thread paul_s_johnson

I thought I saw this answer to this one time on http://www.zope.org once,
but for the life of me I cannot seem to find it.

I have two ZSQL methods, both tested and work.

ZSQL method 1
===
method id= sql_get_schedules
SELECT * FROM Schedules WHERE JobID = dtml-var JobID ORDER BY SchedSeq

ZSQL method 2
===
method id= sql_get_items
SELECT * FROM Items WHERE SchedID = dtml-var SchedID ORDER BY ItemNo

These two tables are linked by the common field "SchedID"


Here's the operative part of the dtml method that calls these methods:
==
dtml-in sql_get_schedules
 TABLE BORDER="3"
 TRTHItem No./THTHDescription/THTHMn/DOT
No./THTHUnits/TH/TR
 dtml-in sql_get_items
  TR
   TDdtml-var ItemNo/TD
   TDdtml-var Description/TD
   TDdtml-var MnDOTNo/TD
   TDdtml-var UnitDescription/TD
 /TR
 dtml-in
 TABLE
/dtml-in
==

I get the error:

Error Type: Bad Request
Error Value: ['SchedID']

I suspect there is some type of namespace-related problem going on here
where the var SchedID is not getting passed to the internal ZSQL method.

P. Johnson

P.S.: I must Lotus Notes ( http://www.iarchitect.com/lotus1.htm ) at my
place of employment.  Any errantly inserted HTML or other weird garbage not
intentional.


___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Help with Nested ZSQL methods

2000-11-29 Thread Pavel V. Piankov

try calling like this : dtml-in "sql_get_items(_.None,_)"
also you might what to use dmt-sql var instead of dtml-var inside ZAQL
Methods.


regards
--
pashah


Here's the operative part of the dtml method that calls these methods:
==
dtml-in sql_get_schedules
 TABLE BORDER="3"
 TRTHItem No./THTHDescription/THTHMn/DOT
No./THTHUnits/TH/TR
 dtml-in sql_get_items
  TR
   TDdtml-var ItemNo/TD
   TDdtml-var Description/TD
   TDdtml-var MnDOTNo/TD
   TDdtml-var UnitDescription/TD
 /TR
 dtml-in
 TABLE
/dtml-in
==

I get the error:

Error Type: Bad Request
Error Value: ['SchedID']

I suspect there is some type of namespace-related problem going on here
where the var SchedID is not getting passed to the internal ZSQL method.

P. Johnson



___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Help with Nested ZSQL methods

2000-11-29 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  ... passing parameters to Z SQL methods ...
This is an FAQ.

You already know the searchable list archive at NIP?

Z SQL methods do *NOT* take parameters from the DTML
namespace. They only look at "REQUEST".

You have two options:

 1. put your parameters into the REQUEST object:

dtml-call "REQUEST.set('myparam', myparam_value)"


 2. call the Z SQL method with explicit parameters:

dtml-in "myMethod(myparam= myparam_value, )"


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
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 )