hi, i have encountered this little problem: i have an sqlmethod that does a select as follows: select id, name from lingue where lingua_id = <dtml-sqlvar lingua type=int> if i define lingua as an integer on the properties of document that does the query or if i use something like: <dtml-let lingua="32"> <dtml-in select_lingua_on_id>...</dtml-in> </dtml-let> i get the error: Error Type: Bad Request Error Value: ['lingua'] but if i do as follows: <dtml-call "REQUEST.set('lingua', 32)"> <dtml-in select_lingua_on_id>...</dtml-in> all goes fine... what's my error? thank you very much, federico -- Federico Di Gregorio MIXAD LIVE System Programmer fog@mixadlive.com Debian GNU/Linux Developer & Italian Press Contact fog@debian.org Don't dream it. Be it. -- Dr. Frank'n'further
----- Original Message ----- From: Federico Di Gregorio <fog@mixadlive.com>
<dtml-let lingua="32"> <dtml-in select_lingua_on_id>...</dtml-in> </dtml-let>
dtml-let is designed to add local names, which aren't visible to called objects. REQUEST.set is designed to create global names, which are visible everywhere from the moment they are created to the end of the request. Cheers, Evan @ digicool & 4-am
Scavenging the mail folder uncovered Evan Simpson's letter:
----- Original Message ----- From: Federico Di Gregorio <fog@mixadlive.com>
<dtml-let lingua="32"> <dtml-in select_lingua_on_id>...</dtml-in> </dtml-let>
dtml-let is designed to add local names, which aren't visible to called objects. REQUEST.set is designed to create global names, which are visible everywhere from the moment they are created to the end of the request.
ooh... so dtml-let is almost unusable with my style of programming (lots of subobjects that get included by dtml-var.) thank you for the explanation, federico -- Federico Di Gregorio MIXAD LIVE System Programmer fog@mixadlive.com Debian GNU/Linux Developer & Italian Press Contact fog@debian.org All programmers are optimists. -- Frederick P. Brooks, Jr.
At 09:54 AM 3/17/00 -0500, Evan Simpson wrote:
----- Original Message ----- From: Federico Di Gregorio <fog@mixadlive.com>
<dtml-let lingua="32"> <dtml-in select_lingua_on_id>...</dtml-in> </dtml-let>
dtml-let is designed to add local names, which aren't visible to called objects.
Not true. The problem is that "let" adds names to the DTML namespace stack, and SQL Methods are not passed the existing DTML namespace stack; they create a new stack. The way to do the above would be: <dtml-let lingua="32"> <dtml-in "select_lingua_on_id(lingua=lingua)">...</dtml-in> </dtml-let> This is strictly a DTML-to-SQLMethod issue. DTML calling DTML (or any other object which supports the isDocTemp=1 and (client,dict) calling protocol will work.
participants (3)
-
Evan Simpson -
fog@mixadlive.com -
Phillip J. Eby