Hi, I am returning a list of records from a zsql method with dtml-in I want to query another zsql method during each iteration of the outer dtml-in to get a value from another database based on the login just displayed in the first dtml-in (at least this is how I think it would go from a dtml standpoint) I have one database which displays user names based on some search parameter. I would then like to query a second database to get the actual name of the person to display below their user name. My first attempt showed all of the users listed and then only one of the user names had an associated real name...I think this was because I was getting the very last match to login in the second database, not one matches for each iteration of the in loop <dtml-in AssetList size=20 start=query_start> ... <dtml-var LOGIN null="Not Listed"> <dtml-in "emp_lookup()"> &dtml-first; &dtml-last; </dtml-in> ... </dtml-in> emp_lookup looks like: select Firstname as first, Lastname as last from employees where login= '<dtml-var LOGIN>' Any ideas on how to do this syntactically?
Kelley, Sean wrote at 2003-6-25 16:07 -0700:
I am returning a list of records from a zsql method with dtml-in I want to query another zsql method during each iteration of the outer dtml-in to get a value from another database based on the login just displayed in the first dtml-in (at least this is how I think it would go from a dtml standpoint)
You must pass the argument to the inner ZSQL Method via a keyword parameter. ... innerSQLMethod(emp=...) ... Use the "prefix" attribute to "dtml-in" to facilitate access to the current loop value. Dieter
participants (2)
-
Dieter Maurer -
Kelley, Sean