security of the row/column in function

Hello

We have the necessary specific company, which is linked to motor vehicle liability insurance. There are many insurance companies, which have joined into a single fund. All claims and contracts are in the single data warehouse. Each line of data (for example, in the table of recreational vehicles) has a column that contains the ID of an insurer.

The problem is that this data warehouse will be used for analytical purposes, for example, to calculate the cost of insurance. For this operation the insurance companies need data for the whole of the market (Fe: all insured red BMW-s). A few details (reg. No. a car) of each returned row can be visible for the company, whose ID matches the value of the insurer_ID column.

Example:

Table: vehicles
V_ID | do | color | reg_no | insurer_ID
123 | BMW | Red | 123ABC | 11
234. BMW | Red | 456QWE | 22

Insurer with ID 11 querys table:
Select * from vehicles where do = 'BMW' and color = 'red ';

Oralcle should return:
V_ID | do | color | reg_no | insurer_ID
123 | BMW | Red | 123ABC | 11
234. BMW | Red | NULL | NULL VALUE

Is this possible with the native tools of Oracle?

First variant would be, that there is a query layer, which splits the query in to separate phrases and returns the results to new bundle:

Select * recreational vehicle where do = 'BMW' and color = 'red' and insurer_ID = '11';
Select vehicle_ID, make, color of vehicles where do = 'BMW' and color = 'red' and insurer_ID! = "11";

Query layer must also restore:
V_ID | do | color | reg_no | insurer_ID
123 | BMW | Red | 123ABC | 11
234. BMW | Red | NULL | NULL VALUE

Second solution would be separate tables, one that contains sensitive data and other data not delicate, between those who must be described in a table relationships. On the first table there is a view for each third party returns authorized only lines.

Is there an existing case study for this kind of business needs?

Version of database is Oracle 11 g Standard.

Best regards
Erki Pettai
Analyst
Proekspert Ltd

We can make our own implementation of VPD using views. It's not too bad for RLS, but it's a little gross to CLS.

The basic idea is to set a namespace or a context that is defined using dbms_session.set_context () and then referenced in the view by using sys_context(). In your scenario, you do not want to fill the frame with the company ID whenever someone logs in. (Obvously this kind of thing is gnarlier in stateless web applications). Your opinion would then be something watch this...


create or replace view restricted.vehicles as
select V_ID
       , make
       ,  color
       , case when insurer_ID = sys_context('your_namespace', 'company_id') then reg_no else null end as reg_no
       , case when insurer_ID = sys_context('your_namespace', 'company_id') then insurer_ID else null end as insurer_ID
from restricted.vehicles
/

Note the schema name: you must make sure that the tables are not visible to other users, that point of view. A safer solution would still be two levels of views. At the external level selects just * the internal level. At the external level is believe that gave himself and therefore protects statement of the view from prying eyes.

You will find the simple line-level stuff - just put in the WHERE clause of the view.

Because you are running a data warehouse, I suppose that you are spared the inconvenience of trying to manage updates, etc. in this way.

This course is a Joseph and will be a bit of a nightmare to maintain, especially if you have a lot of tables that you want to protect. That's why Oracle do you want to pay for the license of the company.

Good luck.

Cheers, APC

blog: http://radiofreetooting.blogspot.com

Tags: Database

Similar Questions

  • Select the row column report default tick intractive all

    Dear friends,


    SELECT LINE intractive report column check box should be checked by default. If I want to uncheck in this column of the select row I could do.

    How can I do this?




    Concerning

    CORINE

    Hi Maxence,

    CORINE wrote:

    Hello

    I used this link http://carlback.blogspot.com/2007/09/mini-check-all-howto.html

    Classic report. in the case of column intractive automatic report check box created at the top of the report to update and remove number of lines and the column named as the selected lines. I want intractive report this column box to checked by default. now which albums happed checkbox header column is unchecked while on this it is TICKING at all under the values checkbox. I want to check all values for first time during the page load.

    Hope I am clear to you the obligation.

    Still not clear with the wording of the explanation. I understand that there is an interactive relationship with the first column as a box to tick and the loading of the page you want all the boxes ticked.

    To make this writing a dynamic action on the page load to run some JavaScript as follows:

    $( "input:checkbox" ).attr('checked', true);
    

    But this applies to all of the check boxes on the page. If you want more specific a class say chkbox adds the checkbox column and change the dynamic action above to:

    $( ".chkbox" ).attr('checked', true);
    

    I hope this helps!

    Kind regards

    Kiran

  • How to join two tables if you transpose the rows, columns and rows in one of the table

    Hi guys,.

    can someone help me please in the write request

    I have two tables

    Agents and Agent phones but in the agent phones table for the id of an agent it displays 4 rows because one of the column there types of different phones (office, mobile, home, fax)

    So instead of display 4 rows, I used max(case...) to convert rows to columns

    now how to reach it with another table

    Requirement:

    Database: 11.2.0.2.0

    create the table AGENT_PHONE

    (

    agent_id NUMBER (20) not null,

    agent_type_code VARCHAR2 (10) not null,

    agent_type_prefix VARCHAR2 (10) not null,

    Phone_Number VARCHAR2 (16) not null,

    phone_type_code VARCHAR2 (10) not null

    )

    CREATE TABLEAGENTS

    (

    agent_id NUMBER (20) not null,

    agent_type_code VARCHAR2 (10) not null,

    agent_type_prefix VARCHAR2 (10) not null,

    NAME VARCHAR2 (40) NOT NULL

    )

    INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)

    VALUES (29709, ARE ', 'OFFICE', '4805551436', 'CELL');

    INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)

    VALUES (29709, ARE ', 'OFFICE', '1111111111', 'PHONE');

    INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)

    VALUES (29709, ARE ', 'OFFICE', '2223334444',' OFF');

    INSERT INTO AGENT_PHONE(AGENT_ID,AGENT_TYPE_CODE,AGENT_TYPE_PREFIX,PHONE_NUMBER,PHONE_TYPE_CODE)

    VALUES (29709, ARE ', 'OFFICE', '5556667788', 'FAX');

    INSERT INTO VALUES AGENTS

    (29709, ARE ', 'OFFICE', 'FLY');

    INSERT INTO VALUES AGENTS

    (1234, ARE ', 'OFFICE', 'MIKE');

    SELECT * FROM AGENT_PHONES

    AGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXPHONE_NUMBERPHONE_TYPE_CODE

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

    29709REOFFICE4805551436CELL
    29709REOFFICE1111111111PHONE
    29709REOFFICE2223334444OFF
    29709REOFFICE5556667788

    FAX

    SELECT * AGENTS

    AGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIX

    NAME

    29709REOFFICEROB
    1234REOFFICE

    MIKE

    This is so the data we have in both table

    Now, I transposed rows to columns in the table of agent phones so I used the following query

    SELECT AP. AGENT_ID,. AGENT_TYPE_CODE,. AGENT_TYPE_PREFIX.

    MAX (CASE WHEN AP. PHONE_TYPE_CODE = 'CELL' THEN AP. PHONE_NUMBER END) AS CELL.

    MAX (CASE WHEN AP. PHONE_TYPE_CODE = 'OFF' THEN AP PHONE_NUMBER END) AS TURNED OFF.

    MAX (CASE WHEN AP. PHONE_TYPE_CODE = 'FAX' THEN AP. PHONE_NUMBER END) LIKE FAX,.

    MAX (CASE WHEN PHONE_TYPE_CODE = 'PHONE'. THEN AP PHONE_NUMBER END) AS PHONE

    AGENT_PHONE AP

    WHERE AP. AGENT_ID = 29709

    GROUP OF AP. AGENT_ID, AP. AGENT_TYPE_CODE, AP. AGENT_TYPE_PREFIX.

    AGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXCELLOFFFAXPHONE
    129709REOFFICE4805551436222333444455566677881111111111

    My question is how this to join the agents table so that my output should be like this...

    I want to display all the results in the table of the Agent, even if they are not in the table of agent phones. As you can see there are other agent id 1234 is also populated

    AGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXNAMEAGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXCELLPHONEOFFFAX

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

    29709REOFFICEROB29709REOFFICE4805551436111111111122233344445556667788
    1234REOFFICEMIKE

    Currently, I run this query and I get the output as below

    SELECT *.

    AGENTS HAS

    LEFT OUTER JOIN AGENT_PHONE AP

    ON A.AGENT_ID = AP. AGENT_ID

    AND A.AGENT_TYPE_CODE = AGENT_TYPE_CODE.

    AND A.AGENT_TYPE_PREFIX = AGENT_TYPE_PREFIX.

    AGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXNAMEAGENT_IDAGENT_TYPE_CODEAGENT_TYPE_PREFIXPHONE_NUMBERPHONE_TYPE_CODE
    129709REOFFICEROB29709REOFFICE4805551436CELL
    229709REOFFICEROB29709REOFFICE1111111111PHONE
    329709REOFFICEROB29709REOFFICE2223334444OFF
    429709REOFFICEROB29709REOFFICE5556667788FAX
    51234REOFFICEMIKE

    I want id 29709 agent in a line with 1234 agent also id to display

    You can rotate your phone number of agent in columns

    Select *.

    of AGENT_PHONE

    pivot)

    min (PHONE_NUMBER)

    for PHONE_TYPE_CODE in ('CELL' as a 'CELL', 'PHONE' like 'PHONE', 'OFF' in the 'OFF', 'FAX' as 'FAX')

    )

    AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX CELL PHONE OFF FAX
    29709 RE OFFICE 4805551436 1111111111 2223334444 5556667788

    Then you can join to view inline or CTE

    with AGENT_PHONE_PIVOT like)

    Select *.

    of AGENT_PHONE

    pivot)

    min (PHONE_NUMBER)

    for PHONE_TYPE_CODE in ('CELL' as a 'CELL', 'PHONE' like 'PHONE', 'OFF' in the 'OFF', 'FAX' as 'FAX')

    )

    )

    SELECT *.

    AGENTS HAS

    LEFT OUTER JOIN AGENT_PHONE_PIVOT AP

    ON A.AGENT_ID = AP. AGENT_ID

    AND A.AGENT_TYPE_CODE = AGENT_TYPE_CODE.

    AND A.AGENT_TYPE_PREFIX = AGENT_TYPE_PREFIX.

    AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX NAME AGENT_ID AGENT_TYPE_CODE AGENT_TYPE_PREFIX CELL PHONE OFF FAX
    29709 RE OFFICE ROB 29709 RE OFFICE 4805551436 1111111111 2223334444 5556667788
    1234 RE OFFICE MIKE - - - - - - -

    Is that what you're looking for?

  • Create the row column in PL/SQL

    I ask as below:

    SELECT THE RCTV. BATCH_SOURCE_ID, RCTL. DESCRIPTION, RCTL. QUANTITY_INVOICED,

    RCTL. UNIT_SELLING_PRICE + NVL (RCTL. TAX_RECOVERABLE, 0) AS PRICE_UNIT

    OF RCTV, RCTL RA_CUSTOMER_TRX_LINES_ALL RA_CUSTOMER_TRX_PARTIAL_V

    WHERE RCTV. CUSTOMER_TRX_ID = RCTL. CUSTOMER_TRX_ID

    AND RCTV. TRX_NUMBER = '100'

    AND RCTL. LINE_TYPE = 'LINE '.

    AND RCTV. BATCH_SOURCE_ID = 6077

    Result:

    8-17-2015 12-27-59 PM.jpg

    My question, can I get result like the image below.

    as.jpg

    Only for Description DOC FEES and STAMP DUTY.

    Please help me...

    Thank you all...

    Change the order where you want to place the DOC_FEE and the STAMP_DUTY I see no specific reason, why you have put at the forefront

    SQL> with t(batch_source_id,description,quantity_invoiced,price_unit) as (select 6077,'20FG/COC/LADEN/FOFO',2,3500000 from dual union all
      2                  select 6077,'40FG/COC/LADEN/FOFO',4,66500000 from dual union all
      3                  select 6077,'40HC/COC/LADEN/FOFO',3,66500000 from dual union all
      4                  select 6077,'DOC_FEE',1,150000 from dual union all
      5                  select 6077,'STAMP DUTY',1,6000 from dual)
      6  ,q as (select batch_source_id,description,quantity_invoiced,price_unit
      7              ,max(case when description='DOC_FEE'
      8                      then price_unit
      9                      else 0
     10               end) over(partition by batch_source_id ) as doc_fee
     11               ,max(case when description='STAMP DUTY'
     12                      then price_unit
     13                      else 0
     14               end) over(partition by batch_source_id ) as stamp_duty
     15    from t)
     16  select batch_source_id,description,quantity_invoiced,price_unit
     17             ,case when row_number() over(partition by batch_source_id order by quantity_invoiced desc) =1
     18             then doc_fee
     19             else 0
     20             end as doc_fee
     21             ,case when row_number() over(partition by batch_source_id order by quantity_invoiced desc) =1
     22             then stamp_duty
     23             else 0
     24             end  as stamp_duty
     25   from q
     26   where description not in ('STAMP DUTY','DOC_FEE')
     27  /
    
    BATCH_SOURCE_ID DESCRIPTION         QUANTITY_INVOICED PRICE_UNIT    DOC_FEE STAMP_DUTY
    --------------- ------------------- ----------------- ---------- ---------- ----------
               6077 40FG/COC/LADEN/FOFO                 4   66500000     150000       6000
               6077 40HC/COC/LADEN/FOFO                 3   66500000          0          0
               6077 20FG/COC/LADEN/FOFO                 2    3500000          0          0
    
    SQL>
    
  • Query Oracle - to display the line in the Condition column in function.

    Hi all

    I have data like below.

    ID of ranking name Desc

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

    1             ID1          A              AA1

    2             ID1          A              AA2

    1             ID1          B              BB1

    2             ID1          B              BB2

    1             ID2          C              CC1

    2             ID2          C             CC2

    1             ID2          D             DD1

    2             ID2          D             DD2

    I need the query to retrieve the data as below.

    ID of ranking Name1 Name2

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

    ID1 1 A - AA1 B - BB1

    1 ID2 CC1 - C D - DD1

    That is to say) Condition: Grade must be 1.

    Thank you and best regards,

    Stéphane.

    with

    DATA_TABLE as

    (select 1 Rank, ID 'ID1', 'A' name, Descr "AA1" of union double all the)

    Select 2, 'ID1', 'One ', ' AA2' Union double all the

    Select 0, 'ID1', 'B', "BB1" dual union all

    Select 3, 'ID1', 'B', 'BB2' from dual union all

    Select 2, 'ID2', 'C', 'CC1' from dual union all

    Select 3, 'ID2', 'C', 'CC2' from dual union all

    Select 1, 'ID2', would be ', 'DD1"dual union all

    Select 3, 'ID2', would be ', 'DD2' from dual

    )

    SELECT id, Name1, name2

    go (select id,

    name_desc_rank,

    ROW_NUMBER() over (partition by order of identification by name_desc_rank) rn

    go (select grade,

    ID,

    name | '-' || descr | '-' || TO_CHAR (Rank) name_desc_rank,

    ROW_NUMBER() over (partition by order of rank identification) rn

    of data_table

    )

    where rn<=>

    )

    Pivot (Max (name_desc_rank) of rn (1 as name1, name2 2))

    ID NAME1 NAME2
    ID1 A-1 AA1 B-BB1-0
    ID2 C CC1-2 D DD1-1

    Concerning

    Etbin

  • LabVIEW can find location of row/column selected in the open worksheet?

    Instead of asking user to LabVIEW manually to input data (location of the row/column you want for data entry in the spreadsheet open), can read LabVIEW that the location of the row/column selected in a worksheet open, selected by the user?

    If so, LabVIEW now has a starting location for the user to launch inputing data without having to ask the user LabVIEW!

    Any ideas on how to achieve this would be very appreciated!

    Thank you!

    Barry

    For what you want to do here, read and write in the cell current.  This example shows you the basics...

    Example of NOR

  • can I create a generic function row column Point?

    I have a VI with several inside multi-column list boxes.  One way that I've seen do writing entries is as follows:

    It works very well.  The only problem is that, to get the "Point to the row column" (PTRC) method requires (as I understand it) right click on the MCL and selecting this method.

    I have several MCLs, and I wanted to create a structure of the event which was generic and one of them was able to treat similarly.  But the problem with that is that I don't know a way to access the PTRC method for each of them.  The only way I know to do would be to use VI scripts to create the reference on the fly (not sure if it still works), but even if it works for me, I don't think that it will work with the free runtime LV (my experience is that you can not use RTÉ to run any screws that use scripts of VI).

    So my question is, is it possible to get a reference to the PTRC - generically - method without using scripts VI, or y at - it another way to do what I'm trying to do here (make the MCL writable by the user and have it keep the values that the user wrote to her during the execution of the VI).

    Thank you

    Hello bmishoe,

    You are almost there - just use an explicit, not implicit method and use this node of CtrlRef on the structure of the event to give you a reference to the control associated with the event.  At this point, all you have to do is add the MCLBs to the structure of the event.

    Kind regards

  • Select row column in classic report default beat all

    Hello

    Based on my previous thread how can I do the same task in classic report.

    I followed your previous link to all select and clear the all check box.

    even he just not all checked when the page loads.

    Please help with this too.

    Hi Maxence,

    CORINE wrote:

    Hello

    Based on my previous thread how can I do the same task in classic report.

    I followed your previous link to all select and clear the all check box.

    even he just not all checked when the page loads.

    Please help with this too.

    The answer lies in the previous thread: Select the row column in report default heartbeat intractive all

    I hope this helps!

    Kind regards

    Kiran

  • column of the row

    Database IS 9I

    column to line-> result string

    EX:

    1.

    Select * from a;
    NAME CLASS MY NUM
    SALE 2 10301
    10301 2 SHIP
    SALE 2 10302
    10302 3 SHIP

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

    2 column in the row

    CLASS NAME 10301 10302-> not fixed
    A      SELL               2                2
    A      SHIP               2                 3

    You can try the below... You can use DBMS_SQL to get it easily... I'm working on which will inform you soon

    FUNCTION to CREATE or REPLACE dyn_row_colum

    RETURN VARCHAR2

    AS

    v_str1 VARCHAR2 (32767).

    v_sqlstr VARCHAR2 (32767): = ' SELECT DBMS_XMLGEN. CONVERT (SUBSTR (XMLAGG (XMLELEMENT (e, val1 |'|)))) '''|| '''|| ' ||'|| '''|| ' ||'|| ''', '''|| ' ||'|| '''|| ' ||'|| '''|| Chr (13) | Chr (10): ' | '''). EXTRACT ('|) '''|| ((((' Text()'| "'| ')), 1), 1) val2

    Of

    (SELECT "|") '||'''''''''|| name||''''''''||''||''||'''''',''''''||''||''||''''''''|| Class';

    v_restr VARCHAR2 (32767).

    BEGIN

    SELECT "' NAME"'. ' ||'|| ''', '''|| ' ||'|| ''' CLASS'''||'||'||''''||','||

    (SELECT DBMS_XMLGEN. CONVERT (SUBSTR (XMLAGG (XMLELEMENT (e, ',' | read).))) Extract ('//Text ()') ORDER BY LUN), 2), 1).

    FROM (SELECT DISTINCT "'|) ' ||'|| '''|| my | " ' ||'|| ' ||'' ' Lun

    A)) | «, » ||'' ' ||'|| Chr (13) | Chr (10): ' val1

    IN v_str1

    DOUBLE;

    FOR j_rec IN (SELECT DISTINCT LUNS FROM one)

    LOOP

    v_sqlstr := v_sqlstr||'||''''''''||''||''||'''''',''''''||''||''||''''''''||'||' MAX (DECODE (Lun,'|)) '''|| j_rec.Mon | " ((' |', num))';

    END LOOP;

    v_sqlstr: = v_sqlstr |' | '''|| (' ' |' val1 to a GROUP BY name, class)';

    EXECUTE IMMEDIATE v_sqlstr INTO v_restr;

    v_restr: = v_str1 | RTrim(v_restr,'||') | « ; » ;

    RETURN v_restr;

    END dyn_row_colum;

    /

    SELECT DYN_ROW_COLUM FROM dual;

    OUTPUT:-

    -------

    "NAME" | «, » ||' CLASS' | «, » ||' 10301' | «, » ||' 10302' | «, » || Chr (13) | Chr (10) | » A'||','||' SHIP '. «, » ||' 2'||','||' 3'||','|| Chr (13) | Chr (10) | » A'||','||' SELL ' | «, » ||' 2'||','||' 2'||','|| Chr (13) | Chr (10);

  • jQuery selector to go through all the rows of the table in the specific table column

    Hello

    I am in the situation when I need to disable some of the cells in a table, when the value in another cell in a table is equal to a value.

    for example, I need to disable the value of Column2, what value in the same row in Column1 = 1.

    I created the dynamic action (DA), which is triggered after the update of the region on the page.

    And now I wonder how to build the code for the dynamic action. I think jQuery is the right approach, but I've yet to find useful example. I think I need to loop through the array, check the value in the required column and disable the value reconnect with in another column if necessary.

    I created an example on apex.oracle.com.

    [www.apex.oracle.com | http://www.apex.oracle.com]
    name of user/passwd
    [email protected]/kurintest

    workspace
    kurintest

    application:
    Application 54076 - jQUery selector


    In this app. I would like to disable the second column of the table in a table (rated) what value in the first column (REGION_ID_DISPLAY) = 1 or 3.

    I want to user as identifiers table headers to avoid problems when the column will be moved to another position.

    Could someone help me in this task (perhaps very easy)?

    Thanks in advance!

    -Jiri

    Published by: Jiri n. 23 August 2012 01:31

    Hey Jiri,

    $('td[headers="REGION_NAME"] input:text')
    
    
    returns a HTMLInputElement, wheras the function addClass is a jQuery specific function.
    
    If you wrap the HTMLInputElement in a jQuery object like this:
    
    $($('td[headers="REGION_NAME"] input:text')[i]).addClass('apex_disabled');
    
    you get the desired result.
    
    regards,
    Erik-jan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    
  • display the data in row columns

    I looked through the previous posts, but it is impossible to find a solution to my problem.

    I want to display the data in row columns.
    I have shown in the table below and test data and the sql code that gives me the result desired.
    However, you can see that the sql depends of me knowing all the values in the column "rank".
    I want a way to produce the output without knowing the values of rank.
    CREATE TABLE test1 (
      accno       NUMBER,
      holder_type VARCHAR2(10),
      rank        NUMBER)
    
    INSERT INTO test1 VALUES (1, 'acr', 0);
    INSERT INTO test1 VALUES (1, 'bws', 1);
    INSERT INTO test1 VALUES (1, 'aaa', 2);
    INSERT INTO test1 VALUES (2, 'cds', 0);
    INSERT INTO test1 VALUES (2, 'xxx', 1);
    INSERT INTO test1 VALUES (3, 'fgc', 0);
    INSERT INTO test1 VALUES (4, 'hgv', 0);
    INSERT INTO test1 VALUES (4, 'bws', 1);
    INSERT INTO test1 VALUES (4, 'qas', 2);
    INSERT INTO test1 VALUES (4, 'aws', 3);
    
    Here's the required output:=
    ACCNO     ALLCODES
    1     acr bws aaa
    2     cds xxx
    3     fgc
    4     hgv bws qas aws
    
    I.E. for each accno display the holder_types in rank sequence.
    
    SELECT * FROM
    (SELECT 
           a0.accno,
           a0.holder_type || DECODE(a1.holder_type, NULL, NULL, ' ') ||
           a1.holder_type || DECODE(a2.holder_type, NULL, NULL, ' ') ||
           a2.holder_type || DECODE(a3.holder_type, NULL, NULL, ' ') ||
           a3.holder_type || DECODE(a4.holder_type, NULL, NULL, ' ') ||
           a4.holder_type allcodes
      FROM (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 0) a0,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 1) a1,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 2) a2,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 3) a3,
           (SELECT accno,
                   holder_type,
                   rank
              FROM test1
             WHERE rank = 4) a4
     WHERE a0.accno = a1.accno(+)
       AND a0.accno = a2.accno(+)
       AND a0.accno = a3.accno(+)
       AND a0.accno = a4.accno(+)) a
       ORDER BY accno

    So you're after what we call 'Aggregation in the chain.'

    Check this link as it highlights several techniques:

    Aggregation of string techniques

    A Re: Concat ranks of the values in a single column Michael

    At Re: multiple lines in a single line in the 'single column Table' followed by reason of Billy on the conduct of a stragg first.

    In addition, 11 GR 2 has the LISTAGG function.

  • How to change the rows and columns of newtabs?

    I can't change the rows and columns to mozilla version 33

    From topic: config browser.newtabpage.columns shows 5 by default, but these 5 columns appear not only 3 as before. Don't know why, but I use generally not even the default new tab page in my profile daily.

    Still works this - https://addons.mozilla.org/en-US/firefox/addon/new-tab-tools/ - extension to change the page of newTab via a user accessible interface name in the Addons, rather than routing autour Manager inside Firefox. I use this add-on in a second profile that I use for my favorite sites

  • How to save the table column and row headings

    I have a table where I activated the column and row headings.  Once the table is loaded with data, I would like to save the contents of the table, including the column and row headings in a text file.  The crux of "value" property returns only the content of the table, not the row and column headers.  I could use "header line chains []" and '[] column header chains' property nodes as well, but I'm in the island there is an easier way.  Looks like adding the headers of lines would be difficult.  Any ideas?

    Thanks in advance.

    Here is a way. The construction with the empty constant is to provide to the left corner of the table where there is no data.

  • Prepare a document to insert a row that contains the Blob column. Is what sense this correct?

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Does anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    This link shows the test I did.

    https://community.Oracle.com/thread/3680185?SR=Inbox & customTheme = OTN

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    I answered in your other thread and provided a link to the JDBC Dev Guide section, which explains how to work with type LOB and BFILE data.

    Have you read this article from doc?

    Did you read my response to your other thread?

    In java, a BLOB is just the index that gives you access to the content. In your case, you access by selecting a locator BLOB existing and getting his inputstream. This inputstream is what allows you to access the content real blob.

    The Locator is just that; It specifies the LOCATION of the blob content, but NOT the content.

  • How to write a query to return rows with the varchar column that contains even a single occurrence of the characters, such as Ÿ and

    How to write a query to return rows with the varchar column that contains even a single occurrence of the characters, such as Ÿ and

    I have a table whose columns with values such as

    MINNEAŸPOLIS and ¿VV ¿A

    Only the characters that are allowed in this column are alphabets, numbers, spaces, points and supports.

    Please help to write a SQL SELECT with Regexp_like query or any other option.

    Thanks to you all! Under query worked for me. Thank you Frank to explain the concept of hooks inside regexp_like.

    SELECT * FROM testspecial, WHERE REGEXP_LIKE (sampletext, "[^] ^ A - Z ^ a - z ^ 0-9 ^ [^.]") ^ {^} ^]') ;

Maybe you are looking for