Change the field names in a CFQUERY object

Hello, I would like to know if you know the answer to this?

I want to change the names of the fields in a CFQUERY result after I extracted the results of the database (IE. I can't use 'AS' in the SQL statement.) I see 2 ways to do this-use the function to query a query (CFSQL) or simply create and populate a new object query, such as defined below:

< cfquery name = "CustList" datasource = "name" >
SELECT CustId, CustName, CustAddress customers
WHERE OrderStatus = 'P '.
< / cfquery >

OPTION #1:

< cfqueryname = "GenericList" type = "query" >
Select CustId AS Id, name CustName AS, AS CustAddress address CustList
< / cfquery >

OPTION #2:

< cfset GenericList = QueryNew ("Id, Name, Address) >
< cfloop query = "CustList" >
< cfset unused = QueryAddRow (GenericList) >
< cfset unused = QuerySetCell (GenericList, "Id", CustList.CustId) >
< cfset unused = QuerySetCell (GenericList, 'Name', CustList.CustName) >
< cfset unused = QuerySetCell (GenericList, "Address", CustList.CustAddress) >
< / cfloop >

Do you know which one of them would be more effective? And is there a better way, by which I can maniplulate the names of the columns in the original request (ie. so that I can rename the field "CustName" to "Name" and then use "CustList.Name" directly)?

Thank you!

Thanks Stefan! Ignore the bit 'guy' below, I didn't notice initially that the first two replies both comes right to you!

Tags: ColdFusion

Similar Questions

  • Quick question: change the field names in the contact Muse forms

    I'm sure this is a stupid question, but I can't find how to change the names/labels (those of the email I receive) of my custom fields added. I added a few boxes and in the email that I receive, they are labeled as: "the check box label: I don't know which is which, because I added a couple.

    I use the standard form of the last Muse CC widget. Thank you!

    Thanks for the link.

    Could you please share your with us .muse file to study? Please send it to [email protected]. If your file is more than 30 MB, you can use something like Adobe SendNow or SendThisFile. Don't forget to mention the link to this forum thread in your email (with Air/Muse/operating system version you are using) so that we can identify the file.

  • JavaScript how to get / change the field (object) TYPE (no access or mandatory)?

    Hello

    I would like to change or at least to get the TYPE of a field/object field

    Reason: I have a function in my script object that needs some things if the given parameter is a text field or button

    {myFunction (Object)}

    If (type is button)...

    ClassName is relative to any use. He always comes = field

    Could someone provide a code please?

    Hello

    This script could help show how to get the type of field.  I'm reasonably show that he originally site of Stefan Cameron, http://forms.stefcameron.com/, but can not find it now.  Basically if you have a 'field' then ui.oneOfChild.className will give you the type of field.

    I don't think you'll have a chance to change the field type.  I think that you need to have all the field types you want on the form and that they are visible when necessary.

    function listAllFields (node)
    {
    If (node.className == 'exclGroup' | node.className == "subform" | node.className == 'subformSet' | node.className == 'region')
    {
    for (var i = 0; i)< node.nodes.length;="">
    {
    If (node.name! = "ErrorIconSubform")
    {
    childNode var = node.nodes.item (i);
    listAllFields (childNode);
    }
    }
    }
    Else if (node.className == "field")
    {
    Switch (node.ui.oneOfChild.className)
    {
    case "button":
    Console.println ("button:" + node.somExpression);
    break;

    case "checkButton":
    If (node.parent.className is "exclGroup")
    Console.println ("RadioButtonList:" + node.somExpression);
    on the other
    Console.println ("checkbox:" + node.somExpression);
    break;

    case "choiceList":
    var oUITypeNode = node.ui.resolveNode ("#choiceList");
    If (oUITypeNode.open is "userControl")
    Console.println ("DropDownList:" + node.somExpression);
    on the other
    Console.println ("ListBox:" + node.somExpression);
    break;
      
    case "dateTimeEdit":
    Console.println ("DateTime:" + node.somExpression);
    break;

    case "imageEdit":
    Console.println ("Image:" + node.somExpression);
    break;

    case "numericEdit":
    Console.println ("digital:" + node.somExpression);
    break;

    case "passwordEdit":
    Console.println ("password:" + node.somExpression);
    break;

    case "textEdit":
    Console.println ("Text:" + node.somExpression);
    break;

    case "signature":
    Console.println ("Signature:" + node.somExpression);
    break;

    case 'barcode ':
    Console.println ("bar code:" + node.somExpression);
    break;

    by default:
    unknown field type
    break;
    }
    }
    }

  • EasySign: what I can or cannot change the fields to fill?

    Is it just me, or is Acrobat EchoSign a hostile user to the garbage piece? I use reader 10.1.3. This is a form that I would complete and perhaps 'sign' with a TIFF of my signature, but first I have to type in some areas. Arrived at this point took me 20 minutes this morning:

    Acrobat EasySign.jpg

    (Sorry for the fur JPEG;) Forums Adobe informed me passively after that I tried to save three no-anti-aliasing 'content types' that he would only accept JPEG format.)

    If you examine the name under the section 'INFO' field, you will see three blue spots reflecting three multiple selections no region of text boxes in the list to the right. These objects are the result of my patiently left click the i-beam on my name in order to change the text that I entered in each field. Whenever I did, I would like to briefly see a blip appear under the i-beam, but he would not let me change my text. The blip, of course, was a text box of length zero being created. I persisted because at some point given, I swear I saw an arrow icon and it let me do a selection in blue on a parcel of my text, but then for some reason any when I typed nothing happened, then the apparition disappeared and I couldn't repeat it. And it is only after a few minutes, when I started to play with a right click on a text field, I discovered the "list of comments" so needless of me in frustration.

    There are now dozens of these mini boxes everywhere in the sheet (just look at how the "list of comments" has 86 entries instead of the 12 that actually contain text). But it means I can't change something when I finished a text, isn't it? If so, why not? Why is he not clear for me, a sophisticated user? Why the bizarre and unpredictable behavior? Or I'm a sort of silly, not having found the correct incantation? Maybe an Adobe firewing priestly programmers or myriads now will enlighten us all, tacitly suggesting that it's just my stupidity, because they knew the blessed Secret their first time.

    I have fairly exhaustive sought a solution to this and have so far found nothing, but maybe it's because I've budgeted only 45 minutes for this potential simple task. Am I'll have to check out this file in Illustrator, or print it out and post it?

    Twenty years ago, I was probably the first or second person outside mountain view to show the alpha of the carousel. Since that time - and despite having occupied hope repeatedly - I still can't easily fill a document online without heartache. Why can't I edit a field? What I have to do when I want to edit a multi-line field? My workaround over the years have range from every possible thing you can imagine, the scan in Photoshop or Illustrator, Quark or InDesign; in the fields of the blind and double-exposures on a printer laser. the glue; even to hack the fields the PostScript with setfonts and the movetos shows.

    I spent 40 years in the graphic arts; half of them I've struggled with Acrobat, on some products work quite complex with the features of questionable when delivery shoehorned in PDF format. When it comes to simple single-page monochrome form letter/A4 - the portable document more abundant on earth - we are now in Acrobat v10 and all I want to do is easily a form, sign and return by email and I still can't.

    Why is life so much harder now than when I could run that through a typewriter, Adobe? What you really do about it for billions? How much more precious moments of our lives that you're going to waste?

    (P.S. What difference is almost a day: hours after this - and just before submitting this article - I myself have discovered the cast with a few minutes more far experiments most already spent. Now, I can recreate the arrow and change the field. It's really not hard, but it's far from clear is the furthest thing of the good technique of the user interface. However, I know now the blessed Secret, or at least a part of it. But it does not change my position above. You can guess why, O Adobe priesthood of unbearable preachy? If it takes a programmer experienced hours to learn the combination, what makes you think to Grandma and Grandpa never go figure?)

    I have to say that a large part of the problem is due to the agency providing the form. This would have worked much better if they had taken the time to add real interactive form fields so that you wouldn't have to worry about the typewriter tool. It's actually good that Adobe provides that as an option of last resort for PDF files that look like forms. It of a little silly to provide a PDF of a form and makes it not to fill, especially since it's possible since Acrobat/Reader 3. This particular form would be easy to implement with fields.

    Regarding the file TIFF is not not qualify, it is worth looking at in more. Consider filing a bug report.

  • How to change the domain name on the host target

    Hello!

    I need to spend a couple of machines in a new area.

    Is it possible to change the field to a GC host or what I need to remove and add?

    / R

    Unfortunately, there is no good way to change the host name.   You can change the display name with EMCLI change the target, but below would be inaccurate, because it would still be the old domain.   Can you create a DNS alias so that it can still be used with the old domain?   Otherwise, delete and rediscover is the only way that I can see.

    You can use this to remove and readd without reinstallation:

    http://docs.Oracle.com/CD/E24628_01/install.121/e24089/appdx_repoint_agent.htm#BABICJCE

    followed by

    emctl start agent

    emctl security officer

    emctl config agent addinternaltargets

  • How can I change the default name of the web form?

    I use the web forms in Business Catalyst, our web site is in Norwegian, so I want the FirstName and LastName values default to display in Norwegian in the error message when the field is not populated.

    For the moment, the user will receive an error message saying "Skriv inn First Name." "Skriv inn" is correctly translated from English to Norwegian, but the "First Name" value must be changed. It goes same for "cell phone number".

    In addition, I'm not really two fields for the name, I want the form to have just a field called "Name" or "Navn" in Norwegian.

    I tried to delete the fields name and replacing them with custom fields, but then I get an error message when the form is sent saying "ERROR: an error has occurred." Your web form should capture customer name and email address. "Please fix this problem and reinsert your web form on your web page."

    Skjermbilde 2012-06-29 kl. 10.16.14.png

    Also, why some the "-" before the mistake of having a space and some not? I want that all errors are displayed with a space between the hyphen and the error.

    The e-mail error is automatically translated into Norwegian for a reason, but it should be a hyphen in there, so he said 'e-postadresse' and not 'epostadresse '.

    Is there any where that I can customize these error messages? Or at least change the values of the English fields in Norwegian, so error messages display the field names Norwegian and not English?

    Look at the bottom of the html form and you will see a piece of JavaScript. You'll see the bits that produce the elements of the alert.

  • TB change the sender name to my name to email classic. Fritz! Box send a pushmail with the name "Fritz!" Box '. In the Inbox of my ISP of this name is present. ...

    TB change the sender name to my name to email classic.
    Fritz! Box send a pushmail with the name of the sender "Fritz!" Box' to my standard email address.
    In the Inbox of my ISP of this name is present. Get this mail with TB the name "Fritz!" Box"is changed in lastname, firstname. This is the full name of my standard email address as I stated in my address book.

    In the toolbar > Options > view > advanced and turn off "see the show only the names of the people in my address book."

  • stop the warning to change the host name

    I continue to be careful:

    Your computer name is already in use on this network. the name has been changed...

    I click ok and keeps coming back with many more and will not stop!

    Thank you

    This is the share name that is duplicated on another device on the network, or the name of VICTORIES under the Ethernet settings. Both are in system preferences.

    Under network, click the network connection you are using (wired or wireless). Click the Advanced button, then the WINS tab change the NetBIOS name to something else. Click OK. If it is active, click on the button apply.

    If that doesn't help, click on the share icon. Change the computer name to something else. This is necessary, or even do anything if at least one of the options of sharing is checked.

  • LaserJet M1536dnf: Impossible to change the host name on HP LJ M1536dnf

    Hi everyone;

    I'm changing the host name on our printer that is currently Imprimante1 that's not what I'm looking for (I have no idea how it was change or not at all).

    I tried to access the printer via IP in a browser (tried Chrome, IE and Edge) still occur. I see the host name to the title of the network, however, I am not able to change it.

    I also thought I might be able to install the software and use the Toolbox, except that during the installation, the Toolbox links are created in the start menu, but it is never installed (confirmed uninstall reinstall twice)

    So yes, here it is...

    Anyone have any ideas on the issue?

    See you soon,.

    Do not know your printer exactly, but on most of these when you go to the web page, you must go to networking and you will need to go in which change you the method of how it gets ip address or an ip.  On this screen will be the ability to set the IP in a manual address and the area that contains the host name you should be able to click on it and change the name.

  • Properties of the system; General tab. How can I change the registered name?

    I am the second owner of my computer and I would like to change the registered name to show my own.  How can I do this?

    It's Windows XP Edition SP3 addition family

    Saturday, July 17, 2010, 11:24:04 + 0000, Dawgbrother wrote:

    I am the second owner of my computer and I would like to change the registered name to show my own.  How can I do this?

    It's Windows XP Edition SP3 addition family

    It is a Windows 7 forum, not a Windows XP forum. But since the same
    answer works for both versions of Windows, it's here:

    If I bought a used computer, no matter who previously owned, the first thing I have with it would be to reinstall the operating system itself. You don't know how the computer has been maintained,
    which has been improperly installed, what's missing, what virus and
    There may be spyware, etc. I would not live with someone of another errors and problems, possibility of kiddy p0rn, etc, and I would not recommend anyone else to do.
    But if you just want to change the name of "registered to", you can do
    editing HKLM\Software\Microsoft\Windows NT\Current
    Version\RegisteredOwner with Regedit.

    Ken Blake

  • How to change the SSID name of the computer to be Compatible with the new name SSID router

    Need to change the default name of the SSID router and then reconfigure adapters wireless in each PC to be compatible with the new router SSID.  A PC has Windows XP Home Edition Version 2002 Service Pack 3 and the other Vista Home Premium.  What are the steps to change the SSID on each PC?  Your response will help complete a home network wireless system.  Thanks in advance.

    Hello

    Your computers use the SSID of your router - sound essentially its name.

    Check this box:
     
    Setting up a wireless router with Vista
    http://www.ehow.com/how-does_4899098_setting-up-wireless-router-Vista.html

    If necessary:

    Make sure you know the details of connection to your wireless router - SSID and password.

    You lose connection when you do and have to redo your logon.

    Control Panel - Network & Sharing Center - right, click Customize - page set of network locations.
    lower left click on merge or delete network locations - REMOVE all instances of your network (and the
    others you don't use anymore) - REBOOT. Start - Connect To log on to the network.

    Setting up a wireless router with Vista
    http://www.ehow.com/how-does_4899098_setting-up-wireless-router-Vista.html

    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • I have a problem with the connection to the computer after you change the user name.

    Original title: HELP

    I changed the username on my laptop and it is not letting me log

    I changed the username on my laptop and it is not letting me log

    Here you go:

    1. Set your BIOS so that it uses the DVD drive as its primary boot device.
    2. Start the computer with your Windows 7 repair CD.
    3. Press a key when prompted to boot from the DVD.
    4. Select 'PC Repair' in the menu.
    5. Select 'Repair' when prompted.
    6. When you are prompted, select System Restore.
    7. Configure Windows to a point before you have changed the user name.
    8. Plan ahead a little and create, test and document an alternative admin account, same as you have a spare emergency House key. This will save you a lot of trouble.
  • Change the computer name in the network discovery, view old and new names and get error code 0 x 80070035

    I changed the computer names of computers each with windows 7 and a home network sharing. Network discovered each poster now the old and new names. I also have an error code 0 x 80070035.

    How can I get rid of the old names?

    Hello

    Are you able to access computers using the names?

    Step 1: Check out the link to learn how to delete the old name and create a new name:

    Change the name of your computer:

    http://Windows.Microsoft.com/en-us/Windows7/change-your-computer-name

    Step 2: Refer to the section below for more information to correct the error 0 x 80070035 and steps.

    Open the homegroup troubleshooting utility

    http://Windows.Microsoft.com/en-us/Windows7/open-the-HomeGroup-Troubleshooter

    Error 0 x 80070035 appears if you are not able to access the network computer. Follow the instructions in the thread below if you are faced with a similar question:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-networking/Windows-7-error-0x80070035-when-trying-to-share/d8168c72-D51C-41C3-8B8F-3b6bb7f65f43

    It will be useful.

  • Smartphones blackBerry how to change the user name of e-mail on a Blackberry Curve 9320.

    Dear community,

    I have a Blackberry Curve 9320. My company has recently changed their messaging system so I need to create a new e-mail account. Creating the account of electronic mail is not a problem. However. some settings need to be changed. When I go on settings, navigation key allows me to change the change the server info, type my password etc. However, I'm unable to change the user name. My device automatically generates a username of email that is not correct and I am unable to change because the navigation button jumps on this area. Can someone advise me on how a change the username of email on a curve 9320. Thank you.

    IT WORKED! Thank you very much. Force the unit to offer "I'll give you the parameters" was the thing. Have a great day.

  • Can I change the file name of the .bar file

    Hello

    I built an application in Release for device mode.  He prodcued a filenamed bb10app.bar. Is it possible to change the file name to tell xyz.bar after it is built.  It is an application internal meaing only avaiable to our staff.  If I do not file name change how will I know what app it is. Given that bb10app.bar seems to be a default file for any application name.

    Thank you

    Joe

    Yes, you can change the file name of the file BAR, just keep the .bar extension and you shouldn't have any problems.

Maybe you are looking for