(Sorry, posted to the newsgroup only the first time...)

I just made the following function, which will delete the values from
whole rows of a query object. Unfortunately, it does not delete the
rows themselves. (In other words, it's useless ;-). Maybe it'll give
you some ideas, though.

I wish I knew more about what a "query object" is. What do you mean
it's a structure of "mostly" arrays? Why "mostly?"

<cfscript>
function QueryDeleteRow(queryName, row) {
        var colList = evaluate(queryName & '.columnlist');
        var colListLen = listlen(colList);
        var colName = '';
        var tmp = '';
        
        for (i=1; i LTE colListLen; i=i+1) {
                colName = listgetat(colList, i);
                tmp = evaluate("querysetcell(" & queryName & ", '" &
colName & "', '', " & row & ")");
        }
        return '';
}
</cfscript>


<cfdump var="#QueryDeleteRow('yourQueryName', 4)#">

Thanks,
Jamie



On Mon, 01 Jul 2002 18:41:45 -0400, Troy Simpson
<[EMAIL PROTECTED]> wrote:

>It appears that the following does not work:
>
>Since a query is a Structure of mostly Arrays, I figure that I can use
>the column list to get a list of arrays in the query structure and use
>the ArrayDeleteAt Function to delete the associated element for the row.
>
>Anyone know how to delete a row from a query structure?
>
>Thanks,
>Troy
>
>Troy Simpson wrote:
>
>> All,
>>
>> I am utilizing a query structure and using query functions to add more
>> data to the structure.  I'm able to add new rows to the query structure
>> and add new data, but how do I delete a row of data from the query
>> structure?
>>
>> Since a query is a Structure of mostly Arrays, I figure that I can use
>> the column list to get a list of arrays in the query structure and use
>> the ArrayDeleteAt Function to delete the associated element for the row.
>>
>> Is this the way to do this in CF 4.51?
>>
>> On a side note, is CF 5 or better have a better way to do this?
>>
>> Thanks,
>> Troy
>>
>> --
>> -------------------------
>> Troy Simpson
>>   Applications Analyst/Programmer
>>   Microsoft Certified Systems Engineer
>>   Oracle Certified Professional DBA
>> North Carolina State University Libraries
>> Campus Box 7111 | Raleigh | North Carolina
>> ph.919.515.3855 | fax.919.513.3330
>> E-mail: [EMAIL PROTECTED]
>>
>> 
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to