How to display query result like this

I got a query...gives list of names.
i want to display
11.  Peter
12. Jessica
32. Leo
15. Jamie
36. Edward
how i get static number infront of my query result.
static number is not in order.

Amm85 wrote:
I got a query...gives list of names.
i want to display
11.  Peter
12. Jessica
32. Leo
15. Jamie
36. Edward
how i get static number infront of my query result.
static number is not in order.
You could use the function queryAddColumn to add the numbers as a separate column to the query.
Let us suppose the name of the query is "myQuery". Then you could proceed as follows
<!---Define your "static" list of numbers --->
<cfset staticList = "11,12,32,15,36,13,23,14,33,16,44,31,17,34,18">
<!--- Create an array from the static list. --->
<cfset staticNrArray = ArrayNew(1)>
<cfset staticNrArray = listToArray(staticList)>
<!--- Add the array as a column to the query. --->
<cfset nColumnNumber = QueryAddColumn(myQuery, "staticNr", "integer", staticNrArray)>
<!--- Verify whether it works as expected--->
<cfdump var="#myQuery#">
The list I have given here has 15 numbers. This will naturally instruct ColdFusion to add a new column named staticNr, having 15 rows. You might like to know that the queryAddColumn function enables padding.
Here is how it works. Suppose that the query originally had only 8 rows before you added the column(of 15 rows). Then, in the new query, ColdFusion would pad the last 7 rows of the other columns with null values. If the original query  had 20 rows instead, then Coldfusion would pad the last 5 rows corresponding to the staticNr-column with null values.

Similar Messages

  • How to display query result in seperated page.

    How to display query result in seperated page, if the results are very big (more than 5000 records) and there are so many concurrent users (about 500 - 1000 users).
    Are there any solutions or frameworks?
    Plese help me .........
    thanks,
    --bhasin

    Hi,
    How to display query result in seperated page?I think RowSet will be the better technology to use in this
    situation.For more information on this please visit http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html
    which explains in detail about RowSets.
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • How to display query results in windows side by side in Access 2010

    In Access 2010 - when I open a query the result is desplayed in a tab.
    When I open a new query - a new tab is created - now in front of the other tab.
    I would like to see both queries at the same time.
    How is that done?

    Select File > Options.
    Click 'Current Database' in the navigation pane on the left.
    Under 'Document window options', select 'Overlapping Windows'.
    Click OK, then close and reopen the database.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to Display Query Results in a Max Width Formatted Way?

    Hi,
    I want to run a query to show the columns within headers to be formatted in a way that looks equal in width. I just want to get the max width for each column and display each item in a max width format in a query. Thanks.
    Ex.
    First Name Last Name City
    John Sumi New York
    Jay Heely Texas

    if you are spooling a file on sql*plus use the column formatting method.
    syntax:
      COL <column_name> FORMAT a<integer>example:
      COL emp_name FORMAT a40

  • SSMS Addin - How To Access Query Results Grid

    Hi,
    I want to access Query Result Grid(Results) in SSMS addin but I did'nt found anything.
    How can I access Query Result Grid, Rows, Columns and Cells when I executed a script?
    Thanks.

    SQL Server Management Studio currently supports query execution results to be displayed in three different ways: Results to Grid,
    Results to Text and Results to File.
    By default SQL Server Management Studio is configured to display query results in
    Grid format.  If you want to change the default to some other option follow these steps.
    1. In SQL Server Management Studio, under Tools menu, click
    Options as shown in the snippet below.
    2. In the Options dialog box, expand Query Results, expand
    SQL Server and then select General as shown in the snippet below. In the right side panel choose one of the three options shown below in the
    Default Destination for results drop down list and click
    OK to save the changes as shown in the snippet below. The changes will go into effect once you open a New Query window.
    Query Result Options for Results to Text
    In this format you have the option to display the results in a different tab as well as setting different output options.
    In the Options dialog box, expand Query Results, expand
    SQL Server and then select Results to Text tab as shown in the snippet below. In the right side panel first select the checkbox for
    Display results in a separate tab and then select the checkbox for
    Switch to results tab after the query executes and then click
    OK. If you would like to also display the column name in the result set then choose the option Include column headers in the result set
    as shown in the snippet below.
    The options you can use in the Text format are:
    Output format: - In the above snippet you could see that by default the output is displayed as columns aligned. Some of the other options that are available are Comma Delimited,
    Tab Delimited, Space Delimited and Custom Delimited. If you choose the Custom Delimited option in the Output format drop down list then you need to specify a character of your choice for the delimiter in the
    Custom delimiter text box.
    Include column headers when copying or saving the results: - If this option is selected, then whenever the results are copied to clipboard or it is saved to a file the column headers are also copied along with the results.
    Include the query in the result set: - The text of the query is displayed as part of query output under the messages tab.
    Scroll as results are received: - If this option is selected, then the display focuses on the most recently returned records at the end of the results set.
    Right align numeric values: - If this option is selected, then numeric values will be aligned to the right of the column.
    Discard results after query executes: - If this option is selected, then the query results are not displayed in the reviewing pane.
    Display results in a separate tab: - If this option is selected, then the result set after query execution will be displayed in a new tab instead of at the bottom of the query window.
    Switch to results tab after the query executes: - If this option is selected, then after the query execution the screen focus will be set to the results tab.
    Maximum number of characters displayed in each column: - This sets the maximum characters to display for any one column.  So if you have a column that is 500 characters this will only show the first 256 if you keep the default setting.
    Ref link :http://www.mssqltips.com/sqlservertip/2346/different-options-for-query-results-in-sql-server-management-studio/
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • How to display the result of  excutions(insert/update/delete rows)

    Hello.
    Does anyone know how to display the result of scenario executions just like a scenario executions tab of package (insert/update/delete rows) in other screen (in the intergated operating platform for operators using http)
    In additional, I also like to show the hierarchy of scenario in the same view.
    So, I need the query using the information of the ODI repository.
    If it is possible, I also like to have the decription of the tables in the ODI repository.
    Can anyone tell me how can I get the information of the counts of excution?
    Thanks in advance.

    Hi,
    You can get that information from the API getPrevStepLog. Does it work for you?
    Download the last API reference manual from:
    http://www.oracle.com/technology/products/oracle-data-integrator/10.1.3/htdocs/1013_support.html#docs

  • How to save query result in excel file

    Hi all,
    How to save query result in excel file from sql*plus tool.
    thank you

    Do you really need an Excel file (binary) or a simple CSV?
    If you just need a CSV then search for DUMP_CSV at http://asktom.oracle.com or at this forum
    If you need formatting and/or multiple worksheets then you can use free tools like
    https://xml-spreadsheet.samplecode.oracle.com/ or https://exceldocumenttype.samplecode.oracle.com/
    Regards
    Marcus

  • Problem Displaying Query Result

    I have been working through David's book 'Dreamweaver CS5 Training from the Source' and am attempting to adapt the tutorials for my own ideas.
    My problem, I believe is in displaying the results of a database query. I want to display to the user a list of group names they are associated with.
    The query looks like this:
    $id = "$identity->user_id"; //logged in user
    $sql = mysql_query("SELECT name
                                   FROM groups
                                   INNER JOIN user2group USING (group_id) // reference table contains user_id and group_id
                                   WHERE user_id = $id
                                   ORDER BY name")or trigger_error ( mysql_error ( ) );
    while($row = mysql_fetch_array($sql)){
              $groups = $row['name'];
    I attempt to display the results with:
    <?php echo "$groups"; ?>
    I have also tried:
    $sql = mysql_query("SELECT name
                                   FROM groups
                                   INNER JOIN user2group USING (group_id) // reference table contains user_id and group_id
                                   WHERE user_id = $id
                                   ORDER BY name")or trigger_error ( mysql_error ( ) );
    while($row = mysql_fetch_array($sql)){
              $groups = array();
              $groups[] = $row['name'];
    and display with:
    <?php echo implode('<br />', $groups); ?>
    In both scenarios I get only one record displayed. (there is more than one record). The records seem to be available to display because if I change the ORDER command I get a different result.
    Any help is much appreciated.
    Thank you

    Thank you so much for the explanation of the while loop it was extremely helpful. I was able to get my results to display correctly by including the echo statement in the while loop.
    I spent several hours trying to use the array_push command with no success. I did explore the link you provided, but found many of the examples people gave to be very complicated. I would really like to start working with this command, if you would be able to provide me with an example based on my query and I can see it working I can start varying it to some of the more complicated methods given in the link.
    Thank you again for your help.

  • How to display the results in order by based on search value

    Hi All,
    how to display the results in the below order.
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    output:
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ...if user searches with 'MADONNA' , I have to display the results like title starts with 'MADONNA' first then rest of the records.
    Please let me know is it possible to display the results in that order.
    Regards,
    Rajasekhar

    This may be a bit more accurate:
    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
                  SONGID TITLE
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)

  • How to get query result in comma dilimited text or excel file?

    Does anybody know how to get query results in comma delimited
    text file or excel file, I tried spool abc.txt, but the result
    showed some ------ lines
    Thanks

    Try doing this in your sql scripts
    set heading off
    set pagesize 0
    set linesize 4000
    set feedback off
    set verify off
    set trimespace on
    set colsep ","
    spool output.txt
    select * from dual (or whatever you are querying
    spool off
    There may be a couple other set statement that you could add but
    this should get you started in the right direction

  • How to make an avatar like this,

    Hello Adobe Community, i'm new here, i have a big question. I want to know HOW to make an avatar like this:
    I want to know how to do that effect that who zoom in and zoom out etc. WITHOUT SNOWING, only that effect, if you can help me please!
    That zoom effect is AWESOME... send me a tutorial please!

    I thought you said you knew how to make animated gif.  A frame is the composite of the layers that have their visibility on for the frame a frame may be made using many layers. You use tools and filters on layers.You make frame using layers.
    Photoshop also supports any size layer. Layers can be  larger the canvas size can have image data out side the canvas.  Layer image data position above can be move relative to the canvas.  The Cloud logo animation has two layer one is masked is masked the mask is not linked to the layers image data it stationary over the canvas and is more on less a masks more foe the background canvas then the layer its on. The layer it is on image data is more off canvas then over canvas. Photoshop also notes layer position in a frame information, A layer potion can be change from frame to frame. I only create two frame for that animation.  The first and last frame, The first frame I had the top late image JJMACK high and off canvas to the left.  The last frame had it low and off canvas to the right. I then had Photoshop generate 138 frames between the two frames I created.  So Photoshop moved the top layer position across the canvas  left to right and high to low direction and the stationary layer mask masked it as if it were going through the background layers clouds.  The two layers are visible in all frames.

  • How Could I Make Something Like This.

    http://www.youtube.com/watch?v=vlRdjAwEzbU
    I Am Wondering How I could make something like this in AfterEffects CS4.
    Any Help Would Be Appreciated.

    dx394 wrote:
    Is There A Tutorial Anywhere About It?
    You could contact the animator or whoever posted the clip.
    Deconstruct the sequence. observe the moves and decide, with your present level of familiarity, how you would approach it. Scaling of the ten or so different layers is simple enough but acquiring the contents of the layers is not something you will do in AE.
    As Todd says, start small, figure it out one step at a time, move on to more advanced functions. Animting 3D layers is 9 times more difficult than 2D. when you add lighting and camera moves you raise the complexity level and rendering time to another power making your project about 27 times more difficult.
    bogiesan

  • How can i generate xml like this?

    Hi all,
    How can i generate xml like this & i need to send it to via HTTP :
    <mms>
                 <subject>message subject</subject>
                 <url_image>http://image_url</url_image>
                 <url_sound>http://sound_url</url_sound>
                 <url_video>http://video_url</url_video>
                 <text>message text</text>
                 <msisdn_sender>6281XYYYYYY</msisdn_sender>
                 <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
                 <sid>to be define later</sid>
                 <trx_id>Unique number</trx_id>
                 <trx_date>yyyyMMddHHmmss</trx_date>
                 <contentid>see note</contentid>
    </mms>& how can i get the value of the sid (for example)?
    I hav tried to generate that xml by using StringBuffer & append, but it's not what i mean...
    Anyone can help me?

    Ok...i got it. But i still hav some problems.
    This is the sample code that i used :
    public class XMLCreator {
         //No generics
         List myData;
         Document dom;
            Element rootEle, mmsEle, mmsE;
            StringWriter stringOut;
            mms mms;
         public XMLCreator(String subject, String image, String sound,
                    String video, String text, String sender, String recipient,
                    int id, String date, String contentid) {
              mms = new mms(subject, image, sound, video, text, sender,
                            recipient, id, contentid, date);
                    createDocument();
         public void run(){
              createDOMTree();
              print();
         private void createDocument() {
              //get an instance of factory
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              try {
              //get an instance of builder
              DocumentBuilder db = dbf.newDocumentBuilder();
              //create an instance of DOM
              dom = db.newDocument();
              }catch(ParserConfigurationException pce) {
                   //dump it
                   System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
         private void createDOMTree(){
              //create the root element <Mms>
              rootEle = dom.createElement("mms");
              dom.appendChild(rootEle);
              createMmsElement(mms);
         private Element createMmsElement(mms b){
              Element subjectEle = dom.createElement("subject");
              Text subjectText = dom.createTextNode(b.getSubject());
              subjectEle.appendChild(subjectText);
              rootEle.appendChild(subjectEle);
              //create url_image element and author text node and attach it to mmsElement
              Element imageEle = dom.createElement("url_image");
              Text imageText = dom.createTextNode(b.getUrl_image());
              imageEle.appendChild(imageText);
              rootEle.appendChild(imageEle);
              // & etc....
              return rootEle;
          * This method uses Xerces specific classes
          * prints the XML document to file.
         private void print(){
              try
                   //print
                   OutputFormat format = new OutputFormat(dom);
                   format.setIndenting(true);
                            stringOut = new StringWriter();
                   //to generate output to console use this serializer
                   XMLSerializer serializer = new XMLSerializer(stringOut, format);
                   //to generate a file output use fileoutputstream instead of system.out
                   //XMLSerializer serializer = new XMLSerializer(
                   //new FileOutputStream(new File("mms.xml")), format);
                   serializer.serialize(dom);
              } catch(IOException ie) {
                  ie.printStackTrace();
            public String getStringOut() {
                return stringOut.toString();
    }when i tried to show the stringOut.toString() in my jsp, it's only showed string like this :
    The Lords Of The Ring http://localhost:8084/movie/lotr.3gp 6281321488448 6281321488448 123 0 20070220114851 LOTR.
    1. Why this is happen?i want to generate xml which its format is like above.
    2. How can i send this xml (put in msg parameter) using jsp (via web) without creating the mms.xml?
    3. if i want to set the msg parameter equal to mms.xml - means that msg = mms.xml, what is the data type for msg? is it an object or anything else?
    Thx b4 in advance...

  • I was wondering how you would do something like this?

    Hi i was wondering how you would do something like this?
    i recently got photshop CS5 and wanted to do something like this!

    Not sure exactly what the effect you are looking at, but my first glance is just an overly of 3 or more pictures.  The portrait in the back is just like 50% transparency.

  • HT201441 I found a phone that had been stolen, so I asked apple id to its original owner she said that she had forgotten and replace the apple id, how to solve a problem like this?

    II found a phone that had been stolen, so I asked apple id to its original owner she said that she had forgotten and replace the apple id, how to solve a problem like this?

    Send the original owner this link.
    (120249)

Maybe you are looking for

  • Upgrade from 3.0B (release 620) to BI 7.1 (release 710)

    Hi, Please guide me whether it is possible to upgrade from BW 3.0B system to BI 7.1, I am in release 620 now. Can you please help me locate upgrade guide for the same? Looking forward for your replies Thank you Rajath

  • Adding column is taking much time. How to avoid?

    ALTER TABLE CONTACT_DETAIL ADD (ISIMDSCONTACT_F NUMBER(1) DEFAULT 0 NOT NULL ,ISREACHCONTACT_F NUMBER(1) DEFAULT 0 NOT NULL Is there any way that to speed up the execution time of the query? It's more than 24 hrs completed after started running the a

  • Problem updating a control on one panel based on a value change in another control on a different panel

    Hi, I am trying to update the value of a control on one panel when the value of another control on a different panel is changed.  The two panels are saved in two different .uir files, so there are two associated .h files generated by CVI.  The proble

  • **HELP. ? (question mark/exclamation button does n...

    Just purchased a E71. Had it for 6 days now and I must say that this phone is Great! Was able to config all sorts of features and settings on it (wifi, my email, GPRS, google maps..etc) and the phone works like a charm. BUT i have a MAJOR issue with

  • How to make smooth line movement?

    Hello! I've been searching it everywhere, but couldn't find anything in the net. I want to make smooth line movement. I've tried to create motion, but line just moves, and I want it to move smoothly according to the path. What I want to achieve can b