RE: Multiple Record Update

2002-05-31 Thread Philip Arnold - ASP

 I have a form that displays multiple records populated from
 the database.  Something like this:

 Department
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 .
 .
 Department
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 .
 .
 etc.

 The question is how to I process this?  It passes multiple
 EmployeeID's (from hidden field), but only the text input
 fields if they are populated (they aren't required).

 I think I've done it before, but I'm brain dead today.

Name the text fields in relation to the EmployeeID, so
EmployeeName_1, Add1_1, Add2_1
EmployeeName_5, Add1_5, Add2_5

Then loop through the EmployeeIDs doing updates on those records with
those fields

cfloop index=I list=#form.EmployeeID#
update EmployeeInfo
set EmployeeName='#Form[EmployeeName_  i]#',
Add1='#Form[Add1_  i]#',
Add2='#Form[Add2_  i]#'
where EmployeeID=#i#
;
/cfloop

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911

www.aspmedia.co.uk
www.aspevents.net

An ISO9001 registered company.

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**


__
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
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



Re: Multiple Record Update

2002-05-31 Thread Jason Miller

On the page that processes just send over the Unique identifier/primary key - and all 
the variables.
use the cfupdate tag to update database records. If updating multiple tables - On 
small forms - I just set a cfupdate tag for each table and enter the values to be 
updated.
Here is an example using access - which I assume since you didn't state any other db

cfupdate
  datasource=datasource
  tablename=UsersInfo
  dbtype=ODBC
  formfields=UserName, Location, Email, Address1, Address2, Flr, City, State, Zip, 
Tele, Fax, CareOf, SpecialInst, PPQuestion, PPAnswer, AirportCode

  cfupdate
  datasource=datasource
  tablename=Users
  dbtype=ODBC
  formfields=UserName, Password

hope this is what you were looking for.
jay miller

Terry wrote:

 Hi--

 I have a form that displays multiple records populated from the database.  Something 
like this:

 Department
 EmployeeName  Add1(text input)   Add2(text input)  City (text input)
 EmployeeName  Add1(text input)   Add2(text input)  City (text input)
 .
 .
 Department
 EmployeeName  Add1(text input)   Add2(text input)  City (text input)
 EmployeeName  Add1(text input)   Add2(text input)  City (text input)
 .
 .
 etc.

 The question is how to I process this?  It passes multiple EmployeeID's (from hidden 
field), but only the text input fields if they are populated (they aren't required).

 I think I've done it before, but I'm brain dead today.

 TIA

 Terry

 
__
Get the mailserver that powers this list at http://www.coolfusion.com
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



RE: Multiple Record Update

2002-05-31 Thread Philip Arnold - ASP

On this, try to avoid using CFINSERT and CFUPDATE - they're horrible and
slow, not to mention having memory leaks at times...

Use real SQL as much as you can

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911

www.aspmedia.co.uk
www.aspevents.net

An ISO9001 registered company.

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**


 -Original Message-
 From: Jason Miller [mailto:[EMAIL PROTECTED]]
 Sent: 31 May 2002 15:58
 To: CF-Talk
 Subject: Re: Multiple Record Update


 On the page that processes just send over the Unique
 identifier/primary key - and all the variables.
 use the cfupdate tag to update database records. If updating
 multiple tables - On small forms - I just set a cfupdate tag
 for each table and enter the values to be updated.
 Here is an example using access - which I assume since you
 didn't state any other db

 cfupdate
   datasource=datasource
   tablename=UsersInfo
   dbtype=ODBC
   formfields=UserName, Location, Email, Address1, Address2,
 Flr, City, State, Zip, Tele, Fax, CareOf, SpecialInst,
 PPQuestion, PPAnswer, AirportCode

   cfupdate
   datasource=datasource
   tablename=Users
   dbtype=ODBC
   formfields=UserName, Password

 hope this is what you were looking for.
 jay miller

 Terry wrote:

  Hi--
 
  I have a form that displays multiple records populated from
 the database.  Something like this:
 
  Department
  EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
  EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
  .
  .
  Department
  EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
  EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
  .
  .
  etc.
 
  The question is how to I process this?  It passes multiple
 EmployeeID's (from hidden field), but only the text input
 fields if they are populated (they aren't required).
 
  I think I've done it before, but I'm brain dead today.
 
  TIA
 
  Terry
 
 
 
__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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



Re: Multiple Record Update

2002-05-31 Thread Jason Miller

Really? Even for just the small forms? - this works quite quickly on the small forms - 
upon clicking submit I see the confirmation page  instantly.

I'll keep that in mind though the SQL is more powerful anyhow

Philip Arnold - ASP wrote:

 On this, try to avoid using CFINSERT and CFUPDATE - they're horrible and
 slow, not to mention having memory leaks at times...

 Use real SQL as much as you can

 Philip Arnold
 Technical Director
 Certified ColdFusion Developer
 ASP Multimedia Limited
 Switchboard: +44 (0)20 8680 8099
 Fax: +44 (0)20 8686 7911

 www.aspmedia.co.uk
 www.aspevents.net

 An ISO9001 registered company.

 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 **

  -Original Message-
  From: Jason Miller [mailto:[EMAIL PROTECTED]]
  Sent: 31 May 2002 15:58
  To: CF-Talk
  Subject: Re: Multiple Record Update
 
 
  On the page that processes just send over the Unique
  identifier/primary key - and all the variables.
  use the cfupdate tag to update database records. If updating
  multiple tables - On small forms - I just set a cfupdate tag
  for each table and enter the values to be updated.
  Here is an example using access - which I assume since you
  didn't state any other db
 
  cfupdate
datasource=datasource
tablename=UsersInfo
dbtype=ODBC
formfields=UserName, Location, Email, Address1, Address2,
  Flr, City, State, Zip, Tele, Fax, CareOf, SpecialInst,
  PPQuestion, PPAnswer, AirportCode
 
cfupdate
datasource=datasource
tablename=Users
dbtype=ODBC
formfields=UserName, Password
 
  hope this is what you were looking for.
  jay miller
 
  Terry wrote:
 
   Hi--
  
   I have a form that displays multiple records populated from
  the database.  Something like this:
  
   Department
   EmployeeName  Add1(text input)   Add2(text input)
  City (text input)
   EmployeeName  Add1(text input)   Add2(text input)
  City (text input)
   .
   .
   Department
   EmployeeName  Add1(text input)   Add2(text input)
  City (text input)
   EmployeeName  Add1(text input)   Add2(text input)
  City (text input)
   .
   .
   etc.
  
   The question is how to I process this?  It passes multiple
  EmployeeID's (from hidden field), but only the text input
  fields if they are populated (they aren't required).
  
   I think I've done it before, but I'm brain dead today.
  
   TIA
  
   Terry
  
  
 
 
__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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



RE: Multiple Record Update--Resolved

2002-05-31 Thread Terry

Thanks Phillip,

That got me going in the right direction.



*** REPLY SEPARATOR  ***

On 5/31/02 at 3:03 PM Philip Arnold - ASP wrote:

 I have a form that displays multiple records populated from
 the database.  Something like this:

 Department
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 .
 .
 Department
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 EmployeeName  Add1(text input)   Add2(text input)
 City (text input)
 .
 .
 etc.

 The question is how to I process this?  It passes multiple
 EmployeeID's (from hidden field), but only the text input
 fields if they are populated (they aren't required).

 I think I've done it before, but I'm brain dead today.

Name the text fields in relation to the EmployeeID, so
EmployeeName_1, Add1_1, Add2_1
EmployeeName_5, Add1_5, Add2_5

Then loop through the EmployeeIDs doing updates on those records with
those fields

cfloop index=I list=#form.EmployeeID#
   update EmployeeInfo
   set EmployeeName='#Form[EmployeeName_  i]#',
   Add1='#Form[Add1_  i]#',
   Add2='#Form[Add2_  i]#'
   where EmployeeID=#i#
   ;
/cfloop

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911

www.aspmedia.co.uk
www.aspevents.net

An ISO9001 registered company.

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**



__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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



RE: Multiple Record Update

2002-05-31 Thread Philip Arnold - ASP

 Really? Even for just the small forms? - this works quite
 quickly on the small forms - upon clicking submit I see the
 confirmation page  instantly.

 I'll keep that in mind though the SQL is more powerful anyhow

What you've got to remember is that CFUPDATE is ugly, code wise, it does
all of the standard
Replace(myField,','',all)
For you, but you have to pass it all sorts of things like the identity
(which it has to work out on the table), while real SQL can have a big
WHERE clause

CFINSERT and CFUPDATE are theoretically depreciated commands...

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911

www.aspmedia.co.uk
www.aspevents.net

An ISO9001 registered company.

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**


__
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
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



RE: Multiple Record Update--Resolved

2002-05-31 Thread Philip Arnold - ASP

 Thanks Phillip,

 That got me going in the right direction.

No probs, glad to help

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911

www.aspmedia.co.uk
www.aspevents.net

An ISO9001 registered company.

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**


__
Get the mailserver that powers this list at http://www.coolfusion.com
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