Results 1 to 4 of 4

Thread: Importing large quantities of records in MySQL DB

  1. #1
    Join Date
    Jul 2010
    Posts
    37

    Importing large quantities of records in MySQL DB

    I have a problem importing data from text files to large (70 MB) in my db in MySQL. The error I get is very generic "trappable error occurred in an external object".!! I noticed that part of about 40,000 records and then terminate the process. What do you advise me to do? It would be impossible to ensure that the procedure reads from a particular record to another, and then read the last record to another record and so on? I hope that I explained. So scholars, please help me...

  2. #2
    Join Date
    Apr 2008
    Posts
    193

    Re: Importing large quantities of records in MySQL DB

    Actually, it is not enough to understand what exactly are you having the problem. It would be better to troubleshoot for us, if you post the error message that you are getting along with the coding. There are chances that you might be missing something, that can be checked after seeing your code. If you are looking for some solutions, I would like to recommend you to post your coding snippet. I am sure that someone from our side will definitely help you.

  3. #3
    Join Date
    Jul 2010
    Posts
    37

    Re: Importing large quantities of records in MySQL DB

    To be precise, the error is as follows:
    Active Server Pages error 'ASP 0115'
    Unexpected error
    A trappable error (E06D7363) occurred in an external object. The script can not continue running.
    Here is the script :
    Code:
    <%
      Dim con, fs, objfile, objFileTextStream, i, strSQL, file
      Dim strLine, strLine1, strValue1, strValue2, strValue3, strValue4, strValue5, strValue6, strValue7
    
     September fs = Server.CreateObject ("Scripting.FileSystemObject")
    
     file = Server.MapPath ("/ public / myfile.txt")
    
     September objfile fs.GetFile = (file)
    
     September objFileTextStream objFile.OpenAsTextStream = (1)
    
     Do While objFileTextStream.AtEndOfStream <> True
        strLine = objFileTextStream.ReadLine
        strLine1 = split (strLine ,"|")
        for i = 0 To UBound (strLine1)
          If i = 0 Then
            strValue1 = Trim (strLine1 (i))
          ElseIf i = 1 Then
            strValue2 = Trim (strLine1 (i))
          ElseIf i = 2 Then
            strValue3 = Trim (strLine1 (i))
          ElseIf i = 3 Then
            strValue4 = Trim (strLine1 (i))
          ElseIf i = 4 Then
            strValue5 = Trim (strLine1 (i))
          ElseIf i = 5 then
            strValue6 = Trim (strLine1 (i))
          ElseIf i = 6 then
            strValue7 = Trim (strLine1 (i))
          End If
        Next
    
    
        strSQL = "INSERT INTO table (value1, value2, value3, value3, value4, Value5, Value6, Value7) Values ('" & strValue1 & "', '" & strValue2 & "', '" & strValue3 & "', '" & strValue4 &"',' "& strValue5 &"','"& strValue6 &"','"& strValue7 &" '"
    
        con.Execute strSQL
      Loop
    
      objFileTextStream.Close
      September objFileTextStream = Nothing
      September fs = Nothing
     %>

  4. #4
    Join Date
    Dec 2008
    Posts
    202

    Re: Importing large quantities of records in MySQL DB

    At the very least missing a parenthesis at the end of SQL. You would try the following code:
    Code:
    for i = 0 To UBound (strLine1)
          If i = 0 Then
            strValore1 = Trim (strLine1 (i))
          ElseIf i = 1 Then
            strValore2 = Trim (strLine1 (i))
          ElseIf i = 2 Then
            strValore3 = Trim (strLine1 (i))
          ElseIf i = 3 Then
            strValore4 = Trim (strLine1 (i))
          ElseIf i = 4 Then
            strValore5 = Trim (strLine1 (i))
          ElseIf i = 5 then
            strValore6 = Trim (strLine1 (i))
          ElseIf i = 6 then
            strValore7 = Trim (strLine1 (i))
          End If
        Next
    I feel useless, instead you should try this:
    Code:
    strValore1 = Trim (strLine1 (0))
     strValore2 = Trim (strLine1 (1))
     strValore3 = Trim (strLine1 (2))
     strValore4 = Trim (strLine1 (3))
     strValore5 = Trim (strLine1 (4))
     strValore6 = Trim (strLine1 (5))
     strValore7 = Trim (strLine1 (6))

Similar Threads

  1. Replies: 3
    Last Post: 27-11-2010, 10:47 PM
  2. Replies: 3
    Last Post: 19-07-2010, 04:23 PM
  3. PHP mysql select unique records from one table
    By Captain Carrot in forum Software Development
    Replies: 6
    Last Post: 13-05-2010, 12:18 PM
  4. MySql to show records which is not a value
    By Grundy in forum Software Development
    Replies: 3
    Last Post: 23-07-2009, 07:48 PM
  5. How to Extract records from Mysql database using JTable
    By StudyBoy in forum Software Development
    Replies: 3
    Last Post: 08-04-2009, 06:22 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,405,124.64994 seconds with 17 queries