EasyCFM.COM ColdFusion Forums / Coding Help! / importing data to database

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: importing data to database

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

tans007
09-22-2008 @ 7:55 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 604
Joined: May 2003

Hi there

I have a MySQL database setup with a table called members.

Basically the structure of the table is

Memberid    varchar 25
Firstname   varchar 40
Lastname    varchar 40

I have received the members list in an excel spreadsheet - approx 5,000 names.

Had the Memberid column been autogenerating then it would have been easy.  Just wanted to check how I do the the import - can I do an import to the table and if so how do I put a value into the the memberid column.

Thanks in advance

Toby

cfSearchin
09-22-2008 @ 8:39 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

quote:

Had the Memberid column been autogenerating then it would have been easy.  Just wanted to check how I do the the import - can I do an import to the table and if so how do I put a value into the the memberid column.


I do not understand this part.  Are you saying the import file contains only FirstName, LastName? If member ID is not an auto incrementing value, where does it come from?

tans007
09-22-2008 @ 11:58 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 604
Joined: May 2003

I have solved the issue - a bit of a work around but all is working now

Toby

cfSearchin
09-23-2008 @ 8:26 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

quote:

I have solved the issue - a bit of a work around but all is working now


Glad you solved it.  Care to post the solution so others reading this question in the future can benefit? Smile



tans007
09-23-2008 @ 3:41 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 604
Joined: May 2003

OK to let people know what I did.

I created a temporary table, imported the data to this table then developed a quick CF program to read this table and insert records to the existing table - sorry no rocket science

Toby

cfSearchin
09-24-2008 @ 12:45 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 608
Joined: Feb 2008

Thanks Toby.  I am sure the answer will help someone else trying to do the same thing in the future.




Website Designed and Developed by Pablo Varando.