Count Result With Column

Hello,
Oracle 10.2.0.1
OS : Windows XP
All we have scott.emp. If is says :
SQL> SELECT DEPTNO,COUNT(*) AS CNT FROM EMP GROUP BY DEPTNO ORDER BY 1;
    DEPTNO        CNT
        10          3
        20          5
        30          6My Requirement :
      COL1
10       3
20       5
30       6Means count of deptno+count of rows should be concatenated in a single column, so that my user can know that dept no. 10 has 3 rows, dept 20 has 5 rows. For this i can have two columns, but if it is possible in a single column, then my datagrid can be fit in the current window (now user do'nt need to scroll).
Thanks.

Hi,
user12050217 wrote:
... My Requirement :
COL1
10       3
20       5
30       6Means count of deptno+count of rows should be concatenated in a single column, so that my user can know that dept no. 10 has 3 rows, dept 20 has 5 rows. For this i can have two columns, but if it is possible in a single column, then my datagrid can be fit in the current window (now user do'nt need to scroll).Display is usually handled best by the front end. It's probably better to learn how to control your data grid, so that, for example, it doesn't allot 10 digits for deptno when you know it will always be 2 digits.
If you must use a back-end solution, then use TO_CHAR to convert the NUMBERS to strings, and then use || to concatenate them:
SELECT    TO_CHAR (deptno,    'FM99')    ||
       TO_CHAR (COUNT (*), '999999')          AS col1
FROM       scott.emp
GROUP BY  deptno
ORDER BY  deptno
;

Similar Messages

  • Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Details: Numbers not translating an Excel document with column headings where the text is rotated counter clockwise 90 degrees with-in the cell.  Can you tell me how I can rotate the contents with-in a cell?

    Numbers does not have rotated text within cells.  You can place a text box over the cell that has rotated text but you cannot rotate text within a cell.

  • Count along with all the records (columns)

      CREATE TABLE "EMP"
       (     "EMPNO" NUMBER(4,0),
         "ENAME" VARCHAR2(10 BYTE),
         "JOB" VARCHAR2(9 BYTE),
         "MGR" NUMBER(4,0),
         "HIREDATE" DATE,
         "SAL" NUMBER(7,2),
         "COMM" NUMBER(7,2),
         "DEPTNO" NUMBER(2,0)
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (1000, 'SMITH', 'CLERK', 7902, TO_DATE('12/17/1980 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 800, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (1000, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1600, 300, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (1000, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1250, 500, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7566, 'JONES', 'MANAGER', 7839, TO_DATE('04/02/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2975, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1250, 1400, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2850, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7782, 'CLARK', 'MANAGER', 7839, TO_DATE('06/09/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 2450, 10);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('04/19/1987 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 3000, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, HIREDATE, SAL, DEPTNO)
    Values
       (7839, 'KING', 'PRESIDENT', TO_DATE('11/17/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 5000, 10);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Values
       (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1500, 0, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7876, 'ADAMS', 'CLERK', 7788, TO_DATE('05/23/1987 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1100, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7900, 'JAMES', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 950, 30);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7902, 'FORD', 'ANALYST', 7566, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 3000, 20);
    Insert into EMP
       (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
    Values
       (7934, 'MILLER', 'CLERK', 7782, TO_DATE('01/23/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 1300, 10);
    COMMIT;On basic execution of this query
    select * from empwe get
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO.BUT I NEED THE DATA (columns) ALONG WITH THE COUNT OF THE RECORDS OF empno
    SOMETHING LIKE THIS
    COUNT EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO.On the whole i need count along with the entire data..
    Please advice

    Like this ?
    SQL> select count(*) OVER( ORDER BY EMPNO RANGE BETWEEN
      2                 UNBOUNDED PRECEDING AND CURRENT ROW) serial_no,
      3  ename,sal FROM EMP;
    SERIAL_NO ENAME                                      SAL
             1 SMITH                                      800
             2 ALLEN                                     1600
             3 WARD                                      1250
             4 JONES                                     2975
             5 MARTIN                                    1250
             6 BLAKE                                     2850
             7 CLARK                                     2450
             8 SCOTT                                     3000
             9 KING                                      5000
            10 TURNER                                    1500
            11 ADAMS                                     1100
    SERIAL_NO ENAME                                      SAL
            12 JAMES                                      950
            13 FORD                                      3000
            14 MILLER                                    1300
            15 999999                                     100
            16 ABCDEFGHIJKLMNOPQRSTUVWXYZAAAAAA           100
            17 MY#@ ' "ABC                                100
    17 rows selected.
    {code}
    Or
    {code}
    SQL> select count(*) OVER( ) tot_count,
      2  ename,sal FROM EMP;
    TOT_COUNT ENAME                                      SAL
            17 SMITH                                      800
            17 ALLEN                                     1600
            17 WARD                                      1250
            17 JONES                                     2975
            17 MARTIN                                    1250
            17 BLAKE                                     2850
            17 CLARK                                     2450
            17 SCOTT                                     3000
            17 KING                                      5000
            17 TURNER                                    1500
            17 ADAMS                                     1100
    TOT_COUNT ENAME                                      SAL
            17 JAMES                                      950
            17 FORD                                      3000
            17 MILLER                                    1300
            17 999999                                     100
            17 ABCDEFGHIJKLMNOPQRSTUVWXYZAAAAAA           100
            17 MY#@ ' "ABC                                100
    17 rows selected.

  • Querying the schema for table name with column value!

    In my schema i have 500+ tables and other objects.
    i have a column with the name BO_PRODUCT_CODE.
    I wants to know in what tables the value of BO_PRODUCT_CODE='FX03'.
    i have query the user_tab_columns which gives me the result with 90 tables having the column BO_PRODUCT_CODE.
    What is query which will give me the exact number/name of the table whose column value is FX03. ie, BO_PRODUCT_CODE='FX03'.

    Hi you can use this approach:
    BEGIN
    v_str VARCHAR2(250);
    v_count NUMBER :=0;
    DECLARE
    FOR loop_tbl IN ( SELECT DISTINCT table_name FROM USER_TAB_COLUMNS
    WHERE column_name ='BO_PRODUCT_CODE' )
    LOOP
    v_str := 'SELECT COUNT(*) FROM ' || loop_tbl.table_name || ' WHERE BO_PRODUCT_CODE=||'''' ||'FX03' || '''' '
    EXECUTE IMMEDIATE v_str INTO v_count ;
    IF v_count > 0 THEN
    DBMS_OUTPUT.PUT_LINE ('Table Name :'|| loop_tbl.table_name || ' Count :'||v_count);
    END IF;
    v_count :=0;
    END LOOP;
    EXCEPTION
    WHEN others THEN
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END;
    Please remove if any syntax error.
    Regards

  • How to use Special value set with Column clause to display addtional column

    hi
    can anyone tell me
    How to use Special value set with Column clause to display addtional column
    how can i use FND POPID and with COLUMN clause ?

    Dear Yaseen,
                To get the value in formula cumulative,after you have created the formula for that particular key figure,go to edit and click on tab "calculations".
    In that select overall result as 'count all values not equal to zero' and single result as 'count all values not equal to zero' .
    And mark the cumulative check box underneath.
    I hope you get the desired result and please do me favour .
    Sumit goomber

  • Help retreiving count as multiple columns

    I have a table 'decision_makers' with columns
    'made_by' - decision maker name
    and
    'decision_code' - code for decision 'A' -accepted 'R' -rejected 'P' -pending
    Assuming the data below in the table
    user1 'A'
    user2 'A'
    user3 'P'
    user1 'A'
    user2 'R'
    user3 'A'
    user1 - A
    I would like to see the out put in the following format
    user A R P
    user1 2 0 0
    user2 1 1 0
    user3 1 0 1
    total 4 1 1
    I am trying like
    select "made_by",count("decision_code") from "decision_makers"
    where "decision_code"='A' group by "made_by"
    But how can I write this 3 times to get desired result.
    Would it be possible by a single query? or do I need to write a sql procedure or 'view'
    I am new to Oracle and the above requirement looks complex to me.
    Anybody can push me in the right direction?
    Thanks
    R,
    Edited by: user10974770 on Apr 23, 2010 3:35 AM

    Welcome to the forums!
    It looks like you need a PIVOT with ROLLUP to achieve the results you want:
    SQL> WITH decision_makers AS
      2  (
      3          SELECT 'user1' AS MADE_BY, 'A' AS DECISION_CODE FROM DUAL UNION ALL
      4          SELECT 'user2' AS MADE_BY, 'A' AS DECISION_CODE FROM DUAL UNION ALL
      5          SELECT 'user3' AS MADE_BY, 'P' AS DECISION_CODE FROM DUAL UNION ALL
      6          SELECT 'user1' AS MADE_BY, 'A' AS DECISION_CODE FROM DUAL UNION ALL
      7          SELECT 'user2' AS MADE_BY, 'R' AS DECISION_CODE FROM DUAL UNION ALL
      8          SELECT 'user3' AS MADE_BY, 'A' AS DECISION_CODE FROM DUAL
      9  )
    10  SELECT  DECODE(GROUPING(MADE_BY),1,'total',MADE_BY) AS MADE_BY
    11  ,       COUNT(CASE WHEN DECISION_CODE='A' THEN 1 END) AS A
    12  ,       COUNT(CASE WHEN DECISION_CODE='R' THEN 1 END) AS R
    13  ,       COUNT(CASE WHEN DECISION_CODE='P' THEN 1 END) AS P
    14  FROM    DECISION_MAKERS
    15  GROUP BY ROLLUP(MADE_BY)
    16  /
    MADE_BY                            A                    R                    P
    user1                              2                    0                    0
    user2                              1                    1                    0
    user3                              1                    0                    1
    total                              4                    1                    1Edited by: Centinul on Apr 23, 2010 6:49 AM
    Simpler solution

  • Need help to develop report with column chart

    Hi
    I am new to SAP BO world.Could  anyone please help me to design report with column chart.Please guide me how to develop report for the following requirement.I am not aware of variance columns and variance labels.Please provide some guidance or some tutorials(for column Chart) so that I can complete the task. Please reply me as soon as possible.Waiting for reply.Thanks in advance.
    Type: Column Chart
    u2022     Rows: Banking Asset Margin (%)
    u2022     Start / End Columns: PY YTD Act(Prior year year to date); CY YTD Act(Current year Year to date)
    u2022     Variance Columns: # Var (CY-PY Act) for GOLM; Volume; Rate; Non Banking NII; Banking Volatility in NII; Banking Volatility in OOI; Fees/One Offs/Other; Volatile Items; Sophie
    u2022     Sub-total columns: PY YTD Underlying; CY YTD Underlying.
    u2022     Variance Labels: % Var (CY-PY Act) for Total Income and Underlying Income
    u2022     Sub-Total Labels: # Var (CY-PY Act) for Net Insurance Income; Banking Volatility; Other Operating Income
    Additional information
    u2022     Variance columns (bar) colours: Red = Adverse to Prior Year; Green = Favourable to Prior Year
    u2022     Columns to show values. Adverse values to be shown in red text in brackets. Favourable results in black text.
    u2022     All values in Black, but adverse to be shown below the bar.

    Hi,
    This type of question is almost impossible to answer over a forum .
    You need to work with your business to understand what these requirements mean in terms of data modelling and relationships between object entities.
    - Some of these metrics should be delegated to source, and calculated in the update routines to your datatargets (aka Cubes/Tables)
    - Others could be resolved in the semantic layer (Universe)
    - Other will be calculated in the presentation layer as local formulae or variables.
    whilst BusinessObjects is a fairly intuitive tool, it may be unreasonble to expect a new learner to deliver an advanced report with conditional formatting.
    Regards,
    H

  • Text search returns results with some keywords, but not others

    This pertains to a tours website for Turkey. I've sucessfully
    set up a search form, and results page which returns results when
    multiple keywords are entered. Everything is working well, except
    when certain keywords are used. For example, the table column being
    searched for is called long_itinerary, so if anyone is interested
    in a certain site or city, it's bound to be in the long itinerary
    somewhere.
    Here's the problem, by example: When someone searches with
    the keywords Antalya, Konya, Ankara, or Adana, for example, results
    are returned from the database, and those keywords are in each
    returned tour's long itinerary.
    But certain keywords return nothing, even when they're in
    practically all of the tours, in the long_itinerary column. For
    example, Istanbul, Ephesus, and Izmir, Kusadasi and Pergamum return
    no results, even though they're there. I've gone through all of the
    most likely keywords, and these are the offenders. If, for example,
    I search with "Istanbul Ankara," I get results with tours including
    Ankara (and Istanbul, but only because the word "Ankara" is in the
    itinerary).
    First I made sure the Charset values were the same on the
    search form page and the results page. Still had the problem. Next,
    I went into the database itself, and copied the word "Istanbul"
    directly from the long_itinerary column of the database, and pasted
    it into the search function's text field, and searched again. Same
    problem--no results returned.
    I can't see any difference between the keywords which work
    correctly, and those which don't, what baffles me is that even when
    I copy a keyword directly from the database and paste it in the
    search text field, it returns no results!
    Well, I'm baffled! Any ideas what might cause this?

    Hmm -- one of my customers is a turkish building company
    (Kusadasi BTW), and when *they* add some contents to the DB,
    they´ll be entering turkish chars. It´s in particular the
    turkish "I" which is pretty different, and this is when a search
    for keywords containing a western "I" will fail.
    Could that be the problem in your case ?

  • Problem with columns in the middle of my book

    I am writing my second book with Pages 2.02 and have run into a problem with columns. I want to add a long list of items as a list with check boxes for readers to check off. If I paste in enough text for three or four pages of two columns it gets messed up in various ways - the text flows into the following text if I don't use section breaks at the end instead of layout breaks, if I use section breaks it solves that one, but if I add anything to the list it changes all the columns across the pages so that one or several of the pages has way less in the right column than in the left. So far the left column fills the entire page all the time, but the right column has lots of spaces. If I switch back and forth from one column to two, it fixes it. If I add text before the list section it messes everything up again and because there is a section break I end up with a little bit of text on the last page and a huge gap before the single column part that follows.
    Does anyone know how to get reliable results that will not mess me up when adding content before the list or in the list itself?
    PowerBook G4   Mac OS X (10.4.8)  

    Hi Cymru,
    Thank you for thinking about my problems. I guess I s half asleep when I posted and it didn't make sense.
    I have so far 77 pages of the book divided into several chapters via section breaks. Inside the 5th section there is almost two pages of paragraphs. Those paragraphs could become 3.75 pages or who knows how long before the list of items. The list of items is 226 items separated by carriage returns and go from one word with 5 characters to 7 words and 34 characters. It needs to be a list with check boxes before them so that the user can check off the items that apply. It is a workbook about turning bipolar into an advantage and is currently 8.5 x 11 and printed on my laser printer for now, but when completed will be more like 8 x 10, so it needs to resize without major hassles.
    I have tried every combination of breaks to get the list to flow in two columns, but perhaps have not done the correct combination. I show invisibles and layout. At the end of my paragraphs I do a paragraph return. I then do either a section break or a layout break, followed by a paragraph return and another layout or section break. I then put my curser before the paragraph break, but after the first section/paragraph break, and set columns to 2, evenly divided by default with 3.2026" columns and .3375" gutter, but I want them to change with page size in the future.
    Once set up, I copy the text out of BBEdit and paste into the left column. It takes up several pages because it is formatted to do double spaces, so I use one of my styles to make it bold and single spaces. I then apply list style with image bullets and one of the default box images that came with Pages. There are 5 items in each column on the first page because it is close to the bottom, but flows into the next two pages. (with text edits it might end up 20 items in each column on the first page) The second page has 39 items in each column and the last page has 8 items in the left column only, but if with section breaks take up the whole page and the next paragraphs start on the next page. If I then add items to the list, every page gets messed up and the second page ends up with 39 on the left column and less items in the right column for each added item.
    If I use layout breaks instead of section breaks, the paragraphs following my lists (now with only one column) end up under the list. What that means is I can see my bold items, but beneath them are my paragraphs that belong after the list. I can see the layout break at the end of the list, but the columns that are shown as part of the 'view layout' are visible right over the single column text also for the rest of the page. The only way to solve that is to go with section breaks and put up with the gap from the end of the list to the following paragraphs.
    I hope this makes more sense.
    Tom
    PowerBook G4   Mac OS X (10.4.8)  

  • Compare Server Names in Excel sheet from column1 with column 2 and exact matched server names should be saved in column 3 in same Excel sheet

    Hi Guys,
    First of all thanks in advance any help much appriciated.
    I am new in scripting and excel, i am looking for below solution as my job requires daily work of this kind and i came to know by automating this work lots of time can be saved.
    Compare Server Names in Excel sheet from column1  with column 2 and exact matched server names should be saved in column 3 in same Excel sheet.
    Looking solutions first using excel i.e.vlookup itself so that it will not require any approval in my job else using powersell ,vbscript.
    Once again Thanks for you guys.
    /Regards
    Nitesh24in

    Hi Edward,
    Thanks once again
    I have only changed excel file path and after that this is saved as below , i am not sure which three lines should be together in one line. Please advise.
    $excel = New-Object -ComObject Excel.Application
    $Workbook = $excel.Workbooks.Add("F:\NewDocsToReadNitesh26-May2013\Excel\test.xls")
    $WorkSheet = $Workbook.Worksheets.Item(1)
    $WorkSheet.Activate() | Out-Null
    For ($i=1;$i -le $worksheet.UsedRange.Rows.Count;$i++) {
       If ($worksheet.cells.item($i,1).value2 -eq $worksheet.cells.item($i,2).value2) {
          $worksheet.cells.item($i,3).value2 = $worksheet.cells.item($i,1).value2
    }$Workbook.Save()$excel.Quit()[System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$excel) | Out-Null
    Thanks and Regards
    Nitesh24in

  • Count a distinct column value in an interactive report

    Hi,
    I'm struggling with this and would appreciate any pointers.
    I have built a view here:
    http://apex.oracle.com/pls/otn/f?p=11189:1
    The report can have duplicate column values. I'm tying to find a way using the interactive report functionality (i.e. without modifying the underlying SQL) to count a distinct column value. For example, in the example following the link I'd like to be able to count the unique customer_ids and return 7.
    This may be fundametally impossible depending on the way the SQL is generated for the interactive reports. If this is the case can anyone confirm this?
    Many thanks
    Yog.

    <B>"Not modifying views is fair enough. But not wrapping a SELECT around them? Really? Why? And as I said, that's imposible, the IR already does it."</B>
    This is not a problem. However for the IR's it's a development decision to keep all reported columns ( and analysis on these columns ) as a seperate development process to be controlled centrally by a seperate team. The point to remember is that the app looks at hundereds of views and it was decided that modifying each report to fit each instance would become cumbersome to manage and to put it simply there are not the resources to do it.
    again, I'm not here to justify any of that!
    <B>SELECT *" ? Every single time? Even when you want to populate a LOV with some names</B>
    No just the Reports. It is a very very simple app; a big list an a page for each report.
    <B>"I think you should always ask what you want, not less, not more"</B>
    I agree, and that should include select * from view.
    <B>"Why fetch data you don't want to see"</B>
    Some users will want to see some data from the view and other users will want to see other data, Over the whole user base someone somewhere will want to see all of it.
    <B> Actually, there is something good in this, in the future, when you will be asked to check and try to improve the load time of some page, here is the first place where you should look</B>
    Brilliant! Like it!!
    <B>Does it by any chance fetch a bunch of 20 meg LOBS and then discards them</B>
    No, Thankfully a few varchar2 columns and a lot of numeric columns, nothing huge. The reports are acutally pretty fast at the moment...

  • Calling web service with utl_dbws and parsing the xml result with Xpath

    I'm invoking a web service from the database(10.2.0.2.0) using sys.utl_dbws and all is working well. After executing response := sys.utl_dbws.invoke(call_, request); I execute dbms_output.put_line(substr(response.getstringval(),1,1500)); which results with:
    <refCursor10gProcessResponse xmlns="http://xmlns.oracle.com/refCursor10g">
    <result xmlns="http://xmlns.oracle.com/refCursor10g">
    <Row xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/ADM/SERVICES/GETST/">
    <Column name="C_ID" sqltype="VARCHAR2">20292</Column>
    <Column name="AYR" sqltype="VARCHAR2">2002</Column>
    <Column name="EDT" sqltype="VARCHAR2">2002-06-13</Column>
    <Column name="ETUS" sqltype="VARCHAR2">O</Column>
    <Column name="PC" sqltype="NUMBER">537</Column>
    <Column name="SG" sqltype="VARCHAR2"/>
    <Column name="VD" sqltype="VARCHAR2">Y</Column>
    <Column name="VR" sqltype="VARCHAR2">R</Column>
    <Column name="TS" sqltype="VARCHAR2">31</Column>
    <Column name="D" sqltype="VARCHAR2">I</Column>
    <Column name="T" sqltype="VARCHAR2">1</Column>
    <Column name="P" sqltype="VARCHAR2"/>
    <Column name="MT" sqltype="VARCHAR2">2</Column>
    <Column name="PTAT" sqltype="VARCHAR2"/>
    </Row>
    </result>
    </refCursor10gProcessResponse>
    How do I parse out just the value 20292 of Column name="C_ID" using xpath? I've tired but I don't think i have the xpath set up correctly:
    dbms_output.put_line(response.extract('//result/Row/Column/child::text)','xmlns="http://xmlns.oracle.com/refCursor10g"').getstringval());
    Error messgae is:
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at "ADM.CONSUME_WEB_SERVICES", line 439
    ORA-06512: at 3
    Thanks

    Tried getting by the attribute but I don't think I have the format correct:
    dbms_output.put_line(response.extract('//result/Row/Column@C_ID/child::text()','xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/ADM/SERVICES/GETST"').getstringval());
    Here's the full soap response envelope:
    <env:Envelope
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
    <env:Header/>
    <env:Body>
    <refCursor10gProcessResponse xmlns="http://xmlns.oracle.com/refCursor10g">
    <result xmlns="http://xmlns.oracle.com/refCursor10g">
    <Row xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/ADM/SERVICES/GETST/">
    <Column name="C_ID" sqltype="VARCHAR2">20292</Column>
    <Column name="AYR" sqltype="VARCHAR2">2002</Column>
    <Column name="EDT" sqltype="VARCHAR2">2002-06-13</Column>
    <Column name="ETUS" sqltype="VARCHAR2">O</Column>
    <Column name="PC" sqltype="NUMBER">537</Column>
    <Column name="SG" sqltype="VARCHAR2"/>
    <Column name="VD" sqltype="VARCHAR2">Y</Column>
    <Column name="VR" sqltype="VARCHAR2">R</Column>
    <Column name="TS" sqltype="VARCHAR2">31</Column>
    <Column name="D" sqltype="VARCHAR2">I</Column>
    <Column name="T" sqltype="VARCHAR2">1</Column>
    <Column name="P" sqltype="VARCHAR2"/>
    <Column name="MT" sqltype="VARCHAR2">2</Column>
    <Column name="PTAT" sqltype="VARCHAR2"/>
    </Row>
    </result>
    </refCursor10gProcessResponse>
    </env:Body>
    </env:Envelope>
    Any thoughts?

  • How do you count the multiple columns of a field in a table

    How do you count the multiple columns of a field in a table

    Hi,
    4396bf34-e890-4202-a6b0-4e08c9ff0e89 wrote:
    How do you count the multiple columns of a field in a table
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    "Field" isn't a standard database term.  Some people say "field" when they mean "column", but I don't think that's what you mean ("How do you count the multiple columns of a column ..").  Do you want to know how many times a column is used (as opposed to NULL), or the number of different values in a column?  You really need to show what you want.

  • Error in nested group function used with column name.

    Hi Team,
    If i used nested group function with column name its not working. Could you please any one suggest me.
    How to use it.
    Regards,
    Venkat.
    Please find Spool ........
    SQL> select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name,CNT;
    select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    ERROR at line 1:
    ORA-00937: not a single-group group function
    SQL> select max(max(CNT)) from(select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name;
    MAX(MAX(CNT))
    605

    Venkat wrote:
    Hi Sayan
    Its giving output like below, but not given maximum CNT.
    SQL> select user_name,max(CNT)from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name;
    USER_NAME MAX(CNT)
    BANES_LERG 6
    VENE_USER 8
    USER3 339
    DBUS 106
    VEL_USER 37
    SYS 597
    6 rows selected.Check it - Re: Error in nested group function used with column name.
    and previous post

  • Column order is changed in criteria tab ,result tab column order unchanged

    I created a report in sample database with these columns in 11.1.1.6
    1- C50 Region 2 D1 Office, 3 P1 Product 4 1-Revenue and 5 C1 Customer Name
    Hit Results and I can see the result in this order.
    If I change column order in result tab to say 1,5,2,3,4, result tab table view is updated. Now if I go back to criteria tab, column order remains the same ( 1,2,3,4,5)
    This may be expected functionality in 11.1.1.6 but was not the case in 10g. This may be due to changes allowed in html layer.
    Now if I go back to criteria tab and reorder columns (say 1,3,2,4,5) and then click result, result tab columns are not ordered as set here. Result tab continues to show 1,2,3,4,5
    I saved the report with order 1,3,2,4,5 and log back in, order remains 1,2,3,45/ I believe if I restart presentation services, it will be come OK. The only way is to create a new report that I know now other than restarting presentation service.
    Question
    Have you observed this?
    If yes, what is the solution, how can result tab refresh with the order of the columns in criteria tab?
    Bhupendra

    Hi,
    In OBI 11g,the column order in the criteria tab and the results tab are not coupled to each other.
    When you create the report for the first time, both are in sync. If you need to reorder the columns, goto result tab and click on edit report, in the columns and measures section of the report, reorder the columns the way you desire.
    Save the report and the report should have the columns in the order you have set.
    P.S : this is not a bug !
    Thanks,
    Vineeth

Maybe you are looking for

  • The contents in a internal table

    Hi Experts, I have a doubt in filling the contents of an internal table with the database table fields reference. For eg: There is an internal table like this: data: begin of t_conditions occurs 0,              kschl like rv13a-kschl,              vk

  • Production Order Settlement Process with respect to  a Project

    Hello All, I know about normal Production Order Settlement Process in discrete industries. Can anyone give me the steps for the Production Order Settlement Process if the Production Order is created with respect to a Project in SAP PP- PS Integration

  • HT203164 cd burn error 4900

    How can iTunes error 4900 when trying to burn a CD be fixed, iTunes and Quicktime have been completly uninstalled and reinstalled,

  • SSIS 2008 R2 Foreach Loop Container on ADO object in Endless Loop

    SSIS 2008 R2 I have an object Variable populated by a SQL Query.  I then attach it to a Foreach Loop Container with "Foreach ADO Enumerator" and define the variable mappings.  Inside the Foreach Loop is a series of tasks.  It appears that the tasks a

  • 11gr2 Dataguard Active Standby - Unable to get Real-Time apply working

    As above, I am unable to get real time apply to work WITHOUT it switching my standby back to MOUNT state. There does not seem to be anyting obvious from the broker, or alert logs. On the Standby: SQL> alter database recover managed standby database c