I appologise if I really confused you and I am still learning the Coldfusion
and I am unable to code in a proper way.
These are my ColdFuion Fields in the Coldfusion page:
FirstName, LastName,Address,PhoneNumber, EmployerID, DepartmentID ,
DepartmentName, EmployerID, Branch
Sql Database Tables:
Table1: Employer
FirstName, LastName,Address,PhoneNumber, EmployerID (Primary Key)
Daniel Ray NJ 123-123-2123 1234
Ria Parks Nj 124-123-1234 1221
EmloyerID is the Primary key.
Table2: Department
DepartmentID , DepartmentName, EmployerID, Branch, SNO(Unique Identifier)
12 Economics 1234 NJ 111
13 Physics 1234 NJ 121
12 Economics 1221 PA 123
EmployerID can be repeated but not SNO should be unique.
I need to do two things.
1. Depending on the entry of the formfield values. The database tables should
be either inserted or updated. If the row already exsist then the row should be
inserted and if exsist row should be updated.
eg: I need to add the Chemistry DepartmentNAme to the EmployerID 1234. I need
to check before the insert statement whether or not the data in the table. How
do I really check this.
2. Once the action takes place either update or delete, I need to display the
list of the action taken place in the user session on the coldfusion page.
Session is just the user session here.
eg: DepartmentName for 1234 is insesrted
Salary for 1221 has been updated
.
.
.
Hope I am very clear now...
Thanks,
Priya
>> I have an issue and I am out of my mind...... to solve it.
>>
>> FieldNames:
>>
>> FirstName, LastName,Address,PhoneNumber, EmployerID, DepartmentID ,
>> DepartmentName, EmployerID, Branch
>
>Ok, what about these field names? Can you explain for us please? Are these
>columns in a table? Columns in a result set? Do you realize you have
>EmployerID in there twice??
>
>>
>> Table Employee
>> FirstName, LastName,Address,PhoneNumber, EmployerID
>>
>
>Is EmployerID the primary key or a foreign key? I would have expected it to
>be called EmployeeID if it were the primary key, since an employer employs
>the employee.
>
>> Table Department
>> DepartmentID , DepartmentName, EmployerID, Branch
>
>
>> I have a FirstName attribute in the table and I want to compare these
>> attribute (FirstName) with the fieldvalue.
>
>What field value?? Is this in a ColdFusion page or a SQL statement? Where
>is the fieldvalue coming from? A form? The Url? In what way do you want
>to compare? Do you want to compare a single record, or more than one?
>
>? I thought of using arrays but I don't know how to add database date to the
>array and compare.
>
>What is a database date? None of the columns you have mentioned so far seem
>to have anything to do with dates. Setting a date into an array is easy as
><cfset myArray = [now()]> but I'm not sure where you are going with this.
>
>> I also have one more issue. I am trying to insert data into the database
>> and once the data is inserted the inserted (FirstName) should be displayed
>> (Primary Key is EmployerID).
>
>What table is this? The employee table? If EmployerID is the primary key
>of the Employee table, why is that column also in the Department table? If
>two people are in the same department, do you have two department records
>with the same department name, but different EmployerIds? I'm quite
>confused.
>
>> If I add n number of FirstNames in the table in the session then it should
>> display those many New entry values in the main page. How can we do it?
>
>Is the table in session, or do you simply mean inserts into the database
>during a user's session? So you want to have a screen that shows someone
>the records they entered since their session started? You could store the
>data in a session variable, or store the primary key of the records they
>inserted. I'm not sure where you are headed, but this would also be
>possible if you had a userIDModified in the table and a datetimeCreated
>column. You could simply query out the records that user had inserted since
>the time their session started.
>
>> Can anyone help me with this?
>
>Probably, but we need a bit more direction on what it is you are doing. I'm
>pretty bad at guessing.
>
>~Brad
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320259
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4