[Zope] dtml / zsql datatype problem

Adam Gotheridge adam@foxvalley.net
Wed, 1 Dec 1999 23:50:03 -0600


Thanks, but I still can't get it. I basically am retrieving a record from a
db (dtml-in), and when I get to a field where I need to display  as a select
box, I issue a second request to get records from another table. If I single
out the code pertaining to the select box and then set a variable manually,
I can call it like this:

<!--#call "REQUEST.set('milestoneid',45)"-->
<select name=Selmilestoneid>
<dtml-in getMilestones>
      <OPTION value='<dtml-var retmilestoneid>'><dtml-var
retmilestone_name></OPTION>
</dtml-in>
</select>

but... <dtml-in "getMilestones(milestoneid)"> doesn't work even here (I
can't add the variable argument).

There are other weird things as well. If I call the sql object as a string
like
<dtml-in "getMilestones(milestoneid='<dtml-var milestoneid>')"> and change
the sql method to accept a string, the dtml document succeeds, but oracle
returns an error about an invalid datatype. The odd thing is that when I
test the sql method with a string, '54' (with quotes), it succeeds.

Any other ideas?

Adam




> You can't use DTML inside of DTML...
>
> try:
>
> <dtml-in "getMilestones(milestoneid)">
>
> This assumes there is a variable named milestoneid in the namespace
> somewhere.
>
> Adam Gotheridge wrote:
> >
> > I am trying to call an sql method which requires and integer argument.
If I
> > call it with
> > <dtml-in "getMilestones(milestoneid='<dtml-var milestoneid>')">
> >
> > I get "Invalid integer value for milestoneid "
> >
> > If I use
> >
> > <dtml-in "getMilestones(milestoneid=<dtml-var milestoneid>)">
> >
> > I get "invalid syntax, for tag <dtml-in
"getMilestones(milestoneid=<dtml-var
> > milestoneid>)">, on line 24 of editTask
> >
> > Can anyone help? I have been at this for over 2 hours.
> >
> > Thanks,
> >
> > Adam
> >
> > _______________________________________________
> > 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 )
>
> --
> Chris McDonough
> Digital Creations, Inc.
> Zope - http://www.zope.org
>
> _______________________________________________
> 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 )
>
>