Newbie problem with dtml-in expr.........
I expect that this is somewhere in the documentation, but I cant seem to find it. I appolagise if I am asking a stupid question. I am creating a list of jobs to be done in our department, and to populate one of the html tables, I need to get a database column from a query based on a lookup table. In other words I am trying to do something similar to: <dtml-in expr="qryJobType(JOB_TYPE_ID='6')"> This works ok and returns the results where the JOB_TYPE_ID=6. However the JOB_TYPE_ID needs to be retrieved from another query. I have tried: <dtml-in expr="qryJobType(JOB_TYPE_ID='<dtml-var Type_ID-->')"> But this doesnt work. I am assuming that the '' around the dtml-var is trying to treat this literally rather than expand it. I imagine that I have to do something to this to escape it from this action but cant seem to find out what. IF someone could point me in the right direction, I would be very grateful. Please email me any answers as well as posting here as I may not see a response here. Tim Gildersleeve timg@bilk.ac.uk <mailto:timg@bilk.ac.uk>
on Thursday, May 04, 2000 Tim Gildersleeve wrote : TG> I expect that this is somewhere in the documentation, but I cant seem to TG> find it. I appolagise if I am asking a stupid question. TG> I am creating a list of jobs to be done in our department, and to populate TG> one of the html tables, I need to get a database column from a query based TG> on a lookup table. TG> In other words I am trying to do something similar to: TG> <dtml-in expr="qryJobType(JOB_TYPE_ID='6')"> TG> This works ok and returns the results where the JOB_TYPE_ID=6. However the TG> JOB_TYPE_ID needs to be retrieved from another query. I have tried: TG> <dtml-in expr="qryJobType(JOB_TYPE_ID='<dtml-var Type_ID-->')"> TG> But this doesnt work. I am assuming that the '' around the dtml-var is TG> trying to treat this literally rather than expand it. I imagine that I have TG> to do something to this to escape it from this action but cant seem to find TG> out what. TG> IF someone could point me in the right direction, I would be very grateful. TG> Please email me any answers as well as posting here as I may not see a TG> response here. Try something like : <dtml-in expr="qryJobType(JOB_TYPE_ID=Type_ID)"> You cannot nest DTML inside DTML.. -- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
Tim Gildersleeve wrote:
I expect that this is somewhere in the documentation, but I cant seem to find it. I appolagise if I am asking a stupid question. I am creating a list of jobs to be done in our department, and to populate one of the html tables, I need to get a database column from a query based on a lookup table. In other words I am trying to do something similar to: <dtml-in expr="qryJobType(JOB_TYPE_ID='6')"> This works ok and returns the results where the JOB_TYPE_ID=6. However the JOB_TYPE_ID needs to be retrieved from another query. I have tried: <dtml-in expr="qryJobType(JOB_TYPE_ID='<dtml-var Type_ID-->')"> But this doesnt work. I am assuming that the '' around the dtml-var is trying to treat this literally rather than expand it. I imagine that I have to do something to this to escape it from this action but cant seem to find out what.
AFAIK, you can't embed dtml calls inside another dtml call. It would be nice though! Instead, you can store the job type id in a variable and then use the variable as follows: <dtml-call "REQUEST.set('JobTypeID',Type_ID)"> <dtml-in "qryJobType(JOB_TYPE_ID=JobTypeID)"> ... </dtml-in> Obviously, how you get the Type_ID in the first place is up to you but I presume you've already sorted that out. HTH /Matt. -- Matt Goodall | Isotek Electronics Ltd email: mgg@isotek.co.uk | Claro House, Servia Road Tel: +44 113 2343202 | Leeds, LS7 1NL Fax: +44 113 2342918 | England
I expect that this is somewhere in the documentation, but I cant seem to find it. I appolagise if I am asking a stupid question. ... In other words I am trying to do something similar to: <dtml-in expr="qryJobType(JOB_TYPE_ID='6')"> This works ok and returns the results where the JOB_TYPE_ID=6. However the JOB_TYPE_ID needs to be retrieved from another query. I have tried: <dtml-in expr="qryJobType(JOB_TYPE_ID='<dtml-var Type_ID-->')"> ...
Try: <dtml-in expr="qryJobType(Type_ID)" mapping> or just: <dtml-in "qryJobType(Type_ID)" mapping> In expressions use var_name instead of <dtml-var var_name> If your variable has a "special name" (like "sequence-index") use _.['var_name'] ( sample : _.['sequence-index']) All the best! PM
participants (4)
-
Geir B�kholt Hansen -
Marcel Preda -
Matt Goodall -
Tim Gildersleeve