Displaying a sql result differently.

Hi, please read carefully and if you don't understand what I mean it please let me know.

Here are the names of tables and columns in tables

SYSTEM_USER_SKILL

user_id

skill_id

user_abilities

SYSTEM_ADMIN_SKILL

skill_id

skill_name

SYSTEM_USER

user_id

user_full_name

I want to write a sql dynmanic or a pl/sql that allows to display the user_full_name and the user_ability.

but I want it to appear as (see link below)

http://I61.Tinypic.com/fjhy5k.PNG

PS where you see the "Y" and "N" are the results of user_abilities

I don't know how to do all that I know is that it's possible with sql dynamic or pl/sql

someone else has managed to help me using the same description that I posted here. He did it using only my description. I don't provide any code

Violin SQL

Tags: Database

Similar Questions

  • How can I change the display of search results format?

    My default folder view is "details" for all folders. But search results always happens to "Tiles", which makes me go to discover details manually I have to search for a file each time. Is there an easy way to change the default display of search results?

    To remember. Try to remove all the parameters.
    Menu Tools (on the keyboard ALT + T) - Folder Options - view - reset records
    --
    ..
    --
    "Teun Spaans" wrote in message news: 7eca660e-c0c7-4 c 58-abfa-ff558257bbe8...
    > My default folder view is "details" for all folders. But still
    > search results comes to "Tiles", which makes me go to the details view
    > manually whenever I have to search for a file. Y at - it an easy way to change the
    > default search results display?

  • JSON to the sql result set

    Hi all

    I have this requirement to convert the JSON format in the result set (with the lines and columns).

    is their in any case I can achieve this?

    I was able to successfully convert the sql result set in JSON format but difficult time to do the reverse.

    Flexibility:

    At some point, I expect the lines to return no more than 2 & about 50 columns maximum.

    Therefore, the JSON itself can be stored in varchar2 (4000) and not need to use CLOB. (If necessary to be passed as an argument to the function).

    Oracle version: 11.2.0.3

    Kind regards

    AAG

    There are at least the son on this site below:

    https://community.Oracle.com/thread/2505918

    https://community.Oracle.com/thread/3634280

    https://community.Oracle.com/thread/3557925

    https://community.Oracle.com/thread/2510292

  • Is there a tool to display grafic iometer results

    Is there a tool to display the iometer results in a chart?

    Excel?

    Iometer exporting its results to a .csv file, isn't it? Import into Excel and create a chart.

    If you found this information useful, please consider awarding points to 'Correct' or 'Useful' answers and answers. Thank you!!

  • Export a sql result with the right button of the mouse

    We do not have the ability to export the sql result to in Developer SQL EA 3.0.4. I have very difficult ofr me, because all day in my service allows us to export to excel or export format insert,...

    We have 2 versions of the SQL (3 and 2.1) developer only because there is no such thing as this feature in 3.0.

    Do you have a solution for Developer SQL EA 3.0?

    In the EA, it's called Unload , but do not get 3.0 production, where he's back for the export .

    Have fun
    K.

  • dash line, show by sql result

    Hi, there are 2 choices to view the results for the guest (choices in the command prompt).

    "All values" and "SQL result."

    I found that for all values, the results are SEPARATE.
    for SQL result, if the sql code is "select... from...» ', the results may be unique (choice duplicated in the command prompt)
    If the sql code is "select DISTINCT... of...» ", the results are still not unqiue (double choice in the command prompt).

    is this a bug? or SEPARATE only is not supported?

    Hello

    I don't think that there is a need to SEPARATE in the select clause. Default BI Server will apply separate in the application and go to the database. This is true for all non-primary key columns only specific columns. Here is an example,

    There are some duplicate values in the column of the subregion. But even if I give the sql code following in guest of dashboard for the 'Results' option it again retrieves unique records.

    SELECT customers. Sub-region of countries "OF HS

    BI Server generated query:
    Select distinct T175. COUNTRY_SUBREGION C1
    Of
    SH COUNTRY T175

    Kind regards

  • Add the variable of presentation in a prompt SQL results

    Hello friends!

    I have a prompt with the time Dimension (year (p.v. v_year) and month (p.v. v_month)). Then I have another guest of departments in the same page and I want to compel departments depends on my year and selected months before.

    I know to do with variable presentation, if I go to SQL results in prompt Department and ADD the following: "WHERE"Sun Time"." Year=@{v_year}"it works but I want to add months also!

    How can I do?


    Thank you very much!!!

    Hello

    Use single quotes...
    "like... month = ' @{var_month}"

    hope this can work...

  • How to get SQL Developer 4.1 to display the query result?

    SQL DEV 4.0.3.16.84 execution of a SELECT statement is stored in a .sql file causes the window of the query result of pop-up indicating the result of a SELECT statement.  SQL DEV 4.1 is not to do so.

    Oops on my part; my SQL formatting has been the root cause.  I got used to insert split without any character of comment lines in front of them.  For example:

    ==================================================

    Select funny business;

    The foregoing indicates the behavior described.

    --==================================================

    Select funny business;

    With the dash double comment shows, the SQL works very well.

    This is different than previous versions of SQL Developer, but is probably better functionality.  I'll try to mark it as answered, but anyone with the admin should certainly do so if I can't.

  • Display SQL results in flash

    Hi all

    Can someone tell me how I would go about setting up flash to display the results returned by a query SQL, one at a time.  I can work on the query and PHP, but want I want to know, how to do flash take each of them and animate it, including the suspension and the compensation of the full screen, and then continues on a screen of 'new '.  That's essentially a list of events in a database.

    So, while watching the movie in action, you'd see

    White screen

    Event 1 (break)

    Tournament 2 (pause)

    Event 3 (pause)

    (make one pause and fade out)

    New screen

    Event 4

    Event 5

    Event 6

    .. and so on until all the results have been posted.

    Any help much appreciated.  In fact, it is possible that what I need is help as to how to achieve this returning from xml.  It's really the actionscript code that I am lost.

    Thank you

    James

    If you do not have a handle on the management of dynamic content in Flash, and then to the time you should focus on solving just this aspect and save with php/sql/xml eventually.  To creat now just a stufff array you want to treat it the way you want and it works from there.  Eventually, that's what you get when you feed the file, the data anyway.

    As far as the break and the animation of the aspects go, your best bet will be to search Google for a tutorial on perhaps a slideshow or marquee that runs automatically.  Understand how it works, and then find a way to turn it into something that suits your needs.

    The basic tools that you will be after will be the Tween class to animate the Timer class to trigger a break/motion, as well as their respective event listeners.  If you can find some simple tutorials just for these two things separately, you might be able to reason about the merger for what you are after.

  • When I filled a form field using a query SQL result is displayed but not registered in the table.

    I write in the topic, I have created a form and in some of their fields, I used a SQL query to get information from a table based on the user who has been logging.

    The information displayed well, but when I press "Send button" loses information and the field in the table is shown empty.


    Anyone know what is happening?

    I enclose below a picture of the problem

    Concerning

    Problema DB APEX.jpg

    Hi ANTHONY,.

    ANTHONY wrote:

    I give you the credentials of my database, I hope you could do it works and most importantly, showing me what the error care...

    Feel free to change what you want in the application

    https://Apex.Oracle.com/pls/Apex/f?p=4550:1:2838412118981:

    BANCO_PRUEBAS

    ADMIN

    password

    It is interesting that, when I use APEX 5.0.1.00.06, I have some errors form appearing not using APEX 4.1.0.00.32

    Check your 77569 application-> Page 1. I have modified the page element attributes. Now it's working.

    Here are the changes (I will explain for P1_NOMBRE, did the same for the P1_APELLIDOS and P1_CATEGORIA):

    • 'Source' has become article attributed to him include:

    Source: Replacement always, value that exists in session state

    Source type: column database

    Source of value or an expression: NUMBER

    • The "Default" article now the following attributes:

    By default of Type: PL/SQL function body

    Default value:

    DECLARE
    
      L_NOMBRE B_LISTA_EMPLEADOS.NOMBRE%TYPE;
    
    BEGIN
    
      select NOMBRE
      into   L_NOMBRE
      from   B_LISTA_EMPLEADOS
      where  USERNAME = :APP_USER;
    
      RETURN L_NOMBRE;
    
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
      RETURN NULL;
    
    END;
    

    Kind regards

    Kiran

  • SQL and PL/SQL show different results.

    I checked the following behaviors using various tools/applications.

    If you run the following SQL:

    procedure GetDurchschnAlterGes (reference date, cur_Besch to t_CURSOR) is

    Start

    Open the cur_besch FOR

    Select i.anztext AS 'Amt. "

    r.anztext AS "Revier."

    OE.anztext AS 'Sachgebiet. "

    g.anztext AS 'Einheit ',.

    t.anztext AS "Teileinheit."

    Count (*) AS 'Anzahl total.

    ADaten mi,

    AKalender KAL,

    AInspektion I,.

    ARevier R,.

    Aoeausdruck OE,

    AGruppe G,.

    ATeileinheit T

    WHERE kal.datum = reference

    -Join Kalender

    AND mi.idkalender = kal.id

    -Join auf - Inspektion

    AND I.ID = MI. INSPEKTIONID

    -Join auf Revier-

    AND R.ID = MI. REVIERID

    -Join auf OE-

    AND oe.ID = MI.idoeausdruck

    -Join Group

    AND G.ID = MI. GRUPPEID

    -Join Teileinheit

    AND T.ID = MI. TEILEINHEITID

    -Group OF the st. OEAUSDRUCK, bv.anztext, kg.kattext;

    Group BY grouping sets ((i.anztext, r.anztext, oe.anztext, g.anztext, t.anztext), (i.anztext, r.anztext, oe.anztext, g.anztext), (i.anztext, r.anztext, oe.anztext), (i.anztext, r.anztext), (i.anztext))

    order of i.anztext, r.anztext, oe.anztext, g.anztext, t.anztext;

    end GetDurchschnAlterGes;

    I get a count for "i.anztext" which is the number of set of records in the table "ADaten".

    Using this SQL, the results are correct.

    Select i.anztext AS 'Amt. "

    r.anztext AS "Revier."

    OE.anztext AS 'Sachgebiet. "

    g.anztext AS 'Einheit ',.

    t.anztext AS "Teileinheit."

    Count (*) AS 'Anzahl total.

    ADaten mi,

    AKalender KAL,

    AInspektion I,.

    ARevier R,.

    Aoeausdruck OE,

    AGruppe G,.

    ATeileinheit T

    WHERE kal.datum = to_date ('15.01.2003 ',' JJ.) MM.yyyy')

    -Join Kalender

    AND mi.idkalender = kal.id

    -Join auf - Inspektion

    AND I.ID = MI. INSPEKTIONID

    -Join auf Revier-

    AND R.ID = MI. REVIERID

    -Join auf OE-

    AND oe.ID = MI.idoeausdruck

    -Join Group

    AND G.ID = MI. GRUPPEID

    -Join Teileinheit

    AND T.ID = MI. TEILEINHEITID

    Group BY grouping sets ((i.anztext, r.anztext, oe.anztext, g.anztext, t.anztext), (i.anztext, r.anztext, oe.anztext, g.anztext), (i.anztext, r.anztext, oe.anztext), (i.anztext, r.anztext), (i.anztext))

    order of i.anztext, r.anztext, oe.anztext, g.anztext, t.anztext;


    The only difference is that the parameter 'Date' is not used and a constant value is passed.


    Could someone pls check and possibly give me a clue what I'm doing wrong?


    Thank you in advance.


    Thomas

    > kal.datum = reference

    Variable has the same name as the column name.

    Change the name of the variable or the prefix with the scope, for example "GetDurchschnAlterGes.datum".

  • query or pl sql block to display the mentioned result

    create table shirt (color varchar2 (10), number Qty., number s, number m, l, xl, xxl number);

    insert into shirt values ('black', 10, 5,2,1,2,0);

    insert into shirt values ('black', 8, 2,1,2,0,3);

    insert into shirt values ('White', 5, 2,1,1,0,1);

    insert into shirt values ('White', 7, 2,1,2,1,1);

    How to get the bottom of output?

    Expected result:

    G1 G2 QUANTITY

    Black s 7

    Black 3 m

    Black           l                 3

    XL Black 2

    XXL black 3

    White s 4

    White m 2

    white            l                2

    XL white 1

    White xxl 2

    Vinodh

    Correction


    with

    shirt as

    (select "black" color, quantity 10, 5 s, 2 m, 1 l, 2-xl, xxl 0 of all the double union)

    Select 'Black', 8, 2, 1, 2, 0, 3 double Union all

    Select 'White', 5, 2, 1, 1, 0, Union 1 double all the

    Select 'White', 7, 2, 1, 2, 1, 1 double

    )

    Select the color of g1, g2, quantity

    (select color, concerned, sum (m) m, sum (l) l, sum (xl) xl, sum (xxl) xxl

    shirt

    Group by color

    )

    UNPIVOT (quantity for g2 in (as ', m mod', 'l' l, xl as "xl", xxl as a 'xxl'))

    order of g1, decode(g2,'s',1,'m',2,'l',3,'xl',4,'xxl',5,6)

    G1 G2 QUANTITY
    Black s 7
    Black m 3
    Black l 3
    Black XL 2
    Black XXL 3
    White s 4
    White m 2
    White l 3
    White XL 1
    White XXL 2

    Concerning

    Etbin

  • Display dynamic SQL statement result

    Hello

    Is it possible to view the sql statement in the procedure below, after that the variables are applied?

    In my view, a solution would be to put the entire statement in an important variable, then use DBMS_OUTPUT. Put_line (my_large_variable) but I'm hoping to save this step.

    Thanks in advance for your help,

    Lou

    create or replace
    PROCEDURE TEST1_PROC)
    p_refcur ON SYS_REFCURSOR,
    p_where in VARCHAR2,
    p_order_by in VARCHAR2
    )

    IS

    v_id ci_summrpt_report_codes.id% TYPE;
    v_descr ci_summrpt_report_codes.descr% TYPE;
    v_valid_flag ci_summrpt_report_codes.valid_flag% TYPE;
    v_order_by VARCHAR2 (100);

    BEGIN
    IF p_order_by IS NULL THEN
    v_order_by: = NULL;
    ON THE OTHER
    v_order_by: = "ORDER BY". p_order_by;
    END IF;
    DBMS_OUTPUT. Put_line (p_where);
    DBMS_OUTPUT. Put_line (v_order_by);
    P_refcur OPEN FOR ' SELECT id, descr, valid_flag OF |
    «(SELECT 1 AS 'ID', "A" AS "DESCR", "Y" AS "VALID_FLAG" OF THE DOUBLE ' |)»
    "UNION ALL" |
    "SELECT 2,"TWO","Y"OF THE DOUBLE ' |
    "UNION ALL" |
    "SELECT 3,"THREE"," Y "DOUBLE" |
    "UNION ALL" |
    SELECT 4, "FOUR", "Y" DOUBLE) ' |
    p_where |
    v_order_by
    ;
    END TEST1_PROC;

    In my view, a solution would be to put the entire statement in an important variable, then use DBMS_OUTPUT. Put_line (my_large_variable) but I'm hoping to save this step.

    This isn't a big problem, I think, is - this? :

    create or replace procedure test1_proc (p_refcur        out sys_refcursor,
                                            p_where      in     varchar2,
                                            p_order_by   in     varchar2)
    is
       v_id           ci_summrpt_report_codes.id%type;
       v_descr        ci_summrpt_report_codes.descr%type;
       v_valid_flag   ci_summrpt_report_codes.valid_flag%type;
       v_order_by     varchar2 (100);
       v_stmt         long;
    begin
       if p_order_by is null
       then
          v_order_by := null;
       else
          v_order_by := ' ORDER BY ' || p_order_by;
       end if;
    
       dbms_output.put_line (p_where);
       dbms_output.put_line (v_order_by);
       v_stmt :=
          'SELECT id, descr, valid_flag FROM '
          || '(SELECT 1 AS "ID", ''ONE'' AS "DESCR", ''Y'' AS "VALID_FLAG" FROM DUAL '
          || 'UNION ALL '
          || 'SELECT 2, ''TWO'', ''Y'' FROM DUAL '
          || 'UNION ALL '
          || 'SELECT 3, ''THREE'',''Y'' FROM DUAL '
          || 'UNION ALL '
          || ' SELECT 4, ''FOUR'',''Y'' FROM DUAL) '
          || p_where
          || v_order_by;
       dbms_output.put_line (v_stmt);
    
       open p_refcur for v_stmt;
    end test1_pro;
    
  • Display of query results

    I wrote a request to give me monthly information on the activities of our users.  The works of query and the data are good, but I'm not a fan of how it displays the information that I have and wanted to know if there was a way for me to re - write the query to get the same results.  Here are examples.

    Oracle Version: 11.2.0.2

    Scenario of

    Select ev.initiating_user, ad.display_name, count (*)

    the event ev, auditdefinition ad

    where ev.object_class_id = ad.event_class_id and ev.create_date between to_date('01-MAY-2014','dd-MON-yyyy') and to_date (31 May 2014 23:59:59 ',' JJ-ME-aaaa HH24:MI:SS)

    Ad group. Display_name, ev.initiating_user

    ad ranking. Display_name, ev.initiating_user;

    Please note that the data themselves are not given 'real', but it should give you an idea of what I need.

    initiating_user display_name Count (*)
    User1Creation1
    User2Creation23
    util_3Creation456
    User1View380
    user4View

    3490

    user5View2309
    util_3Change

    120

    user5Change4230Utilisateur6Change3489User7Change59

    As you can see, a user may be listed through all the s different 'display_name '.  The display_name will generally always the 3 above, but I'll add another in a future later.  Essentially, it is pretty static.

    My Question

    How can I get the desired below display?

    User1 User2 util_3 user4 user5 Utilisateur6 User7
    Creation123456
    View38034902309
    Change1204230348959

    Essentially, I want to make the header user names.  User names can change from one month to the next, is not the static data.  I read an article on 11 g - pivot.html and it discusses something with pivot and unpivot.  I tried to use the concept in my query, but cannot understand successfully where I'm wrong.  Here is my attempt.

    Select * from)

    Select ad.display_name, ev.initiating_user from auditdefinition ad, event ev where ad.event_class_id = ev.object_class_id

    )

    Pivot

    (

    Count (initiating_user)

    for initiating_user in (select distinct initiating_user of event)

    )

    order by display_name;

    When I try to launch it, I get an error message:

    ORA-00936: lack of expression

    00936 00000 - "missing expression.

    * Cause:

    * Action:

    I tried to change my query to:

    Select * from)

    Select ad.display_name, ev.initiating_user from auditdefinition ad, event ev where ad.event_class_id = ev.object_class_id

    )

    Pivot

    (

    Count (EV.initiating_user)

    for ev.initiating_user in (select distinct ev.initiating_user of the event ev)

    )

    order by display_name;

    But I got an error message:

    ORA-01748: only here allowed simple column names

    01748 00000 - "names of only allowed simple column here.

    * Cause:

    * Action:

    I looked at the error and I think that it is said that Oracle does not like the prefix "ev." in the "pivot ().  Can someone please help provide me assistance?  Thank you.

    d

    976563 wrote:

    SELECT *.

    DE)

    SELECT ad.display_name, ev.initiating_user

    To auditdefinition ad.

    ev event

    WHERE ad.event_class_id = ev.object_class_id

    )

    PIVOT XML

    (

    Count (initiating_user)

    FOR initiating_user IN (SELECT DISTINCT initiating_user

    OF the event)

    )

    ORDER BY display_name;

    ORA-00918: column ambiguously defined

    00918 00000 - "ambiguously defined column.

    * Cause:

    * Action:

    I don't know where is the ambiguous column that oracle is not satisfied.  Any ideas?

    Don't count on it, it won't, FOR the terms column should not be part of aggregate clause. (this my observation)

    Count (initiating_user)


    Either use

    COUNT (1)

    or

    COUNT (any other column),

    What should there be in a select query not among these ad.display_name, ev.initiating_user


    976563 wrote:

    SELECT *.

    DE)

    SELECT ad.display_name, ev.initiating_user,

    To auditdefinition ad.

    ev event

    WHERE ad.event_class_id = ev.object_class_id

    for example

    SELECT *.

    DE)

    SELECT deptno,

    employment,

    SAL,

    EmpNo

    WCP

    )

    PIVOT XML

    (

    Noah Count (empno),

    Sal Sum (SAL)

    FOR EMPLOYMENT (job SELECT DISTINCT FROM emp)

    )

    ORDER BY deptno



  • Popup LOV result differs from Lily LOV

    Hello
    I wanted to spend a popup LOV lists using the same named LOV, but the display changes. I wanted the field to display a name, even if the underlying value is an id number and it works very well with a simple list of LOV. When I change the pop-up list, the name no longer displays in the field, only a number. Whey is the Popup behaves differently from the list? Am I missing something? I even did in Apex 4.0.1 and earlier at the Apex 4.1 and got the same result.

    Pat

    Try to use the ' Popup * key * LOV...» "vs type 'Popup LOV."... ».

Maybe you are looking for