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
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

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

Reply via email to