Results of the incomplete application of the dba_role_privs and/or dba_tab_privs

Hello

I am a PL/SQL Developer and I sometimes use an account with privileges to make DBAs ' ish small things. Using this account, I can create patterns and roles for example. Also I question the views dba_role_privs and dba_tab_privs using the privileged account. However, when our DBAs that the same query against these points of view on the sys account, they do not see the roles that I created using my privileged account. I don't know exactly what they see in these views when working in the sys - only that they do not 'my' roles.

Can someone tell me why that is (and possibly what to do about it). Hope that's not trivial - I was not able to find all the previous messages on the subject and the documentation I can find says that all the grants are displayed by these points of view without making mention of the exceptions or conditions.

/ Jakob

The key is that line in the documentation.

ROLE_TAB_PRIVS described in table privileges granted to the roles. The information is provided only on the roles to that the user has access.

Allows you to set up a try and see what happens.

First, we will create a user, TEST_A

SQL> CREATE USER TEST_A IDENTIFIED BY "";

User created.

SQL> GRANT CREATE SESSION, CREATE ROLE TO TEST_A;

Grant succeeded.

Then let's start as TEST_A, create a role and grant a privilege to table it.

TEST_A > CREATE ROLE test_role;

Role created.

TEST_A > GRANT SELECT ON DUAL TO TEST_ROLE;

Notes, creating a role implicitly gives access to the creator.

So now, let's query ROLE_TAB_PRIVS as TEST_A

TEST_A > SELECT role FROM role_tab_privs WHERE role = 'TEST_ROLE';

ROLE
------------------------------
TEST_ROLE

As planned, we get the result. Now, login as SYS and run the same query:

SYS > SELECT role FROM role_tab_privs WHERE role = 'TEST_ROLE';

no rows selected

No result, as expected. SYS was not granted this role and therefore do not see it in the ROLE_TAB_PRIVS view.

Since you use your query as TWO different users and your query depends on the user that is running (because of the ROLE_TAB_PRIVS seen as a reference to the USER), you will get two different result sets.

I hope this helps!

Tags: Database

Similar Questions

  • The course does not send the results of the tests and reports system (Saba) after trial. The course remained "incomplete". What can you recommend?

    The course does not send the results of the tests and reports system (Saba) after trial. The course remained "incomplete". What can you recommend?

    Ok.  So you're screenshot compared to SCORM clouds now shows you're scoring 100% in the quiz, but your state of completion will still come out incomplete.  Then of course, your quiz notification settings not award success based on passing the test.

    Try to set your quiz the way I show this screenshot using SCORM 1.2 instead of 2004.

  • How to see the fn:trace() results in the newspaper and/or console workshop?

    Hello, all.
    So, I'm a new in ODSI, in advance, my excuse to basic questions.

    I would use the fn:trace () function. However, the following code does not send information either on AdminServer.log or Wokshop console. What is the reason?

    declare the procedure tns:test() {}
    declare $timeBefore as XS: date: = fn:current-date();
    FN: trace($timeBefore, "My First test"); -> How to see the trace output?
    Returns the value $timeBefore.
    };

    Here's what I have in the console AdminServer.log and workshop:

    common/application {}
    user: weblogic
    name: testCase2
    EventKind: update
    Server: AdminServer
    }

    performance of the query / {}
    compiletime: 93
    }

    common, session, request, invocation {}
    time: Tue may 25 15:41:12 IDT 2010
    Duration: 0
    }

    Update/service {}
    procedure: test
    arity: 0
    DataService: ld:Logical/over_files/testCase_OverFiles.ds
    script: declare ns0 namespace = "" ld: logic/over_files/testCase_OverFiles ";"
    {return value ns0:test() ;}
    }

    {/ common time signature}
    timestamp: Tue may 25 15:41:12 IDT 2010
    Duration: 93
    }

    Best regards
    Yuri.

    Edited by: ygauchma may 25, 2010 05:59

    Because I'm not over your shoulder, it must be very clear on what you tried.

    Your first post show you a procedure using the trace. Well, I tried this, and instructions (ODSI set to debug and WLS logging of debug level log level) and it worked. Have you tried that? Doing a job?

    Now you're showing a function. Have you tried setting log levels?

    Where are you looking for results? The will NOT in the Console for ODSI Studio Test view (I guess that's where you're looking). They will be in the WLS log file if you have configured the log WLS-> Log level = debug file. They will be in the WLS (stdout/stderr) console if you have configured this Log level = debug.

    I believe that the trace function is implementation specific, then there is no such thing as a generic example.

    -Mike

  • Comparison of the results of the performance and the sum of the sum of array elements

    I did a comparison of the performance of "Add table" with 2 other methods (an Add elements and function of ddot BLAS) to see who was the fastest and also to compare their results, given that I was watching a few slight differences.

    Conclusions
    BLAS ddot's quicker (just a little), then add items, then add it in a loop of table

    BLAS ddot and add items table give identical results almost all the time.

    I don't know why add items in a loop manually gives a slightly different result. I understand there are any rounding due to finite precision errors, but why is it different for the 2 other methods?

    This classic of digital computing: the quality of the result depends on the order of operations.

    A simple example is the calculation of a * b / c with a, b, c equal to 25, 200 and 100 respectively. The result should be 50, but if a, b and c are U8, the result depends on the order of operation, as shown in the example below. DBL and data non-entier, the difference is of course that much smaller, but still there are!

    In your case, the difference also stems from the order of operations:

    -in the table add-in, the product of all the elements is calculated first and then the elements of the array are added.

    -in the loop, the addition is performed after each multiplication.

  • Result of the search and common properties

    In a logic model I would change the rule of removal for a large number of entities (+ 100)

    I did a search in advanced by using a regular expression mode. Seaching for all relationships with the DELETE CASCADE rule.

    Using the properties button I can change the rule for all of them, but not a selection of the result of the search.

    Is there a way I can select a subset of the search results to edit common properties for?

    There is no simple way to improve the filter and filter entities that should not be changed.

    It is not a way to select only the relationship sought and then right-click to see a common properties dialog box?

    This way I can prevent a lot of repetitive actions...

    BTW I don't see not a way to change the parameter 'delete rule' for relationships in the logic model through research - common properties

    Hello

    I did a search in advanced by using a regular expression mode. Seaching for all relationships with the rule CASCADE.

    ....

    BTW I don't see a way to change the "delete rule' defining relationships I

    I also wonder how did you research on 'delete rule' property?

    Don't you know that you can combine the search on several properties with AND clause expressions? Then probably you can filter the best what to include in the result.

    If not for property 'rule of deletion' appearing in the search, you must edit the file Relations.xml in the directory datamodeler\datamodeler\xmlmetadata of your installation of DM-

    You must add the search of the = "true" attribute in the definition of the deleteRule property and restart Data Modeler

    Philippe

  • How to arrange the result of the query and adding column outomatic translate


    Hello

    my need to find number of devices activated per day in the city, my data as below

    1City_2Samsung
    5City_2IPhone
    4City_2IPhone
    2City_2IPhone
    1City_2IPhone
    1Ville1Samsung
    3Ville1Samsung
    17Ville1IPhone
    12Ville1IPhone
    5Ville1IPhone
    3Ville1IPhone
    3Ville1IPhone
    6Ville1IPhone
    7Ville1IPhone
    1Ville1IPhone
    3City_3IPhone

    I need the result to be as below but not only (IPhone and Samsung) device name could be any new device like HTC or compressed, then is it possible to add a new type of device automatically in a column, once a new device type show up in devices activated daily,

    CityTotal enabled accountsIPhoneSamsung
    Ville158544
    City_213121
    City_3330

    my table as below,

    Create table test values (number count1, city varchar2 (10), device)
    VARCHAR2 (10));

    Insert into test values (COUNT1, CITY, DEVICE)
    (17, 'Ville1', 'IPhone');

    Insert into test values (COUNT1, CITY, DEVICE)
    (1, "Ville1", "IPhone");

    Insert into test values (COUNT1, CITY, DEVICE)
    (7, "Ville1", "IPhone");

    Insert into test values (COUNT1, CITY, DEVICE)
    (6, 'Ville1', 'Phone');

    Insert into test values (COUNT1, CITY, DEVICE)
    (3, 'Ville1', 'IPhone');

    Insert into test values (COUNT1, CITY, DEVICE)
    (3, 'Ville1', 'IPhone');

    Insert into test (COUNT1, CITY, DEVICE) values (1, 'city' 1, 'Samsung');

    Insert into test values (COUNT1, CITY, DEVICE)
    (3, 'Ville1', 'Samsung');

    Insert into test values (COUNT1, CITY, DEVICE)
    (12, "Ville1", "IPhone");

    Insert into test values (COUNT1, CITY, DEVICE)
    (5, "Ville1", "IPhone");

    Insert into test values (COUNT1, CITY, DEVICE)
    (1, "City_2", "IPhone");

    Insert into test values (COUNT1, CITY, DEVICE)
    (2, 'City_2', 'IPhone');

    Insert into test values (COUNT1, CITY, DEVICE)
    (4, 'Ville_2', 'IPhone');

    Insert into test values (COUNT1, CITY, DEVICE)
    (5, "Ville_2", "IPhone");

    Insert into test values (COUNT1, CITY, DEVICE)
    (1, "City_2", "Samsung");

    Insert into test values (COUNT1, CITY, DEVICE)
    (3, 'City_3', 'IPhone');

    Thank you



    Hello

    Here's a way to use the solution to askTom ( ask Tom & quot; PivotChart & quot; )  in your case:

    CREATE OR REPLACE PROCEDURE dynamic_device_pivot
    (p_cursor ON SYS_REFCURSOR
    )
    AS
    l_query VARCHAR2 (30000): = "CHOOSE the city, SUM (count1) AS total_accounts;
    BEGIN
    FOR (IN) r
    SEPARATE device select
    OF the test
    ORDER BY device
    )
    LOOP
    l_query: = l_query | REPLACE (", SUM (DECODE (device," $X$ ", count1, 0)) as $X$")
    , '$X$'
    dbms_assert.simple_sql_name (r.device)
    );
    END LOOP;

    l_query: = l_query | 'FROM test GROUP BY city ORDER BY city';
    dbms_output.put_line (l_query |) "= l_query in dynamic_device_pivot");   -For debugging only

    P_cursor OPEN FOR l_query;
    END dynamic_device_pivot;
    /
    DISPLAY ERRORS

    RC VARIABLE REFCURSOR
    EXEC dynamic_device_pivot (: rc);

    PRINTING: rc

    The output is not quite what you have posted, due to a typing error, probably:

    CITY TOTAL_ACCOUNTS IPHONE SAMSUNG PHONE

    ---------- -------------- ---------- ---------- ----------

    City1                  58         48          6          4

    City_2                 13         12          0          1

    City_3                  3          3          0          0

  • I'm administrater whenever I have download something and you try to open it say parmiters not correct with the result that the average and especially if it worked yesterday how does this error occurs

    Please tell me how or what to reset the paramiters I admin I think someone is intentionaly changing settings so I can't access my computer not very good in this area and need to know

    Try a system restore to a Date before the problem began:

    Restore point:

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-system-restore/

    Do Safe Mode system restore, if it is impossible to do in Normal Mode.

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.

    http://www.windowsvistauserguide.com/system_restore.htm

    Read the above for a very good graph shows how backward more than 5 days in the System Restore Points by checking the correct box.

    See you soon.

    Mick Murphy - Microsoft partner

  • How the lack of dates online results of the query and convert the output

    Hi Experts,

    My inline query returns the data in this format

    2-jan-2016    10
    4-jan-2016    33
    5-jan-2016    20
    7-jan-2016    70
    8-jan-2016    77
    

    I want to display the output as

    1-jan-2016 2-jan-2016 3-jan-2016 4-jan-2016 5-jan-2016 6-jan-2016 7-jan-2016 8-jan-2016 9-jan-2016 10-jan-2016 
    0    10    0   33  20 0  70 77 0 0
    

    Can you please help me with query how over the missing dates, is it tier, collar or pivot?

    Thanks in advance.

    Kind regards

    IVW

    Hello

    Is that what you are looking for?

    WITH
    SampleSet
    AS (SELECT TO_DATE (' 2 January 2016', 'DD-mon-yyyy') dt, val 10 FROM DUAL)
    UNION ALL
    SELECT TO_DATE (' 4 January 2016', 'DD-mon-yyyy'), 33 FROM DUAL
    UNION ALL
    SELECT TO_DATE (' 5 January 2016', 'DD-mon-yyyy'), 20 FROM DUAL
    UNION ALL
    SELECT TO_DATE (' 7 January 2016', 'DD-mon-yyyy'), 70 FROM DUAL
    UNION ALL
    SELECT TO_DATE (' 8 January 2016', 'DD-mon-yyyy'), 77 FROM DUAL
    )
    sample_rn as
    (
    Select
    DT
    val
    , dt - min (dt) (order 1) + 1 rn
    2 line_no
    Of
    SampleSet
    order by
    DT
    )
    mindate as
    (select min (dt) dt sampleset)
    dates in the FORM
    (
    SELECT
    DT + level 1 - dt
    null val
    level rn
    1 line_no
    Of
    MinDate
    CONNECT BY ROWNUM<= 10 ="" --="" number="" of="">
    )
    a, as
    (
    Select
    to_char Col (DT)
    rn
    line_no
    Of
    dates d
    Union
    Select
    to_char Col (Val)
    rn
    line_no
    Of
    sample_rn
    where
    RN<= 10             ="" --="" number="" of="">
    )
    Select
    *
    Of
    a pivot (pass the max (col) of rn (1,2,3,4,5,6,7,8,9,10))--liste of columns 1 to))

    What makes a list with 2 rows. Line 1 has dates starting with the first data of sampleset. and line 2 has the values. The number of columns, you can determine yourself.

    Kind regards

    Peter

  • unexpected results of the Group and the merger of processor

    Hi team,

    I use a processor of group and the merger in a process that includes "Store-num" and the "Cust-num" and mergers based on the most common value.

    I have few records store-Num = 42 and a few records store-num = 426. But for the same "Cust-num" for these two stores, store-num ' 426' we replace "42"

    My point is that these documents should not have grouped at all.

    No idea why this happen?

    Kind regards

    Ravi

    Yes, that's correct. Dates will be converted to a string representation of the date.

  • How to return results to the job application?

    Hello

    The application that I must be able to perform procedures and works asynchronously (run a stored procedure and do not wait the results.) A different thread will show the results at a later date).

    What I came up with is a mechanism that distributes the jobs by running the desired procedures and signals the application thread waiting on a performance of the work by using dbms_alert.signal. The application in his spare time reads the results of the table and then employment has created and he falls when it is done.

    The problem is I have many different methods, each do very different logic and you end up with another result/slider/record-set (different columns, different values), I need to be able to read the application after receiving the signal.

    I expect a statement as if by magic 'create table from sys_refcursor', but there seems to be no such thing (disappointment).
    I have read many things on the table and features in the pipeline, but the problem is that for each procedure, I set a different type for the return clause, and I was expecting something more 'generic '. I don't want the procedures to make the table of results to create themselves (unless it's my only option)

    You have a way to turn a sys_refcursor in a table?
    I am that face the wrong way?

    Any help would be appreciated!
    Thank you.
    -Mor

    Pyrocks wrote:

    I have to move the cursor to return - I need to return the result.

    How to get to this result? With the help of a select SQL statement.

    What does Oracle with this SQL statement? Analyze and store them as a cursor.

    All SQLs are analyzed as cursors.

    Why not create a table (temporary use), called "temp_result_n" where n is a number.

    Not a good idea to dynamically create tables - that need to use dynamic SQL. And code management and control to clean later.

    It's ugly. The process will fail and temporary tables created not get cleaned. Dynamic SQL can hit any runtime errors. Etc.

    This is a much more robust approach to use a static data model - one that does not punish dynamic to use code.

    Can you please explain why your way is better than using tables?

    I'm all for the use of the tables. The basic concept I've tried to explain, is that the background process must happen something to the process parent to tell him how and where to get the results, he has created.

    The more flexible method would be to pass a SQL statement - as the background process will know exactly what the parent needs to access these results run SQL.

    The parent gets this SQL statement (with bind variable), run it (which creates a slider) and process the results.

    Another approach is more static - have the parent tell the background process in which table to create its results. But it is less flexible.

    Another approach, you can use use the primary key of the data entity dealing with the background has to process. For example, the caller can give the background process an invoice number and when you said it's done, the appellant knows what Bill has been processed.

    So, there are a number of ways that the parent process and the child process of background can pass data between them. The most generic of these would be for the child to pass a SQL Select to the parent of the parent to use to access the result set created by the child.

    But it will be a too complex approach if the parent simply needs to create children for an invoice and save the invoice number with the id of child's work. When the parent is the signal that the child is done, it looks simply invoice number that has now been addressed by the child.

    There is no single best approach for this. It depends on your needs and what parents and children must do and how this approach to parallel processing is to increase the performance and scalability to provide.

    BTW,
    I would be very grateful if you could tell me how to translate DBMS_SQL. Column col_type DESC_REC in actual data types (1 = varchar2, 12 = date - where can I find the rest?)

    Take a look at the table in Pro * PL/1 to the precompilateurs Oracle® supplement Guide guide. The same table is probably repeated n other pre-compiler and OIC guides too.

  • How to retrieve a result of the user for a task in worklist application?

    Hello

    I have a requirement to retrieve the result of a task for a user in the application of the list of tasks in a BPEL process. You will find details below:

    I have a BPEL process that contains the human task for an approval workflow. The human task is defined as:

    1. my task requires approval for parallel flow model. that is, I will assign tasks to multiple users and they can take action at the same time.
    2. once all users have taken on the task (100% percentage of Consensus), the overall outcome will be decided as approved or rejected.
    3. after step 2, I want to update the results of each approver in a table. (that is, each approver's decision: approved or rejected).

    How can I retrieve the results for each user? I am able to see the overall result of the task and not the results of the individual user.

    Is it possible to do this? If so, how?

    All entries will be really useful.

    Thanks in advance.

    We use 11.1.1.3. called onSubTaskUpdated for each user (n times) to approve/reject, she also gettting called onTaskCompleted after all users participated.

    Thank you
    -Sreeny

    Edited by: sreeny September 23, 2010 11:32

    Edited by: sreeny September 23, 2010 11:33

  • Number of the results in the report variable

    Hello everyone,

    I need help in TestStand reports. I use TestStand 2014 and 2014 of Labview, both 32 bits.

    The situation is like this: I am running a test with test steps 3. The first stage of the test is a step of "additional results" which records the device under test info (versions of the hardware software etc...). This information appear in the report and the result data in the database (table prop_result). The next 2 steps are the steps 'real' which measures something.

    In the report, there is a call from the variable "Number of results" (see the screen attached capture) and you see a '3 '. There are actually only 2 steps of 'real' test as I don't want to consider the first step of "additional results" as a test step. How can we affect the variable 'Number of results' so that it does not count this first step? I tried to use the properties-> Run Options-> record result of the for Option set to "Disable". It works and the number of results appeared as "2", but the device under test info do not appear in the report and not in the prop_result of the database table.

    In general, how can I get the number of results of account not a step, but continues to display the result in the database and report? Is there an API where I can access and modify its value (number of results value) such as: "Number of results" - 1?

    Hope someone can point me in the right direction. I have attached the release of the report, as well as the file in the sequence.

    Yours,

    chati

    I ment, you can change the XML seq.--> \Components\Models\TestStandModels\reportgen_xml.seq generator (Ref http://www.ni.com/white-paper/3977/en/).

    It's the AddReportHeader, you need to change. Or more specific step 9 (in teststand 2012) which is a statement-->

    Parameters.ReportHeader += "<" +="" fileglobals.reportelementname="" +="" "="" type='UUT' "="" +="" "="" title='" + ResStr("MODEL", "RPT_HEADER_TITLE") + "' "="" +="" "="" link='" + Locals.UUTItemNameForLink + "' "="" +="" "="" uutresult='" + Str(Locals.Status) + "' "="" +="" "="" stepcount='" + Str(Parameters.StepCount) + "' "="" +="" "="">\r\n".

    and then, you can modify the varabel StepCount using some filtering by using for example a subsequnce that counts only the type of measures that your customer wants to be counted.

    There might be ways esier there, but that's what I'd do.

  • How to get the result of the test of CVI DLLs in teststand!

    I write a driver dll to test a source, I want to get the tension of world SERVERS (the instrument of the RS) and I used to call DLLs that written by CVI, teststand

    My question is what is the best way I can get the result of the test and show the user to teststand. the code below is fair? When I used to call this dll document, teststand

    "" I just get the result by setting in TS.this is a good meathod, and what should you do in teststand, I put the "outputVoltageV" point to an object?

    /*===========================================================================*/
    / * Function: read voltage/current output * /.
    / * End: this function returns the output and actual output voltage * /.
    / * current instrument.                                      */
    /*===========================================================================*/
    ViStatus _VI_FUNC rsngsm_datReadOutput (ViSession instrSession,
    ViPReal64 outputVoltageV, ViPReal64 outputCurrentA, ViPBoolean statusPeakCurrent)
    {
    ViStatus rsngsm_status = VI_SUCCESS;
    Bruno buf [BUFFER_SIZE];
    ViInt32 retCnt;
       
    FMT (buf, "%s<>
    If ((rsngsm_status = viWrite (instrSession, buf, NumFmtdBytes (), & retCnt))<>
    Return rsngsm_status;
           
    If ((rsngsm_status = viRead (instrSession, buf, 50, & retCnt))<>
    Return rsngsm_status;
    If (Scan (buf, "%s > %f [p2];")) %f [p2]; %i [b2] ", outputVoltageV, outputCurrentA, statusPeakCurrent). = 3)
    Return rsngsm_status;
           
    Return rsngsm_status;
    }

    sean_tan,

    Yes, you just pass a value of digital TestStand (e.g.; locals.number).

    If you use the adapter of the ICB, it might make more sense that you can use the Flexible DLL adapter for this type of function, that you do not use the standard settings of tTestData and tTestError. While TestStand will correctly recognize the function prototype, you want to make sure you that include the type library of your function Panel (you will need to create one if you have not already done so) in settings target of LabWindows / CVI-> type library.

    I hope this helps.

    -Jack

  • icons not showing in the notification area. a disable the UnP and SSD without result. on the Properties tab to hide the icons inactive icon is grayed out

    My icons in the notification area continued to show. I disabled the UnP and SSDP nothing helps. The box to Hide inactive icons on the Properties tab is grayed out so I can't hide the first icon.  Any ideas?

    first of all, what is the brand and model of the pc?

    current antivirus?

    Operating system and service pack?

    Make sure that your system is clean:

    Download, install, update and scan with these full free malware detection programs:

    Malwarebytes (MMFA): http://www.malwarebytes.org/products/malwarebytes_free

    SUPERAntiSpyware: (SAS): http://www.superantispyware.com/

    http://WindowsXP.MVPs.org/TrayNotify.htm

    Read more top

    Finally, after back with the results of the analyses and the answers to the above questions, please.

  • Procedure to export the result of the query to an excel or csv

    Hi all

    I have two identical paintings

    EMP_TEST OF THE EMP

    ID ID NAME

    1     SAM                      1        SAM

    2 JOHN 2 ROCK

    3 3 STEVE BRAND

    I need to combine the result under the query and intent to export data to excel using a procedure

    my query is

    Select 'EMP_ID', E1. EMP_ID, AND. EMP_ID from emp E1,

    emp_test AND WHERE E1. EMP_ID = AND. EMP_ID

    UNION

    Select "EMP_NAME", E1. EMP_NAME, AND. Emp E1 EMP_NAME,

    emp_test AND WHERE E1. EMP_ID = AND. EMP_ID

    but I get this error message

    ORA-01790: expression must have same type of corresponding data

    EMP_ID is a number and EMP_NAME is of type varchar.

    I need any idea or suggestion on sub queries.

    (1) I have to combine the result set in a single query.

    (2) I need to write the procedure that will export the result of the query to an excel or csv.

    Thank you.

    As PR has said, there are ways that have already been explained in this forum to write in external files. For your query condition, try this.

    SELECT CASE WHEN (REGEXP_LIKE (T1.ID,'[^ [: alpha:]] "")) THEN 'EMP_ID '.

    ELSE "EMP_NAME' END AS COL_NAME.

    T1.ID,

    T2.ID

    DE)

    SELECT CASE WHEN ID IS NULL THEN NAME ANOTHER TO_CHAR (ID) END AS ID,

    ROW_NUMBER () OVER(ORDER BY RN NULLS FIRST,ID) RN

    DE)

    SELECT ID, NULL,

    NAME,

    RN ID

    FROM EMP

    UNION ALL

    SELECT ID,

    NAME,

    RN NULL

    FROM EMP)) T1.

    (SELECT CASE WHEN ID IS NULL THEN NAME ANOTHER TO_CHAR (ID) END AS ID,)

    ROW_NUMBER () OVER(ORDER BY RN NULLS FIRST,ID) RN

    DE)

    SELECT ID, NULL,

    NAME,

    RN ID

    OF EMP_TEST

    UNION ALL

    SELECT ID,

    NAME,

    RN NULL

    OF EMP_TEST)) T2

    WHERE T1. RN = T2. RN;

    OUTPUT:

    COLUMN-NAME ID ID
    --------  ---------------
    1 1 EMP_ID
    2 2 EMP_ID
    3 3 EMP_ID
    SAM EMP_NAME MARK
    EMP_NAME JOHN JOHN
    EMP_NAME STEVE DARREN

    6 selected lines.

Maybe you are looking for