Running query with 2 datasources

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Running query with 2 datasources

    I have two databases that I need to pull data from. One database is
    application data the other has user info. The application data base has a list
    of userID that have access to applications. The other one has a user table
    with userID, first name & Last name. I'm trying to list all the users that has
    access to application. I can do the userID but I need to display the Name of
    the user.

    This displays the userID
    <cfquery name="qry_ListUserToApp" datasource="Ai_database">
    SELECT
    CA.ID,
    CA.ApplicationID,
    CA.Name,
    CA.Path,
    CA.Path1,
    AU.UserID
    FROM
    dbo.CMS_Applications CA,
    dbo.AI_UserPermission AU
    WHERE
    (AU.ApplicationID = CA.ApplicationID)
    AND
    ('#url.AppID#' = CA.ApplicationID)
    </cfquery>

    This shows users Name

    <cfquery name="qry_ListICUsers" datasource="SQLSecurity">
    SELECT FirstName,LastName, username, UserID
    FROM Intranetconnections.UserProfiles
    Order by LastName
    </cfquery>

    How do I combine the two?

    Any help will be great. I have a deadline of tomorrow Thanks in advanced

    _aggregate Guest

  2. Similar Questions and Discussions

    1. Query of Queries - Combining Two Datasources
      Problem: Query needs to combine fields from one datasource with those of another, matching on a common ID. Example: <CFQUERY...
    2. Running a query with multiple lists
      Any help would be so appreciated, I have beat my head against the wall on this one and have scoured the web trying to find an answer. I am trying...
    3. How do I Query mulitple datasources?
      Here is what I have and what I need to do... 1. I have multiple dabases with financial transactions. All are based on the same table structure. ...
    4. running a query file of 42MB
      I'm trying to run query generated by an import script. postgresql 8 onder windows XP. the file is about 42MB, i've opened this file by pgAdminIII...
    5. Running query on web datset
      Hi Is it possible to do run a select query on a dataset from a web method using a dataadapter? A code example would be great. If not, how can we...
  3. #2

    Default Re: Running query with 2 datasources

    What database are you using? Are these databases on the same server? Can you
    just execute a query across the databases? For example, in SQL Server, with
    the appropriate permissions:

    SELECT t1.Column1, t2.Column2
    FROM database1.dbo.SomeTable t1, database2.dbo.SomeOtherTable t2
    ......




    mxstu Guest

  4. #3

    Default Re: Running query with 2 datasources

    There are probably a number of posts on this topic. [url]http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=7&threadid=1008384[/url] offers a few possibilities.
    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