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 7500813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:18:52+00:00 2026-05-29T20:18:52+00:00

My boss wants me to use cfscript instead of tags for database interaction. Does

  • 0

My boss wants me to use cfscript instead of tags for database interaction. Does anybody know of any good tutorials? I bought the Adobe ColdFusion application development book, vol 2. But it does not have much on scripting. I did google and found this site, but it did not explain much.

Does any body know of any good tutorials on accessing the data base in CFScript?

Basically I have to convert the following to using CFScript:

<cfquery name="drafts" datasource="ICEchat">
    SELECT * from Messages where IsTemp=1 and LinkA=#FORM.LinkA# and LinkB=#FORM.LinkA#
</cfquery>
<cfif drafts.recordcount GT '0'>
    <cfquery name="Attachments" datasource="ICEchat">
        SELECT * FROM Attachments where id=2
    </cfquery>
    { Message:"<cfoutput query="drafts">#Message#</cfoutput>", Attachments:[<cfoutput query="attachments">
        "#url#"<cfif attachments.currentRow LT attachments.recordcount>,</cfif>
    </cfoutput>]}
<cfelse>
    <cfquery name="addrecord" datasource="ICEchat">
        INSERT INTO Messages 
        VALUES(1,1,' ',1)
    </cfquery>
    { Message:"NA", Attachments:[]}
</cfif>
  • 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-29T20:18:55+00:00Added an answer on May 29, 2026 at 8:18 pm

    From the 4th link on google for "cfscript query tutorial":

    <CFSCRIPT>
        myQry = new Query(); // new query object     
        myQry.setSQL("select bookid, title, genre from app.books where bookid = :bookid"); //set query
        myQry.addParam(name="bookid",value="5",CFSQLTYPE="CF_SQL_INTEGER"); // add query param
        qryRes = myQry.execute(); // execute query
        writedump(qryRes.getResult().recordcount, true); // get resultcount
        writedump(qryRes.getResult(), false); // dump result
        writeoutput('<BR>');
    </CFSCRIPT>
    

    That ought to tell you everything you need to know.

    Also, you really should not be creating JSON manually, no matter how simple it is. Use serializeJson().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Management wants us to switch to Infragistics. But my boss says that any 3rd
This is driving me insane: I'm an intern: my boss wants me to use
The boss wants the master page's menu to look nicer. I generated my gradient
My boss wants me to encrypt some information used during data transfer. The individual
My boss wants me to develop some apps and make them appear on the
Possible Duplicate: What is the best Twitter API wrapper/library for .NET? My boss wants
I'm trying to redirect site.com w.site.com ww.site.com and wwww.site.com to www.site.com. My boss wants
My boss asked me to setup a Subversion server for him to use so
My boss wants to distribute the application for a specific client, whose number of
I just completed my first (minor) Python project, and my boss wants me to

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.