Professional Web Applications Themes

Convert a query to a list, or find an item in a query - Macromedia ColdFusion

Hi All, I am using CFPOP to retrieve mail from a server, then delete each message after I retrieve it. What I want to do is to check that I don;t already hae the message before I try to insert it into my database, just so I don't duplicate any messages. I thought the best way to do this was by doing a query on my email table for just the messageID's, then comparing the current messageID to it. What I can't figure out how to do is do a findnocase on a query, or to convert a query to ...

  1. #1

    Default Convert a query to a list, or find an item in a query

    Hi All,

    I am using CFPOP to retrieve mail from a server, then delete each message
    after I retrieve it. What I want to do is to check that I don;t already hae the
    message before I try to insert it into my database, just so I don't duplicate
    any messages. I thought the best way to do this was by doing a query on my
    email table for just the messageID's, then comparing the current messageID to
    it. What I can't figure out how to do is do a findnocase on a query, or to
    convert a query to a string.


    Cheers

    David

    Laverda668 Guest

  2. #2

    Default Re: Convert a query to a list, or find an item in aquery

    I seem to be answering most of my own questions tonight:

    <cfset MessageIDArray = ArrayNew(1)>
    <cfloop query="MessageIDs">
    <cfset temp = ArrayAppend(MessageIDArray, #MessageIDs.messageID#)>
    </cfloop>
    <cfset MessageIDlist = ArrayToList(MessageIDArray, ",")>

    I found that I have to convert the query to an array then convert the array to
    a list.

    Laverda668 Guest

  3. #3

    Default Re: Convert a query to a list, or find an item in aquery

    You can convert query values directly to a list:

    <cfset MessageIDlist = ValueList(MessageIDs.messageID)>

    OldCFer Guest

Similar Threads

  1. List to Query
    By slanza in forum Macromedia ColdFusion
    Replies: 2
    Last Post: June 3rd, 08:43 AM
  2. Can't find the first item in the list
    By Torgom in forum Macromedia ColdFusion
    Replies: 3
    Last Post: May 22nd, 11:53 PM
  3. Query of Queries on query New type query
    By david_h in forum Coldfusion Database Access
    Replies: 2
    Last Post: May 6th, 08:55 PM
  4. query to list
    By weblover in forum Coldfusion - Advanced Techniques
    Replies: 6
    Last Post: April 30th, 09:09 AM
  5. Menu Item problem with SQL query
    By singh83 in forum Dreamweaver AppDev
    Replies: 2
    Last Post: April 14th, 02:23 PM

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
  •  

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