Set variables from recordset

I have an SQL table that I store OrderID, ItemID, Qty.  There are 15 possible ItemID's (will never be more).  I need to output the order into a single table row that shows the orderID and the qty for each item.
For example:
<cfquery name="orders" datasource="xyz"
Select *
From solditems
Where orderid = 'Order1"
</query>
Would return something like:
Order1, Item3, 6
Order1, Item4, 7
Order1, Item18, 10
The table needs to look like:
<tr>
<td>#orderID#</td>
<td>#item1qty#</td>
<td>#item2qty#</td>
<td>#item3qty#</td>
<td>#item4qty#</td>
<td>#item5qty#</td>
<td>#item6qty#</td>
<td>#item7qty#</td>
<td>#item8qty#</td>
<td>#item9qty#</td>
<td>#item10qty#</td>
<td>#item11qty#</td>
<td>#item12qty#</td>
<td>#item13qty#</td>
<td>#item14qty#</td>
<td>#item15qty#</td>
</tr>
I'm at a loss trying to figure out how to match the row from the results of the record set into the right #itemXqty#.
Hope I explained this well and thanks in advance for pointers in the right direction!
Gary

You could do something like
<cfoutput><table border="1"><tr><th>#orders.orderID#</th></cfoutput>
<cfoutput query="orders">
    <td>#itemID##qty#</td>
</cfoutput>
</tr></table>
For a start, your query would be more efficient using "select orderID, itemID, qty" instead of "select *" (assuming, of course, that the table has more than the 3 columns).

Similar Messages

  • Using Spry Data Set Variable in Recordset

    I have a page that contains a spry data set and a recordset. The recordset uses one of the variables from the spry data set to filter its results. how do I apply the spry data set variable to the recordset?

    I believe passing this the variable through the URL requires you to update the page, right?
    Yes
    Is there anyway to grab the spry data set variable direct and apply it to your recordset filter?
    The SpryDataSet variable can only be used on the clientside (JavaScript) so you will have to get your recordset using JS.
    A page refresh can be set in motion if you add {useCache: false, loadInterval: 500} to your dataset to then set an observer to your dataset to invoke the page refreash function.
    Gramps

  • Setting variables from a testcase?

    Hello,
    How do I access variables from my BPEL flow from a testcase?
    I need to set some header variables and such that is not availible in the emulate tab so I am looking for a way to manualy in my testcase add/alter/read variables from the BPEL flow?
    I know this "could" be emulated by setting them in the normal flow but since it is test specific I would like to avoid adding thing to the flow and instead have them in my "test case".
    // MickeM

    shouldn't I also be able to access the outer classes methods? It doesn't seem to do this either.

  • Can you control format when setting variable from dashboard prompt?

    I'm setting a session variable from a calendar date prompt in a dashboard prompt, and the variable is referenced in a calculation in the business model. I'm initializing the date prompt from another variable which returns format TIMESTAMP 'YYYY-MM-DD 00:00:00', and the initial load of the dashboard is successful. After changing the value of the date prompt, the query fails because the prompt sets the variable to 'mm/dd/yyyy'.
    My question is: Is there any way to control the formatting when setting a variable from a dashboard prompt? I would like to get the timestamp format.
    Thanks,
    Greg

    If You wants time than in dashboard prompt's coloumn formula use cast function as "cast(date as time)" if date than "cast(date_col_name as date)". But I also have that one problem.Firstly tell me, Is it possible that using two dates in using betwwen operator in dashboard. We access server variable. If not working one thing more that u should have filter on date coloumn in report layout.And in action coloumn u select prompted. Than It will must work.
    Thanks
    Haroon

  • Set Variable to Recordset column value

    I want to set a new variable to value of a column in a
    recordset on the page. I tried this but the sytax is causing
    browser errors:
    <?php $myEndDate = $row_rs_getRenew['ordDateEnd'];?>
    This column in the recordset contains a subscription end date
    and is of data type DATE.

    What is your recordset name? You are setting the variable
    correctly.
    from below, your recordset should be named rs_getRenew, si
    that right? Can
    you set other variables froim the recordset?
    Have you tried printing the recordset directly and making
    sure it contains
    info?
    if (RS['field] != ''){
    $var = RS['field'];}
    else { echo 'empty recordset';}
    "harrilljj" <[email protected]> wrote in
    message
    news:e9o73p$edo$[email protected]..
    >I want to set a new variable to value of a column in a
    recordset on the
    >page.
    > I tried this but the sytax is causing browser errors:
    >
    > <?php $myEndDate =
    $row_rs_getRenew['ordDateEnd'];?>
    >
    > This column in the recordset contains a subscription end
    date and is of
    > data
    > type DATE.
    >
    >

  • AC_FL_RunContent and php variable from recordset

    Hi, can anybody point me to a resource on how to grab the
    name of the .swf file from my db and pass it to the active content
    javascript?
    If I just replace the the movie name with a php echo that
    grabs the file name from the db there is no playback.
    TIA
    -Frank

    Should work fine.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "ronin701" <[email protected]> wrote in
    message
    news:gb9gll$lck$[email protected]..
    > I'll have to strip the extension after I pull it out of
    the record set,
    > assign
    > that value to a variable and echo that in the js where
    there is no
    > extension
    > and use the standard echo in the areas where it need the
    extension, very
    > good,
    > thanks for pointing me in the right direction.
    >
    > -Frank
    >
    http://www.roninwerks.com
    >

  • Set variable from cookie value

    Hi,
    I have a website that saves a cookie to your browser when you log in,
    The cookie value is the name of the user.
    I want to see if I can read this value in captivate and set it as a variable in the content therefore no need to re-enter details in the content.
    I have tried to tackle this using JS but my experience is limited.
    Im using Cp8.
    Thanks in advance...

    Hi VC, thanks for reply,
    //try to set the value and see if it works
    $s('P1_ID_PER_KND_NA_CRYPT','A422313E7F62D04D12347E7DE85DC53E')doesn´t work either, firebug brings up no error but i get an checksum error for this element from the apex engine, I will test the Apex internal GetCookie Function but my own function work very well too, the error is after that...
    what i see, i also get the checksum error when using the varibable id_per_knd_na, too.
    so i think, javascript tries to set the value to the hidden element, but the apex engine prvented it because of SSP.
    Any other ideas?
    ps: i use apex 4.0.2

  • Set Variables from HTML

    Here is the set up, I have a video player embedded in an html
    file. The player will play a lead in video for branding purposes IF
    the user has not viewed this lead in video yet. ELSE it wil play
    the video they specified and then continue to play the rest of the
    videos in a que.
    Everything is fine except, the current video is dependant on
    the HTML page the view is at and I would rather just have 1 swf
    file rather than 1 swf file for every video.
    So my question is, how can i get the HTML page to tell the
    swf file which file to load after the lead in file. I essentially
    need to send this parameter from the HTML file to the swf file -
    How do I do that??
    Thanks!

    Using FlashVars is just appending the variable to the SWF's
    url. So, in your embed script, where ever you have the path to your
    SWF, like, mymovie.swf, you just append whatever variable you need
    to that. So, lets say you want to pass in a name, you would use
    mymovie.swf?name=dzedward
    Then, in flash retrieve it like so:
    root.loaderInfo.parameters.name;
    Lets say you want to pass in first and last name:
    mymovie.swf?firstName=Damon&lastName=Edwards
    retrieve it like so:
    root.loaderInfo.parameters.firstName;
    root.loaderInfo.parameters.lastName;
    Now, if you're using SWFObject to embed your SWF, its as
    simple as:
    so.addVariable("name", "dzedward");
    retrieving it the same way as above.

  • Setting variables from inner class

    I have a GUI that takes users information and provides a quotation as componants are clicked. My componants' Listeners are in seperate inner classes and from these I want to add certain details to variables, it seems to compile and run but it doesn't seem to be changing the value of the variable when the componants are clicked, is there any reason why this happens, my code is below:
    public class MyGUI extends JFrame{
            public MyGUI(){
              //GUI STUFF HERE
            double Price;
         private String total=calculate();
         public String calculate(){
              double aTotal=Price;
              return "$ " + aTotal;
         class MyListener implements ItemListener{
              public void itemStateChanged(ItemEvent evt){
                   if(evt.getSource()==rad1) {
                   Price=0.10;
                   else if(evt.getSource()==rad2) {
                   Price=0.12;
                        totalLab.setText(total);
    }

    shouldn't I also be able to access the outer classes methods? It doesn't seem to do this either.

  • Setting variables from path

    How can I set the name of a value from an alias such as
    "P & M:Editorial Photography:THISFOLDER:fpo:Book Shelf:"
    to
    "THISFOLDER"
    Basically I want to set the name of a value to whatever the name of the second level folder up from the given path is.
    Pedro

    on script_title()
    Filename : ExtractDirNameFromPath.scp.as
    Pathame : ExtractDirNameFromPath.scpt (Script Debugger)
    Author : Bill Hernandez
    Version : 1.0.0
    Updated : Friday, December 15, 2006 ( 12:18 AM )
    end script_title
    -- ---------+---------+---------+---------+---------+---------+---------+---------+ ---------+---------
    on script_notes()
    How can I set the name of a value from an alias such as
    "P & M:Editorial Photography:THISFOLDER:fpo:Book Shelf:"
    to
    "THISFOLDER"
    Basically I want to set the name of a value to whatever the name of the
    second level folder up from the given path is.
    Pedro
    end script_notes
    -- ---------+---------+---------+---------+---------+---------+---------+---------+ ---------+---------
    property NoOfLevelsFromTheEnd : 2
    -- ---------+---------+---------+---------+---------+---------+---------+---------+ ---------+---------
    on run
    tell me
    set delim to ":"
    set theText to "P & M:Editorial Photography:THISFOLDER:fpo:Book Shelf:"
    set aList to SplitString(delim, theText)
    set NoOfItems to count items in aList
    set whichItem to (NoOfItems - NoOfLevelsFromTheEnd)
    set myVar to (item whichItem of aList)
    my ShowMsg(myVar, 5)
    end tell
    end run
    -- ---------+---------+---------+---------+---------+---------+---------+---------+ ---------+---------
    on SplitString(delim, theText)
    if (the last character of theText is equal to delim) then
    set theText to (characters 1 thru -2 of theText) as string
    end if
    set old_delims to get AppleScript's text item delimiters -- always preserve original delimiters
    set AppleScript's text item delimiters to delim
    set theList to text items of theText
    set AppleScript's text item delimiters to old_delims -- always restore original delimiters
    return theList
    end SplitString
    -- ---------+---------+---------+---------+---------+---------+---------+---------+ ---------+---------
    on join(theList, delim)
    set old_delims to AppleScript's text item delimiters -- always preserve original delimiters
    set AppleScript's text item delimiters to delim
    set theStr to theList as string
    set AppleScript's text item delimiters to old_delims -- always restore original delimiters
    return theStr
    end join
    -- ---------+---------+---------+---------+---------+---------+---------+---------+ ---------+---------
    on ShowMsg(s, howLong)
    tell application "Finder"
    activate
    if (howLong = 0) then
    set theTime to 3
    else
    set theTime to howLong
    end if
    set b1 to "OK"
    display dialog s buttons {b1} default button {b1} giving up after theTime
    end tell
    end ShowMsg
    -- ---------+---------+---------+---------+---------+---------+---------

  • How to select two variables from recordset

    Parse error: parse error in
    C:\wamp\www\dotweb\access\agreement_handbook.php on line 72
    I get the above error when I try to run the above page. I
    don't know how to select one variable which is the compid that I
    get from the url and a specific name from another column called
    documentname. I know that this is a very simple thing and I could
    do it just fine with ASP pages, but this is my first time with PHP.
    Please help!!!

    On Tue, 17 Feb 2009 20:56:30 +0000 (UTC), "kmlohr"
    <[email protected]> wrote:
    > $query_rsAgreements = sprintf("SELECT * FROM agreements
    WHERE CompId = %s and
    >DocumentName = "handbook"",
    GetSQLValueString($colname_rsAgreements, "int"));
    Change the above line to:
    $query_rsAgreements = sprintf("SELECT * FROM agreements WHERE
    CompId = %s
    and DocumentName = 'handbook'",
    GetSQLValueString($colname_rsAgreements,
    "int"));
    Gary

  • Can I set a Session Variable from a Dashboard Prompt, using values that are

    Hi All
    Trying to set a Session Variable to an integer value, by letting users select a text value from the drop-down list on a Dashboard Prompt. The goal is to set the input parameter to the IndexCol function, but to provide the end users with a text description of what they are setting.
    Select Value Set Variable Value
    My 0
    My Team 1
    My Companies 2
    My Teams Companies 3
    Any suggestions on how to accomplish this? Certainly we could populate the drop-down from a data source, however I don't see how to populate a variable with something other than the values on the screen.
    The IndexCol function is referenced in a Filter in Answers, and I'm thinking to populate a Session variable using the (Presentation) variable value set from the prompt. But how to do this? I see a reference to a function NQSSetSessionValue(), but cannot find documentation on how it works.
    Any clue will be greatly appreciated.
    Thanks

    Hi kishore..
    Looks like the link u have sent uses advanced SQL tab to set session variables. I want to know if I can use "set variable NQ_SESSION.myvar= @something" in the "SQL results" -while creating a dashboard prompt-.
    Purpose: I want the session variable to be set based on whatever report that im currently in.
    And i dont want to use presentation variables because im using a reset button in my page.
    My reset script resets presentation variables and NOT session variables.
    Thanks in advance
    Loy

  • Dynamically Setting a Variable from a Connection String that has been set by a Config File

    Hi Guys
    I'm setting up a Master / Slave (Parent / Child) dtsx environment but I'm unable to work out how to dynamically set a variable in the Master dtsx from a connection string that has had its value set by a config file. I'm sure it's possible.
    Below is the what I'm hoping to achieve. I've set up everything apart from the highlighted section.
    Any ideas?

    First, what version of SQL Server are you using?
    You could switch the problem around.  You could set the value of a variable from the config file, then it is easy to use that variable as the connection string source for your connection manager.  At the same time you can use a parent variable
    configuration to map that variable to variables in your child package.
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • What is the best practice to set Captivate variables from Get (less ideal) and Post (more ideal)?

    We are trying to set a couple of variables in Captivate 7 by posting the information from a URL. Is there a best practice for doing this, or does it require a custom JS or other call in order to do this?
    Essentially, we want to pass three variables from a URl to named variables in a Captivate 7 swf so that the information can be drawn from a database, and does not need to be entered by the user.
    Suggestions, thoughts, pointers to where we may be able to find this information - all would be greatly appreciated!

    Not sure how Captivate treats FlashVars internally, but the native html template includes a script to read URL parameters:
    var strURLFull = window.document.location.toString();
    var intTemp = strURLFull.indexOf("?");
    var strURLParams = "";
    then:
    if(strURLParams != "")
       so.addVariable("flashvars",strURLParams);
    It also has a script to add variables but you'd have to parse the variables first first to use it:
    so.addVariable("variable1", "value1");

  • Set variable samples per chanel from counter

    Hi, all. I have to set variable samples per chanel for sample clock. I want to take that samples from counter input with different number of edges for every second (different speed of metal plate). What can i do for that task? Is there a god example for this problem?
    Thanks.

    Hi, GerdW. Thanks for reply. I want Sample Rate and Samples per Chanel to come from couter. CI is a metal plate with 52 tooth. The speed of metal plate is 500 cycles/min but it is not constant ( may be 490-520). For example rate of cycles is 500/60=8.33 cycles/sec. Rate of edges (tooth) is 8.33*52=433 edges/sec, but when speed goes over or under 500 the rate is different. How to put that variable samples in sample clock on AI?
    P.S. Matlab script is to calculate max samples per chanel for mean function in while loop. In the picture control "Speed cycles/min" is that 500 cycles/min speed. I have to put in that control the variable rate of edges. Other solution is to set 1 sample per edge, but i have problem here to .  

Maybe you are looking for

  • Problem with T400 and external monitor (1920x1200 resolution)

    Hi there My laptop: ThinkPad T400 2767-C99* (graphics is: ATI Mobility Radeon HD 3470 256MB / X4500MHD (Switchable Graphics)), OS is WinXP I just installed the newest video driver from the lenovo page (which also installs "ATI catalyst") Externale Mo

  • Acrobat 9 and Internal Word Hyperlinks

    I currently have a Word document that contains many hyperlinks and bookmarks. A majority of the hyperlinks in the document link back to bookmarks in the document so that you can click on a link and it will take you to another location in the document

  • My iPad has a large and noticeable dent down the middle. What should I do??!!

    So my iPad 2 that I just recently got has a very noticeable dent on the bottom of it going up(almost in half) in landscape mode. The dent won't let third party hard cases slide on it, and the screen is bleeding extra, and there is a white dot on the

  • Looking for freelancers for InDesign ExtendScript development

    My firm could use some experienced assistance with an InDesign Server development project. In particular we need to generate output dynamically from text and graphical content provided by non-designer end users, and let that content flow into well de

  • Can HDCD discs be ripped by iTunes?

    I've read the forum topics on this issue via the "Search" function of the Apple Support Communities.  The consensus has been that HDCD was absolutely not supported by Mac products or by iTunes.  I did notice, however, that the bulk of the questions a