Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7412387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:31:54+00:00 2026-05-29T06:31:54+00:00

I have written a database query to extract information in ColdFusion and I want

  • 0

I have written a database query to extract information in ColdFusion and I want to know how may I pass a value to the WHERE clause to get the relevant data. This is my code sample. can any one help?

<cfquery name="FILM_STRIP_QUERY" datasource="#dsn#">
select   distinct tm.id as teachingmoduleid,
        (select concat(prs.first_name, ' ',prs.last_name) AS Video_presenter from presentations pss
            inner join topics tpcs on tpcs.id = pss.topic_id
            inner join presenters prs on prs.id = pss.presenter_id
            where pss.name = ps.name
            and tpcs.title = tp.title
            ) AS video_presenter,
        (select pss.43_png from presentations pss
            inner join topics tpcs on tpcs.id = pss.topic_id
            inner join presenters prs on prs.id = pss.presenter_id
            where pss.name = ps.name
            and tpcs.title = tp.title) AS png_name
        from teaching_modules  tm 
        inner join tm_segments sg on sg.module_id =  tm.id
        inner join topics tp on tp.id =  sg.topic_id
        inner join presenters prs on prs.id = tm.presenter_id
        left outer  join presentations ps on ps.id = sg.presentation_id
        where tm.id = 
</cfquery>

and this is the calling function

<cfloop = "FILM_STRIP_QUERY">
    <!--- this is where I wanna pass the parameter--->
</cfloop>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:31:55+00:00Added an answer on May 29, 2026 at 6:31 am

    If you are using a CFC, then a function like this would work, including the query name ensuring CF releases the memory from the local variable declaration. Also uses the parameter and the cfqueryparam function.

    <cffunction name="getFILM_STRIP" access="public" returntype="query" output="false">
         <cfargument name="id" required="Yes" type="numeric">
    
         <cfset FILM_STRIP_QUERY = "">
    
         <cfquery name="FILM_STRIP_QUERY" datasource="#variables.dsn#">
             <!--- select statement --->
             WHERE colname = <cfqueryparam cfsqltype="CF_SQL_INTEGER" value=#arguments.id# />
         </cfquery>
    
         <cfreturn FILM_STRIP_QUERY>
    </cffunction>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a code for downloading a file(blob in database table).I get a
i have written the query below to check if record in the database record
I have written a PHP script to pull a query from an Oracle database
I have written an AJAX script to read information from a database and inject
I have written an sql query to search 2 columns of a database, partNo
I have written a gateway to get a result set from my database. How
I have written a query to Select sales values from a database and apply
I have written a script to query a mysql database and encode the data
I have written a database application using a binary file as storage. it is
I have written an O/R database wrapper that generates some wrapper methods for stored

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.