Advertisement

03.05.2008 at 11:13AM PST, ID: 23217121
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.5

Importing data into MySQL using coldfusion

Asked by brihol44 in Cold Fusion Markup Language, MySQL Server

Tags:

First of all my values align correctly if I don't have empty values twice in a row in a column (You can see the "excel-file-before.jpg as my example of information where I get empty values twice in a row).

Please let me know what I can do to get the values to align correctly if I do have empty values twice in a column like the example.

I've also attached a screenshot of what I get when the data is in my MySQL table. You can see the address is in the last name column.

Thanks

B  
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
<cfile action="read".....
 
<cfloop index="record" list="#fileData#" delimiters="#chr(10)##chr(13)#">
  
        <cfif record EQ " " OR record EQ "">
        <cfelse>        
                <cfset record = ReplaceNoCase(record,"#chr(9)##chr(9)#", "#chr(9)#'NULL'#chr(9)#", "ALL")>
                <cfquery name="qryInsert" datasource="protrade">
                INSERT INTO advertisers_temp (advertiser_id, contact_group, company_name, first_name, last_name, address1, address2)
                VALUES (		  <cfqueryparam value="#listgetat(record,1,chr(9))#" cfsqltype="cf_sql_integer">,
								  <cfqueryparam value="#listgetat(record,2,chr(9))#" cfsqltype="cf_sql_varchar">,
								  <cfqueryparam value="#listgetat(record,3,chr(9))#" cfsqltype="cf_sql_varchar">,
								  <cfqueryparam value="#listgetat(record,4,chr(9))#" cfsqltype="cf_sql_varchar">,
								  <cfqueryparam value="#listgetat(record,5,chr(9))#" cfsqltype="cf_sql_varchar">,
								  <cfqueryparam value="#listgetat(record,6,chr(9))#" cfsqltype="cf_sql_varchar">,
								  <cfqueryparam value="#listgetat(record,7,chr(9))#" cfsqltype="cf_sql_varchar">)
                </cfquery>
        </cfif>
</cfloop>
Attachments:
 
Screen shot of excel file before
Screen shot of excel file before
 
 
Screen shot of mysql db after export
Screen shot of mysql db after export
 
[+][-]03.06.2008 at 05:22PM PST, ID: 21066430

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Cold Fusion Markup Language, MySQL Server
Tags: Coldfusion & MySQL
Sign Up Now!
Solution Provided By: pmascari
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.10.2008 at 01:03PM PDT, ID: 21089878

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628