This xml doc could have around 1000 "sections"...thus the 1, 2, 3 being
essentially new set of data with a bunch of fields as a part of those...

So would that work to do QueryNew, then set cell, then the field name, then
#fieldname#....is that the idea?  Since this struct I think has an array
(which is what is confusing me) in it because of the multiple 1s, 2s, that I
really don't know how to reference..does that make sense?  That�s why I
thought looping the collection may work, but obviously not.

This is what I am working with:  (seems too simple thus frustration level,
ha!)

<CDJWebDoc>
<CDJWeb>
<SKUNumber>      1006</SKUNumber>
<UnitCost>       56.33</UnitCost>
</CDJWeb>
<CDJWeb>
<SKUNumber>      1006</SKUNumber>
<UnitCost>       56.33</UnitCost>
</CDJWeb>
...and on...
</CDJWebDoc>


Regards,

Eric J. Hoffman
DataStream Connexion
www.datastreamconnexion.com



-----Original Message-----
From: Andre Mohamed [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 13, 2003 11:42 AM
To: CF-Talk
Subject: RE: How to access row in loop



Depending on the impact you might want to reimplement your cdjwebdoc.cdweb
structure as a query using QueryNew etc. as long as each "row" has the same
"columns"...this certainly seems to be what you are trying to achieve.

Then you can use cfloop query="..." as normal. A little easier to read and
manage.

....but to answer your query...the "currentrow" variable isn't set when
looping over a structure as far as I know.

Thanks,

Andr�

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 13 March 2003 17:22
To: CF-Talk
Subject: How to access row in loop

Here's my busted attempt to get certain items from a structure while looping
through it...can someone tell me where I messed up?

(structure is like this:  cdjwebdoc.cdweb.1.sku
                          cdjwebdoc.cdweb.1.unitcost
                          cdjwebdoc.cdweb.2.sku and so on

heres my busted attempt:
 
<cfloop collection="cdjwebdoc.cdweb">
  <!---Check for existence of SKU---->
  <cfquery name="check" datasource="#dsn#">
  Select id from inventory where sku =
'#trim(cdjwebdoc.cdweb.[currentrow].sku)#'
  </cfquery>
  <cfif check.recordcount EQ 1>
    <!--- IF SO, Update--->
    <cfquery name="updateinv" datasource="#dsn#">
    Update inventory set 
        intcontent = '#cdjwebdoc.cdweb.[currentrow].internetdescription#',
        invtitle = '#cdjwebdoc.cdweb.[currentrow].invoicedescription#', 
        sellprice = #cdjwebdoc.cdweb.[currentrow].internetsellfor#,
        sale = #cdjwebdoc.cdweb.[currentrow].sale#, 
        item_cost = #cdjwebdoc.cdweb.[currentrow].unitcost#,
        inventory_minimum = #cdjwebdoc.cdweb.[currentrow].minimuminventory#
     Where
        sku = '#trim(cdjwebdoc.cdweb.[currentrow].sku)#'

    </cfquery>

How does a guy go about making that work??  Or am I in the wrong ballpark? 

Regards,

Eric J. Hoffman
DataStream Connexion
www.datastreamconnexion.com






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to