Adding data using Cold Fusion - PowerPoint PPT Presentation

About This Presentation
Title:

Adding data using Cold Fusion

Description:

Adding data using Cold Fusion. Step 1: Display a form to collect the data. ... title Sales re added /title /head body h1 Sales rep added /h1 cfoutput ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 6
Provided by: aryyagang
Category:
Tags: adding | cold | data | fusion | readding | using

less

Transcript and Presenter's Notes

Title: Adding data using Cold Fusion


1
Adding data using Cold Fusion
  • Step 1 Display a form to collect the data.
    The input fields must have the same
  • name as that of the columns in
    the destination table
  • Step 2 Submit the form to Cold Fusion for
    processing
  • Step 3 Add the row via the ODBC driver using
    SQL

2
The Add record form
lthtmlgt ltheadgt lttitlegtAdd sales
repslt/titlegt lt/headgt ltbodygt lth1gtAdd a new sales
replt/h1gt ltform action"slsrepadd2.cfm"
method"post"gt ltpgt ltbgtSales rep
numberlt/bgt ltinput type"text" name"slsrnumb"
size"3" maxlength"10"gt ltbrgt Name ltinput
type"text" name"slsrname" size"20"
maxlength"30"gt ltbrgt Address ltinput type"text"
name"slsraddr" size"30" maxlength"50"gt ltbrgt Tot
al commission
ltinput type"text" name"totcomm" size"5"
maxlength"10"gt ltbrgt
3
The Add record form contd.
Commision rate ltinput type"text"
name"commrate" size"5" maxlength"10"gt ltpgt ltinp
ut type"submit" value"Add sales rep"gt ltinput
type"reset" value"Clear"gt lt/formgt lt/bodygt lt/html
gt
4
Processing additions using insert statement
ltcfquery datasource"oracle"gt insert into slsrep
values (slsrnumb, 'slsrname', 'slsraddr',
totcomm, commrate) lt/cfquerygt lthtmlgt ltheadgt lt
titlegtSales re addedlt/titlegt lt/headgt ltbodygt lth1gt
Sales rep addedlt/h1gt ltcfoutputgt Sales rep
ltbgtslsrnamelt/bgt added. lt/cfoutputgt lt/bodygt lt/h
tmlgt
5
Processing additions using cfinsert tag
  • Hides the complexity of building dynamic SQL
    statements

ltcfinsert datasource"oracle" tablename
"SLSREP" formfields"slsrnumb, slsrname,
slsraddr, totcomm"gt lthtmlgt ltheadgt lttitlegtSales
re addedlt/titlegt lt/headgt ltbodygt lth1gt Sales rep
addedlt/h1gt ltcfoutputgt Sales rep
ltbgtslsrnamelt/bgt added. lt/cfoutputgt lt/bodygt lt/h
tmlgt
Write a Comment
User Comments (0)
About PowerShow.com