Grant select privilege on the table column

Hello
I think that it is not possible to give the right to select level of column in a table.

by example-grant select (col1, col2) on table1 to User1;

Can anyone suggest what might be the way to achieve (apart from creating a view on the table).

Hi, Anit,

Anit says:
Hi Frank,.
Thanks for the reply. Nothing bad to see.

Then use a notice. It is simpler and more robust.

As that I knew WHAT EVP is used for the column data hide with a null value or other values. do not hide the entire column of the selection operation. Please correct me if I'm wrong.

Maksing the column with a null value or another value is hide the column.
Do what you should always do whenever you have a question. Post some sample data (CREATE TABLE and INSERT statements) and the results desired from these data. In this case, after an authorized user (that is, a user with all privileges) must get results and results that a user with lesser forge privileges.

A view (or a copy of the table, as a materialized view) is the only way I know to prevent users to know that there is a column (for example) called credit_card_num.
Use row-level security, you can return NULL when users not allowed to reference credit_card_num, or you can trigger an error if they try to refer to this column.

Tags: Database

Similar Questions

  • Grant select on all the table schema in the role

    Hi, it is possible to grant is selected on all the table on a diagram to a role?

    Yes.

    SELECT 'GRANT ALL ON' ||TABLE_NAME || ' to ROLE_NAME;' from dba_tables where owner='SCHEMA';
    
  • grant the select privilege on the table in another schema by role error

    Hello
    I have a problem with the granting of privileges to another schema
    I have A user who has only 1 system priv: connect, which has a private: create session;
    I created a role X, which I have the privilege: select on a table to a diagram B customer.
    I then conceded this X role to A user.
    I can't select * B.customers when im connected to A
    identification of information like it that I'm missing?
    Thank you
    Rgds

    >
    but whenever I put a default role, the other is automatically set to zero-defects

    How did you receive the two default roles?
    >
    By running the code I posted above as user SYS.

    Drop your user and start again and use the code I posted.

  • Select the table column group and generate a sequence number

    I have to select data from a table column group and generate a sequence for every reset of the sequence from 1 to leave.

    For example:

    Data:
    Col1 Col2 Col3 Col4
    A NA KA-2009-08-13
    B NA KA-2009-08-13
    C NA KA-2009-08-13
    A NA KA-2009-08-13
    B NA KA-2009-08-13
    A NA KA-2009-08-13

    Expected results of the Select statement:
    Col1 Col2 Col3 Col4 Seq_No
    A NA KA-2009-08-13 1
    A NA KA-2009-08-13 2
    A NA KA-2009-08-13 3
    B NA KA-2009-08-13 1
    B NA KA-2009-08-13 2
    C NA KA-2009-08-13 1

    How can it be possible with a SELECT statement? Is it possible to assign the following numbers for a group of columns and put it back when it changes? In the above example, all columns are the key to generate the seq number

    I know that this can be done using procedures stored and that is how I do it now by introducing a temporary table.

    Can someone help me with this? Please let me know if the question is too vague to understand!

    Thank you
    Nachi

    Use the row_number() analytics.

    Ravi Kumar

  • How to disable the right click option resize on the table column header?

    Hi all

    Please let us know how to disable the right click option resize on the table column header.

    The problem is that when I right click on the header of the column, the column is selected and the context menu with options like type, resize columns, columns, etc... is popping. We want to disable the option of re-size column.

    We create a link by program the values in the table (do not use Bc4J) and the version of Jdeveloper's 11.1.2.2

    Thanks in advance,

    -Vignesh S.

    So who did not observe here is that the table is wrapped in a panelCollection and who is in fact source menu.  However, the content of the context menu can be controlled through the featuresOff of the panelCollection component attribute

  • Toggle buttons control according to the selected line in the table?

    Hello

    I have used JDev 11.1.1.2.0

    On my main page, it has a query section and view the result to a component of the lookup table and also has functioning as (update/deletion) buttons in the toolbar.

    I want to toggle buttons operating according to some value of the selected line in the table, and I searched on the OTN forum, found more than issues like that, but seemed no found a good solution.

    The table is a unique and has a status column selection, its data type is integer, and I want to activate the buttons when the value of the status field of the selected line is 0 or 1, disable the buttons when the State value is other values.

    Code of the table as:

    < af:table value = "#{bindings." Var VO1.collectionModel}"="row ".
    lines = ' #{bindings. " VO1.rangeSize}.
    emptyText = "#{bindingsVO1.viewable?" '} ". No data to display. ': 'Access Denied. »} »
    fetchSize = "#{bindings." VO1.rangeSize}.
    rowBandingInterval = '0 '.
    filterModel = "#{bindings." VOCriteriaQuery.queryDescriptor}.
    queryListener = ' #{bindings. " VOCriteriaQuery.processQuery}.
    filterVisible = "true" varStatus = "vs."
    selectedRowKeys = ' #{bindings. " VO1.collectionModel.selectedRow}.
    selectionListener = "#{bindings." VO1.collectionModel.makeCurrent}.
    rowSelection = "single" id = "resId1" >

    Operation code buttons like:
    < af:commandToolbarButton text = "Update" id = "ctb2" action = "editDAF" / >

    Any suggestions would be very helpful.

    Thank you
    zeroxin

    Hello

    bind to the attribute in the PageDef file for the status field. Then configure the PartialTriggers property button to point to the ID of the table. Of the disabled button property then points to the status as attribute link

    #{bindings.statusField.inputValue == 'value'}

    Frank

  • How to get the names of the table columns in the quick dashboard

    How to get the names of the table columns in the quick dashboard


    Thanks and greetings
    ------------------------
    Kishore P

    Make a prompt like:

    SELECT case when 1 = 0 then 'D0 time. " "" T02 by month name "other" 'D2 market' '. "" M04 region' ' the end 'Sample Sales' UNION ALL SELECT case when 1 = 0 then 'D0 Time. " "" T02 by month name ' else ' 'Time D0. "" T02 by month name ' ' the end 'Sample Sales.

    Put the name of column in single quotes.

    Make your rank as a function:
    Rank ('F1 income'. "" Recipes 1-01 (after all) "by @{pColumn} {'D0 time'. ({"" T05 annually name '})

    It works fine for me

    concerning

    John

    http://obiee101.blogspot.com

  • How do I get the selected row in the table (FacesCtrlHierBinding).

    I am trying to get the data of the selected row in the table:

    RowBinding () (FacesCtrlHierBinding) tab.getSelectedRow = FacesCtrlHierBinding;
    Line rw = rowBinding.getRow ();

    But for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding be found since my 11 JDev to import.
    What is a good package for FacesCtrlHierBinding?

    Hello
    This is the code I use to get the selected rows in a rich table of adf:

        public void deleteMarkedRows()
        {
    
            RichTable table = this.getImportTable(); //get table bound to UI Table
            RowKeySet rowKeys = table.getSelectedRowKeys();
    
            Iterator selection = table.getSelectedRowKeys().iterator();
            while (selection.hasNext())
            {
                Object key = selection.next();
                table.setRowKey(key);
                Object o = table.getRowData();
                JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) o;
                Row row = rowData.getRow();
                row.remove();
            }
    
            //prepare table to show changes
            table.setFirst(0);
            RequestContext.getCurrentInstance().addPartialTarget(table);
        }
    

    Hope this helps

    Timo

  • granting of privileges to the schema for several tables at the same time... any script?

    Hello gurus,

    I have about 25 tables in the ABC scheme

    I want to give all privialges to the XYZ schema for all tables of 25 which is in the pattern ABC... So is there is SQL statement or a script, I can run to grant privileges to all tables.

    Something similar to these...

      SELECT 'create synonym ' || table_name || ' for ' || table_name
      FROM user_tables  {code}
     
    So i get all the table names ....then i can run as a script.... U r help is greatly appriciated gurus!!!
    
    
    Thank you!!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    Administrator:

    set head off
    set pages 0
    set feed off
    spool myscript.sql
    Select 'grant select, insert, update, delete on abc.'||table_name||' to xyz;'
      from dba_tables
     where owner = 'ABC';
    
    Select 'create synonym xyz.'||table_name||' for abc.'||table_name||';'
      from dba_tables
     where owner = 'ABC';
    
    spool off;
    

    Obviously this does not all new table that will be created in the future on ABC schema...

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • table col name get the details of the table column and inserting of values depending on the data type of the column

    Hello

    I am train to write a procedure where I would spend the table as a parameter name and then the code would determine it is column names, and then he would insert records in each column depending on the data type. could someone help me with this.

    Thank you

    SM

    Hello

    Perhaps you need to dummy data just for the table.

    Here is my exercise

    create or replace
    procedure generate_rows(p_table_name varchar2, p_count number)
    is
      --
      function insert_statement(p_table_name varchar2) return clob
      is
        l_columns clob;
        l_expressions clob;
        l_sql clob default
          'insert into p_table_name (l_columns) select l_expressions from dual connect by level <= :p_count';
      begin
        select
          -- l_columns
          listagg(lower(column_name), ',') within group (order by column_id),
          -- l_expressions
          listagg(
            case
            when data_type = 'DATE'
              then  'sysdate'
            when data_type like 'TIMESTAMP%'
              then  'systimestamp'
            when data_type = 'NUMBER'
              then  replace('dbms_random.value(1,max)',
                      'max', nvl(data_precision - data_scale, data_length)
                    )
            when data_type = 'VARCHAR2'
              then  replace(q'|dbms_random.string('a',data_length)|',
                      'data_length', data_length
                    )
            else
                    'NULL'
            end, ',') within group (order by column_id)
        into
          l_columns,
          l_expressions
        from user_tab_columns
        where table_name = upper(p_table_name);
        --
        l_sql := replace(replace(replace(l_sql,
          'p_table_name', p_table_name),
          'l_columns', l_columns),
          'l_expressions', l_expressions);
        -- debug
        dbms_output.put_line(l_sql);
        --
        return l_sql;
      end;
    begin
      execute immediate insert_statement(p_table_name) using p_count;
    end;
    /
    
    -- test
    create table mytable(
      id number(4,0),
      txt varchar2(10),
      tstz timestamp with time zone,
      dt date,
      xml clob
    )
    ;
    set serveroutput on
    exec generate_rows('mytable', 10);
    select id, txt from mytable
    ;
    drop procedure generate_rows
    ;
    drop table mytable purge
    ;
    
    Procedure GENERATE_ROWS compiled
    Table MYTABLE created.
    PL/SQL procedure successfully completed.
    
    insert into mytable (id,txt,tstz,dt,xml) select dbms_random.value(1,4),dbms_random.string('a',10),systimestamp,sysdate,NULL from dual connect by level <= :p_count
            ID TXT
    ---------- ----------
             3 WnSbyiZRkC
             2 UddzkhktLf
             1 zwfWigHxUp
             2 VlUMPHHotN
             3 adGCKDeokj
             3 CKAHGfuHAY
             2 pqsHrVeHwF
             3 FypZMVshxs
             3 WtbsJPHMDC
             3 TlxYoKbuWp
    
    10 rows selected
    
    Procedure GENERATE_ROWS dropped.
    Table MYTABLE dropped.
    

    and here is the vision of Tom Kyte for the same https://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:2151576678914

    Edit: to improve my code, it must use p_count as bind as Tom.

  • PPR on the table column

    JDev 11.1.1.6.0 BPM

    I have two country of components selectOneChoice and State. If I select a country from the country LOV, the corresponding States is filled through PPR. I'm in the States Get accessor check which country is selected and defining the list accordingly. It works very well. Now, I have a table in which there is a column of States for which the condition is the same. States should be a LOV and values must be filled based on the selection of countries. I used the same method of getter and PPR for the column of the table indicates which is a component of selectOneChoice. But it does not work as expected. It is not of any value.

    OK I solved it myself

    I just add a value change listener and programmatically set the partial relaxation for the table. And that did the trick

  • a list of all the tables, columns and their consntraints in the database

    Hello

    I need to write sql code which considers a list of all tables in the database, their columns and the primary or foreign key for each column (if any) and the refrence for each foreign key column.

    Any ideas how ro?

    DROP TABLE table_b;
    DROP TABLE table_a;
    --
    CREATE TABLE table_a (
     CONSTRAINT pk_table_a PRIMARY KEY (column_b)
    ,column_a INTEGER
    ,column_b INTEGER
    );
    --
    CREATE TABLE table_b (
     column_c INTEGER
    ,column_d INTEGER CONSTRAINT fk_table_a REFERENCES table_a(column_b)
    );
    --
    
    SELECT  utc.table_name
           ,utc.column_name
           ,CASE WHEN uc.constraint_type = 'P' AND position IS NOT NULL THEN uc.constraint_name END primary_key
           ,CASE WHEN uc.constraint_type = 'R' AND position IS NOT NULL THEN uc.constraint_name END foreign_key
           ,CASE WHEN uc.constraint_type = 'R' AND position IS NOT NULL THEN uc.r_constraint_name END referenced_key
    FROM    user_tab_cols utc
            LEFT JOIN user_constraints uc
              ON  (utc.table_name = uc.table_name)
            LEFT JOIN user_cons_columns ucc
              ON(ucc.table_name = utc.table_name
                   AND utc.column_name = ucc.column_name
                   AND uc.constraint_name = ucc.constraint_name)
    WHERE   utc.table_name IN ('TABLE_A','TABLE_B');
    

    TABLE_NAME COLUMN_NAME PRIMARY_KEY FOREIGN_KEY REFERENCED_KEY

    TABLE_A COLUMN_B PK_TABLE_A

    TABLE_A COLUMN_A

    TABLE_B COLUMN_D FK_TABLE_A PK_TABLE_A

    TABLE_B COLUMN_C

    If you want to 'improve' the referenced_key column for the column referenced actually, you need to join user_cons_colums once again and use the column position.

    Concerning

    Marcus

  • Grant 'select only "on the basis of data

    Hello

    10.2.0.2 Dim.

    I want to give a user with "Select any object in the database"

    Thank you
    KSG

    >
    I am also finding an alternative path to the query below. (since there are more than 100 patterns and n number of objects) ("grant select on any table of " is not a best choic)
    >
    You are the only person who can assess your security needs.

    But if you want to exercise a positive security measures do not TAKE SHORTCUTS. This means put in place restrictions known on well-known objects and not grant on a table or an object and any grants a single user or super role.

    Aman and others have already said a good security refers to the compartmentalization and a rigid hierarchy. The objective of the implementation process and standards is not to make developers work more easier or faster. Yes - do the work correctly on 100 patterns and a large number of objects in each scheme will be tedious. You can automatically generate basic subsidies and coil them to scripts. But don't try to automate the entire process from beginning to end. That will leave large enough for a bus through security holes.

    Create a hierarchy in the sense of

    1. a schema at a time
    a. purpose of subsidies - for tables, views, procedures, etc. to a role. Best is to use a separate role for each type of object
    2 grant the role of schema for users who need

    Build small pieces manageable and controllable. Then combine these pieces into a top-level component. Not just make a huge mess of subsidies.

  • grant user privileges for the execution of a procedure in a package

    Hi all

    My need is to grant privileges to User1 to run only a single procedure proc1 in package1.
    It is possible at all?
    Do I need to grant more privileges if procedure1 calls procedure2?

    Hello

    Marco wrote:
    OK, so I can create procedureN off package1 claiming enforcement procedureN package1.proc1 and grant privileges to User1.

    Is this possible without rights for package1.proc1?

    Yes, it is possible. If user_x has EXECUTE privileges on procedureN procedureN has DEFINE AUTHID (which is the default), then user_x doesn't have privileges on the packaging or the tables used in procedureN.

  • Help! multi select values in the table

    Hi gurus,

    Can anyone help me please with this.

    Scenario:
    I need to select several values based on a LOV list that is predefined.
    For selections multiple values, I tried shuttle as list manager. It is placed in a form region. After that I asked changes it redirects me to the report page.
    The column of the table displays the values selected as: person 1: No 2: 3 person

    Question:
    How can I get rid of these: and replace it with commas (,)?
    So that it looks more presentable in the table report.


    Thank you for your help.

    Hello

    If you want that he report only: just use function replace SQL ': 'to','
    example: Select Replace (column, ': ',',') table colonne_1;

    I hope this helps :D

    J :D

Maybe you are looking for