Other Languages - ColdFusion - Asked By Simarpal on 09-Dec-11 01:59 AM

HI ,

I am working on coldfusion first time only. I have to create simplest application. I have to add the employee details in database,. Can your team help me by providing the code? .Details contain EmployeeNumber, FName, LName, EmailID, COntact, Qualification. Employee number should be auto generated.


Sooner will be better
Riley K replied to Simarpal on 09-Dec-11 02:13 AM

The preceding example inserts data into all the fields of a table (the Employee table has seven fields). There might be times when you do not want users to add data into all fields.

To insert data into specific fields, the SQL statement in the cfquery must specify the field names following both INSERT INTO and VALUES.

 For example, the following cfquery omits salary and start date information from the update. Database values for these fields are 0 and NULL, respectively, according to the database’s design.

<cfquery name="AddEmployee" datasource="cfdocexamples">
  INSERT INTO Employee
    (Emp_ID,FirstName,LastName,
    Dept_ID,Contract)  
  VALUES 
    (#Form.Emp_ID#,'#Form.FirstName#','#Form.LastName#', 
    #Form.Dept_ID#,'#Form.Contract#')
</cfquery>


Refer this link for updating deleteing records also

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0e02b-7ff3.html#WSc3ff6d0ea77859461172e0811cbec0e02b-7fec

Regards
Simarpal replied to Riley K on 23-Dec-11 06:07 AM
Can you please provide me some web page application in coldfusion ASAP?