An easier way to insert data from Query Object intodatabase?

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default An easier way to insert data from Query Object intodatabase?

    I'm currently using CFHTTP to get a CSV file and convert it into a QUERY
    OBJECT. I want to take this query object and insert it into a DATASOURCE I
    have setup on my server. Currently, I have to use CFLOOP to go through each
    record; but there are 100,000 records!!! The operation is timing-out on me,
    not to mention the obvious, taking FOREVER to do. Is there anyway to insert
    ALL of the records from this QUERY OBJECT, into my DATASOURCE and do it with
    less stress on COLDFUSION, and much more on the DATABASE(I don't want to use
    CFLOOP)?

    Tomdogggg Guest

  2. Similar Questions and Discussions

    1. Insert Object > Feather
      Im new to InDesign and I cant understand why we dont have enough "image" options? It just so happens I am working on a brochure for a chicken farm...
    2. INSERT QUERY WEIGHT
      Hi I would like to know if there is a limit in mysql to the weight of an insert query, I mean which size of data can I insert in my table at the...
    3. Easier way to insert 100000 records into MSACCESSdatasource?
      I'm crashing my server with a CFLOOP command that loops through a query result set(query of queries). Is there anyway that I can insert ALL of the...
    4. SQL Insert Query using ADO
      Hi, I am sending an SQL Insert query to my ADO connection object, my Insert query looks a litte like this... INSERT INTO tblRequests...
    5. DataAdapter Insert data into a query
      I have the query "SELECT * FROM RIGHT JOIN VisiterInfo ON .=VisiterInfo." which I use to select data from two tables to display on screen. I use...
  3. #2

    Default Re: An easier way to insert data from Query Object intodatabase?

    What database?
    Stressed_Simon Guest

  4. #3

    Default Re: An easier way to insert data from Query Object intodatabase?

    an MSACCESS database
    Tomdogggg Guest

  5. #4

    Default Re: An easier way to insert data from Query Object intodatabase?

    I guess an idea I'm trying to get at is in the SQL statement, is there anyway I
    can do this:

    <cfquery datasouce="ds">
    SELECT COLUMN_1,COLUMN_2,COLUMN_3
    INTO DATABASE_TABLE
    FROM QUERYOBJECT.THEQUERY
    </cfquery>

    Basically, I guess I'm trying to access 2 datasources in the same query.

    Tomdogggg Guest

  6. #5

    Default Re: An easier way to insert data from Query Object intodatabase?

    If this doesn't have to be automated. Just use MSAccess to import the file.
    Don't even bother with CF.

    Otherwise, cfloop is pretty much your only choice. You could break it up
    somehow such as sorting on an ID column, running the first 10,000 records, then
    the next 10,000. I'm not sure exactly how to do this, but there should be a way
    (maybe use cflocation after the cfloop and pass in the ID number to start with).

    mattw Guest

  7. #6

    Default Re: An easier way to insert data from Query Object intodatabase?

    Tomdogggg,

    I agree with mattw. If this is a one time import, just do it directly in
    Access. If not, then it may be possible to import a csv file into Access using
    cfquery but without looping. Given the amount of data you're importing, I
    don't know that it is the best solution, but I believe it is possible.

    mxstu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139