Skip to main content
Participant
April 11, 2011
Question

OutOfMemory error for Insert statement

  • April 11, 2011
  • 2 replies
  • 864 views

I am trying to execute a insert statement like "Insert into B (c1,c2...) select c1,c2.... from B" by using <cfquery>, but a OutOfMemory error pop up after a long time runing.

I am using Teredata DB,  Is there anybody know what is the root cause? and how can i fix this.

Thanks for ur help.

    This topic has been closed for replies.

    2 replies

    Derek_GuoAuthor
    Participant
    April 11, 2011

    Sorry for the typo.

    The SQL should be:

    Insert into A (c1,c2...) select c1,c2.... from B

    Inspiring
    April 11, 2011

    Is there any reason you have to insert into A instead of simply using B?

    Inspiring
    April 11, 2011

    What happens when you try to run this query without using Coldfusion?

    Derek_GuoAuthor
    Participant
    April 11, 2011

    It works fine when in Teredata SQL Assistant. One thing to mention is there are around 7,500,000 records will be processed.

    When I run it with cfquery, the error msg came out.

    Owainnorth
    Inspiring
    April 11, 2011

    Almost certainly you'll be better off doing a command like that from with the database engine, using a Stored Proc or similar. Then you only need to use CF to call the proc.