I have a single form that is generated dynamically based on N records
pulled from a database.  Each row of the form contains roughly 10 fields,
and are named via the following convention...

course0
degree0
emp_course_id0

course1
degree1
emp_course_id1

...

All of these variables are posted to a page that processes the form. 
There is a hidden form field that describes how many rows were in the form
that helps ColdFusion look for variables.  Then it starts a loop, which
does several queries to insert (or update) records in the table.  There
there's code like this...

<CFQUERY>
INSERT INTO mytable
(course, degree, emp_course_id...)
VALUES
('#evalate("course" & i)#','#evaluate("degree" &
i)#','#evaluate("emp_course_id" & i)#')
</CFQUERY>

where "i" is the integer index of the loop.  If it were up to me, I
wouldn't design an interface that had one form editing a variable number
of records... but apparently the UI guys think it's too much clicking for
the user to choose a single record from the list and then get a form to
update it. :)


-Cliff



On Tue, April 26, 2005 2:12 pm, Bill Rawlinson said:
> yes you might be suprised what some of these guys come up with to help
> avoid
> using evaluate
> and, on top of that, if they can it will make your code faster, cleaner,
> and
> more reliable typically.
>
> Bill
>
> On 4/26/05, Peter J. Farrell <[EMAIL PROTECTED]> wrote:
>>
>> Cliff Meyers wrote:
>>
>> >I've actually found that the same thing happens when I use evaluate()
>> >inside the CFQUERY block... it throws the exact same (Oracle syntax)
>> error
>> >and the generated SQL is not escaped properly. This isn't in a Mach-II
>> >app, this is a pretty standard "straight" ColdFusion app. I know people
>> >are probably going to scream about using evaluate(), but for this app
>> >there are some very dynamic forms being built by ColdFusion we have to
>> use
>> >evaluate, there's no other way around it really. I'm waiting for a MM
>> >support rep to get back to me so I can try to provide them with a
>> >reproducible test case.
>> >
>> >
>> Can you show us some code that uses evaluate() - I remember a while a
>> ago a thread about using evaluate()...I don't recall a situation where
>> evalute() is needed now...
>>
>> --
>> Peter J. Farrell :: Maestro Publishing
>>
>> blog :: http://blog.maestropublishing.com
>> email :: [EMAIL PROTECTED]
>>
>> Create boilerplate beans!
>> Check out the Mach-II Bean Creator - free download.
>> http://blog.maestropublishing.com/mach-ii_beaner.htm
>>
>> Achievement: You can do anything you set your mind to when you have
>> vision, determination, and an endless supply of expendable labor.
>>
>> --
>>
>>
>> ----------------------------------------------------------
>> You are subscribed to cfcdev. To unsubscribe, send an email to
>> [email protected] with the words 'unsubscribe cfcdev' as the subject of
>> the email.
>>
>> CFCDev is run by CFCZone (www.cfczone.org <http://www.cfczone.org>) and
>> supported by CFXHosting (www.cfxhosting.com
>> <http://www.cfxhosting.com>).
>>
>> An archive of the CFCDev list is available at
>> www.mail-archive.com/[email protected]<http://www.mail-archive.com/[email protected]>
>>
>>
>
>
> --
> [EMAIL PROTECTED]
> http://blog.rawlinson.us
>
> If you want Gmail - just ask.
>
>
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to
> [email protected] with the words 'unsubscribe cfcdev' as the subject of
> the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> (www.cfxhosting.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
>



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]


Reply via email to