CFQuery with an IN statement (how do you do it)

I have a <cfquery> SQL statement with a 'where in ( )'
clause but quotedValueList can't handle values greater than 1000,
so, how do you do it?
Now, I can't just stick the first query into the second query
to make it work. The first query is more complicated than the
example I gave so that's why I have to break them up. So, how would
I make the second query work if the first query returned 2000
students?
<cfquery name="getStudents" datasource="Oracle">
select pk1
from users
group by pk1
</cfquery>
<cfquery name="getStudentCourses" datasource="Oracle">
select course_id
from course_users
where users_pk1 in (......)
</cfquery>

Well, here is one "method", although it is a major kludge.
You just create a series of OR statements in your 2nd query based
on the number of items returned from your first query. Not elegant
or efficient, but it is strictly "ColdFusion".
<cfquery name="getStudents" datasource="Oracle">
SELECT pk1
FROM users
GROUP BY pk1
</cfquery>
<cfquery name="getStudentCourses" datasource="Oracle">
SELECT course_id
FROM course_users
WHERE 1=0
<cfoutput query="getStudents">
OR users_pk1 = #pk1#
</cfoutput>
</cfquery>
Of course, now you may have a query with 2000 OR lines in it,
so your query might run a little slowly the more items you select
from the first query.
Phil

Similar Messages

  • With hp officejet 6500a, how do you print a color webpage in black and white?

    With HP Officejet 6500A, how do you print a color webpage in black and white?

    Autogyro wrote:
    Charles Dyer wrote:
    Apple didn't make the drivers. Apple doesn't make printer drivers and has not done so since they stopped making their own printers. HP made the printer drivers for that device. Apple merely publishes HP's drivers.
    OK, but still, they built the poorly made HP drivers in their OS.
    Ah, no. They published the only drivers HP gave them. If they didn't publish them, then Mac users would be unable to use HP devices at all, except for those devices supported by 3rd parties such as Gutenprint and the HPIJS Project. HP is solely responsible for the state of their drivers. And it's not just Mac drivers which are bad; a lot of Windows drivers stink, too. HP simply has a problem writing drivers. For the most part they have excellent hardware, but truly terrible software.

  • With new phone download, how do you close applications running in the background? Used to push hold and delete.

    With new ph download how do you close apps running. In the background

    Obviously you didn't search the forum prior to your post as there have been a lot of posters with the same question. Double tap on the home button as usual. Scroll left or right to select the app that you want to close and swipe upward to close it. The iPhone ios7 user guide is available online from Apple support and from the ibook store on your phone.

  • HT1491 with the latest Itunes, how do you buy songs appearing in my wish list ? you use to be able to hit the button that said buy, but it's no longer found. thanks

    with the latest Itunes, how do you buy songs appearing in my wish list ? you use to be able to hit the button that said "buy" or "buy all", but it's no longer found. thanks

    http://support.apple.com/kb/PH12295
    or
    http://support.apple.com/kb/PH12503

  • With new iTunes 11 how do you restart podcasts that used to regular pause

    With new iTunes 11 how do you restart podcasts that used to regular pause?
    Before iTunes 11, a symbol would appear in individual podcast lists showing that the sender requires you to confirm that you still wish to receive their podcast. This used to occur with all my BBC podcasts once a week usually at the weekend.
    Now with iTunes 11 this control seems to have disappeared. Tried all the new icons but nothing seems to do this.
    Now (as its Saturday) all my BBC podcasts have stopped as there appears no way to reconfirm that I still want to automatically receive them.
    Please help!

    Here are typical layouts for the iTunes folders:
    With iTunes 11 you might also have a Home Videos folder inside iTunes Media.
    In the simplest cases you copy the entire iTunes folder from <User's Music> on the source computer to <User's Music> on the target machine, install iTunes, and it "just works"TM.
    If the media folder (inside the red outline) has been split out to a separate location then you can copy the library folder (outside the red outline) as before and connect the drive holding the media so that it has exactly the same path as before. If the drive appears as D: on one system and E: on the other then the library won't be able to find the media.
    The crucial file is iTunes Library.itl - this contains a record of the tracks that have been added to the library, ratings, play counts, playlists etc.
    See also: Make a split library portable.
    tt2

  • With IOS 7.0 How do you change the Color Red, that shows up on the Calendar to another color? People with certain eye problems cannot tolerate the color Red.

    How do you change the Color Red, that shows up on various points of the Calendar to another color? Persons with certain eye problems have visual irritations that can be caused by the color Red. This problem came up with the update to IOS 7.0.

    Sorry but you cant

  • How can you get your facebook pictures to sync with your contacts?, HOW Can you get your facebook pictures to syncwith your contacts?

    How can you get your facebook pictures to sync with your contacts?

    take a look at the link
    http://www.iphonestuffs4u.com/how-to-sync-facebook-contacts-to-iphone/

  • When using i-Cloud PAGES with another shared person, how to you shift ownership control of the file to the other who started as a collaborator?

    When using i-Cloud PAGES with another shared person who is a collaborator, how to you shift ownership control of the file to the shared person who started as a collaborator and needs to take over file ownership responsibilities?

    Thanks, but I have searched here but have not found or heard a direct answer to my question as stated above...

  • Turned in my iPad due to broken screen and now I can't find my photos...and with this new ios7 how do you close apps?  Technologically challenged...lol

    HHi!  I recently had to turn on my iPad due to a broken screen.. Received my new one yesterday but my photos are not showing in And unable to retrieve them from iCloud.. Also, on the new iOS seven how do you closeout your apps ?  Majorly technologically challenged!

    Open the App Store app and go to 'purchased' at the bottom of the screen
    User guides
    http://manuals.info.apple.com/MANUALS/1000/MA1595/en_US/ipad_user_guide.pdf

  • Once ipad 1 restored to out of box state how do you update ioS

    Got new iPad Air and wanted to give original iPad to my mom, so restored the iPad to its out of box state.  However, now when she goes to set up the iPad as hers and update the software, it says the software is up-to-date (at ioS 5).  How does she update?

    Because Apps get updated all the time. If you had already downloaded a prior version of the App then that's what you were using and not the updated version.
    Your mom should still be able to get a version of the App for the older iOS version though.
    App Store: Install the latest compatible version of an app
    http://support.apple.com/kb/ht5919
    You may need to download the newest version to a compatible device or a computer running itunes so it gets registered to the Apple ID she is using now and can be downloaded then form the Purchased tab in the App Store App.

  • With Knoll Light Factory how do you get rid of the pinpoint of light that overlap obscuration layer?

    I have KLF 3.0 on AE CS6, I am trying to add a nice flare to some keyed footage of a rock star for music video...
    I set it up so it looks like a light is behind him and I want him to obscure it a bit when he moves around... However, I can't get rid of the little pinpoint of light where I have the source! My obscuration layer works properly, as he crosses it it dims the light, but the light doesn't totally disappear when he's in front of the "Source"! There's still a little pinpoint that crosses over him ruining the effect I'm going for!
    Does someone know how to get rid of that little artifact?
    I've tried tweaking all the settings to no avail...
    Thanks all!
    Aza

    Interesting. I have also experienced a similar problem involving a Knoll lens flare effect (v. 3.0) and obscuration, in this case some 3D text, backlit by a Knoll flare applied to a background layer. The flare moved across and behind the text and faded in and out either side of the text within the comp frame via keyframed opacity settings. The pinpoint of light appeared against the background at the end of the flare's path (beyond the text) on an opacity keyframe that was mistakenly adjusted to 1% instead of 0%. However after re-setting it to 0% and RAM previewing the pinpoint of light remained. Couldn't be eliminated. It was permanent and was also visible in the rendered output. The only quick way to eliminate it was to replace the background layer with a new one, add a new Knoll lens flare effect, copy and paste the keyframes from the original Knoll effect, check the opacity was indeed set to zero at the total fade-out frame and render/playback again. The pinpoint was gone. Puzzling. Not sure if this is what's happening in your case though.

  • With multiple Oracle Clients how do you know which one ADO is using

    Currently using Oracle client 8.1.7 to connect to a 10g database with the following connection string.
    Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=10001))(CONNECT_DATA=(SERVICE_NAME=Falcon2))); uid=Falcon;pwd=*******;"
    If I add a second, newer client, how do I tell ADO to use the newer client?
    Thanks,
    Dave

    Go to icloud.com, sign into each of your iCloud accounts and see which one(s) contain your data.

  • I Can Only Overclock With Bios 1.3: How About You?

    Hi,
    MSI sent me a new board, the 865PE Neo2-FIS2R. I had two that flashing the bios destroyed the boards. The first I could always get back: the second, I could not. This board is everything the first 2 should have been.
    The board came with bios version 1.5. Everything worked fine except that the board wouldn't allow me to overclock at a 5/4 divider. I, in turn, flashed to 1.7, 1.7B1, and back to 1.3. Bios version 1.3 is the only bios I can successfully overclock using a memory divider other than 1/1. I can overclock at 1/1 to 225 or so with 1.7, but only at 1/1.
    I did notice that the memory issues seem to be gone. Only with 1.3 do I have to take out the Corsair Ram and put in the Samsung PC2700 to get it to boot. This is a minor inconvenience. Also, Insert Key will reset the CPU to default settings. Cool.
    Anyway, are any of you able to use a memory divider other than 1/1 with later bios'?
    Mark

    Memory speed is clocked off the same clock the FSB is clocked. When you set memory clock speed you are setting the 'nominal' speed when the FSB is at 200.
    Taking into account dual channel and quad pumping you get 1:1 ratio with FSB 200 and Memory 400. Increase FSB to 250, memory actually runs at 500.
    Setting the memory to 333 actually runs it at 320 on a 200 FSB (hence 5:4 ratio). So with FSB at 250 the memory clocks at 400.

  • How can you get your apple security questions with out a call, How can you get your apple security questions with out a call

    please help

    1. See my User Tip for some help: Some Solutions for Resetting
        Forgotten Security Questions: Apple Support Communities.
    2. Here are two different but direct methods:
        a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
        b. Call Apple Support in your country: Customer Service: Contacting Apple for
            support and service.
    3. For other queries about Apple ID see Frequently asked questions about Apple ID.
    4. Rescue email address and how to reset Apple ID security questions
    5. For online assistance use Apple - Support - Express Lane

  • When closing firefox with multiple tabs open, how can you make it keep all the tabs when you reopen firefox

    When i pull firefox back up i want all my tabs to appear in seperate tab windows.

    Go in menu->options->options->select "General" tab and here in "When firefox start" change the option.

Maybe you are looking for

  • SSO is not working for SAPGUI for HTML

    Hi Experts, We have configured SSO between EP and ECC.SSO is working fine for SAPGUI for windows.But it is not working for SAPGUI for HTML. Workflow iViews are getting error. "SWITCH to HTTPS does not occur." The domain names are different for EP and

  • Color management problems - help please!

    Hello, I'm trying hard to understand color management and to make colors consistent throughout my workflow, and I'm failing miserably despite reading and re-reading the help files. I'd REALLY appreciate some help with my specific problems, which I'm

  • HOW DO I KNOW IF THE DATABASE SERVER IS RUNNING?

    Hi guys, How do i write a java code to determine if my database server(s) (eg : Oracle or mySQL or postGRESQL, msSQL etc) are (is) running. I want to know how to code in java to determine if a certain database server is running when i start the java

  • Premiere Elements 12 Effects-Panel not working

    Hi there! I've recently updated to Elements 12 (from 10) and I am more or less happy, but since today, I can't use the effects-panel anymore. When I click any effect, the options won't pop up (see attached screenshot). Does anyone know what to do? I'

  • Borwser link in SRM

    <b>Dear All, I am learning SRM.SRM 5.0  Ides has been installed in my system. I try to login  through browser link. As per the below step I got the  browser link.</b> Go to transaction SICF Search Service Name BBPSTART Right click the BBPSTART and Te