Update of the table based on another

Hello

I'm trying to update a date column in a table based on another table. There is a unique ID in each table that identifies and connects each person:
update patient_bu a set a.entry_date = (select b.entry_date from CLIENT_MED_DT b where a.id = b.id)
This is the error:

ORA-01427: einreihig subquery returns multiple rows


The problem (I think) is that the select statement back several dates for records people. There are some people / records that have multiple entry dates, but I'm only interested in the most recent date.

How can I update this table with only the most recent date?

Thanks for any help,
Matt

Oh well, I forgot the UPDATE clause:

SQL> create table patient_bu
  2  (id number
  3  ,entry_date date);

Table created.

SQL> create table client_met_dt
  2  (id number
  3  ,entry_date date);

Table created.

SQL> merge into patient_bu a
  2  using (select id
  3               ,max(entry_date) max_date
  4         from   client_met_dt
  5         group  by id
  6        ) b
  7  on    (a.id = b.id)
  8  when  matched then update
  9        set a.entry_date = b.max_date;

0 rows merged.

Tags: Database

Similar Questions

  • Choose field from the joined table based on another field?

    Hello!

    Is it possible to select a field in a row of attached table based on another field? Consider the following data in the CVALUES table:
    ID  C1   C2    C3    C4    C5    C6
    T1  9.6  10.3  12.4  19.6  19.6    0
    T7  9.6  10.4     0     0     0    0
    T3  8.2   9.9  11.4  19.6  19.6    0
    T8  8.3  10.7  13.5  20.7     0    0
    T5  9.4  10.3  12.7  22.9  19.6    0
    ...
    And the following data in the table MDETAIL:
    ID           MDATE        CNUM     ...
    T1  03/28/2012 18:00:00    4
    T1  03/28/2012 18:00:00    1
    T8  03/29/2012 06:00:00    6
    T8  03/29/2012 06:00:00    5
    ...
    I want to get the column corresponding to the VALUE field in the table MDETAIL CVALUES. I'm doing this:
    SELECT m.t1, m.mdate,
           CASE WHEN m.cnum = 1 THEN c.c1
                WHEN m.cnum = 2 THEN c.c2
                WHEN m.cnum = 3 THEN c.c3
                WHEN m.cnum = 4 THEN c.c4
                WHEN m.cnum = 5 THEN c.c5
                WHEN m.cnum = 6 THEN c.c6 END AS cvalue
      FROM mdetail m
      JOIN cvalues c ON m.id = c.id
    The CVALUES table records are unique; only one line by ID.

    This method works and it's fast, but it's messy code and I think there must be a better way to do it. I use cvalue value in several calculations so each calculation that I use is this giant glob of CASES inside!

    Hello

    With a decoding it would be easier, but as ugly :-)

    SELECT m.t1, m.mdate,
           DECODE( m.cnum , 1 , c.c1, 2, c.c2, 3, c.c3, 4, c.c4, 5, c,c5, 6, c,c6) cvalue
      FROM mdetail m, cvalues c
      WHERE m.id = c.id
    

    Success!

    FJFranken

  • best way to create a table based on another table

    Hello
    I am trying to create a table based on another table with all the data in it. It contains important data.

    create table < tablename > select * from table1.

    Is the best way to do it, or is there another way. Please advice.

    Thank you

    Insert / * + append * / in as select * from ;

    It should be->

    insert /*+ append */ into 
    select * from ;
    

    Kind regards.

    LOULOU.

  • Dynamically update list of Val, based on another selection list?

    4.2.1

    Hello world

    We have two LOVs. Both were static values. LOV1 has values static 1,2,3,4.  LOV2 has values static 10,20,30,40 and some texts. Now when the user selects 2 and 4 of LOV1, then LOV2 should display only 10 and 20.

    I know there are waterfall LOV in 4.0 from, but I think that works very well for the table based LOV query? You are not sure if they can be used for static ones? Any help or suggestions on how to do it?

    Thank you

    Ryan

    ryansun wrote:

    4.2.1

    Hello world

    We have two LOVs. Both were static values. LOV1 has values static 1,2,3,4.  LOV2 has values static 10,20,30,40 and some texts. Now when the user selects 2 and 4 of LOV1, then LOV2 should display only 10 and 20.

    I know there are waterfall LOV in 4.0 from, but I think that works very well for the table based LOV query? You are not sure if they can be used for static ones? Any help or suggestions on how to do it?

    Use the built-in support in cascade LOV by converting the static LOVs for dynamic queries, including the relevant restrictions in the WHERE clause in LOV2:

    LOV1

    select '1' lov_label, '1' lov_value from dual
    union all
    select '2', '2' from dual
    union all
    select '3', '3' from dual
    union all
    select '4', '4' from dual
    

    LOV2

    select '10' lov_label, '10' lov_value from dual
    union all
    select '20', '20' from dual
    union all
    select '30', '30' from dual where :p1_lov1 not in ('2', '4')
    union all
    select '40', '40' from dual where :p1_lov1 not in ('2', '4')
    
  • PPR for the updating of the table after a click in a butto in Jdeveloper 10.1.3 - thanks

    Hi people,

    I looked through many messages about refreshing the page, but still did not solve my problem. Please help me. It's quite URGENT.

    I have a table with a command button. After you click the data insertion is engaged and the table is supposed to be updated to reflect the changes.

    Now I use PPR as my solution: the button is the initiator and the table is the target. I put the button property: part delivery = true and its id as a partial release of the table value

    What I missed, please?

    Note: reloading of the entire page is not a solution for me. (The table is incorporated within a region of showOneTab and there are other tables in different tabs)

    Thanks in advance!

    Assuming that nothing wrong with the JavaScript syntax, the explanation might be: If you ActionListener Installer (data transaction method) and javaScript on a button-click the button, the button click javaScript will not be executed. (???)

    This is not the case. In my application, the two actions of script and java onclick button are executed. Javascript onclick fires first, then the action of the button. It should be the same for actionlistener as well.

    Regarding the updating of the table after a click of a button inside the table, you can do this by forcing the partial relaxation of the table of a bean to support using addPartialTarget.

    On the actionListener to the button call the below the backup method of bean.

    Here is the code example:

        public void btnSample_actionListener(ActionEvent actionEvent) {
           // First execute the method on the button
           BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("buttonMethod");
            Object result = operationBinding.execute();
    
            //Refresh the iterator of table and partial trigger the table
            OperationBinding operationBindingTab =
                bindings.getOperationBinding("RefreshTable");
            Object resultTab = operationBindingTab.execute();
            AdfFacesContext.getCurrentInstance().addPartialTarget(myTable);
    

    RefreshTable is an action that runs the Execute method on the table iterator.

    Thank you
    Mitesh.

  • Update the value of the column based on another value of the column to another table

    Hi all

    I have something very confused me and need your help.

    Having two tables A and B.

    Table A have 2 column (+ id + and desc1)

    Table B have column 2 also (+ transnum + and desc2)

    Now, I want to update the column desc2 of table B identical desc1 of table was where transnum of Table B same as the id of the table has.

    I use this SQL

    update of a2 set a2.desc2 = a1.desc1 of a2 on a2.transnum = a1.id inner join a1

    but this error occurs

    Error from line 5 in order:
    update of a2 set a2.desc2 = a1.desc1 of a2 on a2.transnum = a1.id inner join a1
    Error in the command line: 5 column: 35
    Error report:
    SQL error: ORA-00933: SQL not correctly completed command
    * 00933. 00000 - "command not properly ended SQL."
    * Question: *.

    * Action. *

    Hope someone can help me. TQ for help...
    SQL> create table a1 (id number(2),des varchar2(10));
    
    Table created.
    
    SQL> create table b1 (transnum number(2),des varchar2(10));
    
    Table created.
    
    SQL> insert into a1 values (1,'maran');
    
    1 row created.
    
    SQL> insert into b1 values (1,'ram');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> update b1 set des=(select des from a1 where b1.transnum=a1.id);
    
    1 row updated.
    
    SQL> select * from b1;
    
      TRANSNUM DES
    ---------- ----------
             1 maran
    
  • How to upgrade a selection one line of the table based on values in another table when there is exactly one matching entry and negligence if there is more than a football game

    Hello

    I'm trying to achieve the following objectives:

    1. in table A, select rows based on the values in column 2. something like SELECT * FROM TABLE A WHERE (COLUMN2 = 'X' or Column2 IS NULL)

    2 and these values selected, I want to update Column3 from Table A if TableA.column1 = TableB.column1, but only if there is exactly one game. If there are multiple matches, column 3 of the table article updated.

    That's what I've tried so far.

    UPDATE TABLE_A

    SET

    TABLE_A.COLUMN3 = (SELECT COLUMN3 OF TABLE_B

    WHERE ((TABLE_B.COLUMN1 = TABLE_A.COLUMN1) AND ( TABLE_B.COLUMN1 IN (SELECT Column1 FROM TABLE_B GROUP BY COLUMN1 , HAVING COUNT (*) = 1)))

    WHERE EXISTS (SELECT * FROM TABLE_A)

    WHERE ((TABLE_A.COLUMN2 = 'X' OU TABLE_A.COLUMN2 = 'Y') AND (TABLE_A.COLUMN4 IS NULL OR TABLE_A.COLUMN4 = ' ')));

    More details on my DB environment:

    Version Info:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production

    PL/SQL Release 11.2.0.4.0 - Production

    Toad, but, depending on whether the query updated all lines. I would really appreciate if someone could tell me how to fix my request.

    Thanks in advance.

    Exists it predicate in the block of update will be set to true if there is at least one row in table_a where column2 is X or Y and column4 is null or a space. You need to correlate exists it with the outer query query (I'm guessing on column1) to get the result I think you want.  However, who would update all rows in table_a who meets the criteria, there is a corresponding row in table_b, affecting Column3 lines form null not matched or not.  (Again), I'm guessing that's not your intention.  If you only want to update the lines in table_a which have a corresponding line in table_b and meet the other predicate, then I think you want something more like:

    Update table_a

    Set table_a.column3 = (select column3 of table_b

    where table_b.column1 = table_a.column1 and

    Table_B.Column1 in (select column1 from table_b

    Group by column1, having count (*) = 1))

    where ((table_a.column2 = 'X' ou))

    table_a.Column2 = 'Y') and

    (table_a.column4 is null or)

    table_a.column4 = ' ')) and

    table_a.Column1 in (select column1 from table_b

    Group by column1, having count (*) = 1)

    John

  • How update the column in the table based on the value selected in apex4.1

    Hi all
    I have the following tables,
    leave_type table,it has the following fields,
    1.emp_name,
    2.sick
    3.casual
    and it has the values as follows,
    emp_name                  sick             casual
    guru                           10                10
    mishra                         10                10
    leave_master table and it includes the following fields
    1.emp_name,
    2.leave_type
    3.no_of_days
    I have the form based on the table "leave_master"
    Here, the leave_type has the LOV which includes.
    sick and casual.

    When the form is filled out and clicked on the button submit,
    I need to update the column leave_type in table leave_type,
    for example,.
    if 
    emp_name:guru
    leave_type:sick
    no_of_days:3
    then I want to update the leave_type column,
    sick sick = - no_of_days for the 'guru' of name
    That is to say, ill = 10-3 = 7

    then the leave_type of the table must be,
    emp_name                       sick             casual
    guru                                 7                10
    mishra                              10               10
    someone can such me what code or method I can use?
    Thank you.

    Published by: Gurujothi on May 24, 2012 21:54

    Published by: Gurujothi on May 24, 2012 21:54

    Try something like this...

    BEGIN
    IF: PXX_LEAVE_TYPE = "Sick" THEN
    UPDATE LEAVE_TYPE
    THE PATIENT VALUE = SICK -: PXX_NO_OF_DAYS
    WHERE EMP_NAME =: PXX_EMP_NAME;
    ON THE OTHER
    UPDATE LEAVE_TYPE
    DEFINE CASUAL = CASUAL -: PXX_NO_OF_DAYS
    WHERE EMP_NAME =: PXX_EMP_NAME;
    END IF;
    COMMIT;
    END;

  • Get the updated record the last based on the Date and the van of the user ID corresponding (multiple tables)

    Hello people,

    I currently have a working for this using PL/SQL solution, but it would be nice to have it using SQL. Any help is appreciated and once again, to your practice time.

    I'm looking to pick up the most recent date and the corresponding user that updated registration for a student in particular. There are two tables T1 and T2. The most recent date can be the create_date or modified_date of T1 or T2.

    Scripts for creating the table and INSERT statements:

    create table T1
      ( code           varchar2(4),
        create_date    date,
        create_userid  varchar2(20),
        modified_date  date,
        modify_userid  varchar2(20));
    
    create table T2
      ( code           varchar2(4),
        visit_id       number,
        visit_date     date,
        create_date    date,
        create_userid  varchar2(20),
        modified_date  date,
        modify_userid  varchar2(20));
    
    

    insert into T1 values ('1001',to_date('06-FEB-2013 09:12:12','DD-MON-YYYY HH24:Mi:SS'),'ROGER',to_date('12-APR-2013 13:01:12','DD-MON-YYYY HH24:Mi:SS'),'BRIAN');
    insert into T2 values ('1001',1,to_date('10-JAN-2013','DD-MON-YYYY'), to_date('10-JAN-2013 14:12:12','DD-MON-YYYY HH24:Mi:SS'),'ROGER',to_date('12-MAR-2013 12:01:06','DD-MON-YYYY HH24:Mi:SS'),'AMY');
    insert into T2 values ('1001',2,to_date('31-JAN-2013','DD-MON-YYYY'), to_date('12-MAY-2013 16:11:12','DD-MON-YYYY HH24:Mi:SS'),'GRACIE',null,null);
    
    insert into T1 values ('1002',to_date('12-JAN-2013 11:12:13','DD-MON-YYYY HH24:Mi:SS'),'LYNNELLE',to_date('12-APR-2013 13:01:12','DD-MON-YYYY HH24:Mi:SS'),'BRIAN');
    insert into T2 values ('1002',1,to_date('10-JAN-2012','DD-MON-YYYY'), to_date('10-JAN-2012 09:12:12','DD-MON-YYYY HH24:Mi:SS'),'ROGER',to_date('12-APR-2013 13:04:12','DD-MON-YYYY HH24:Mi:SS'),'AMY');
    insert into T2 values ('1002',2,to_date('10-JAN-2013','DD-MON-YYYY'), to_date('12-JAN-2013 11:12:13','DD-MON-YYYY HH24:Mi:SS'),'JOHN',null,null);
    
    insert into T1 values ('1003', to_date('04-FEB-2014 12:01:01', 'DD-MON-YYYY HH24:Mi:SS'), 'LYNNELLE', null, null);
    
    

    I want to show for the three codes are the following records:

    Code      Table Date                              User ID
    1001      T2  12-MAY-2013 16:11:12   GRACIE
    1002      T2 12-APR-2013 13:04:12   AMY
    1003 T1 04-FEB-2014 12:01:01 LYNNELLE
    
    

    1001 students, the most recent is the create_date of the visit count = 2 for the Code 1002, the most recent date comes from modified_date for visit 1 (its 3 seconds later than the T1 modified_date). Finally, for students 1003 (who did not all records in T2, the create_date is the only date and must be picked up.

    Thanks in advance.

    with t as)

    Select the code,

    NVL (MODIFIED_DATE, create_date) dt.

    case nvl (modified_date, create_date)

    When modified_date then modify_userid

    of other create_userid

    end userid,

    Tbl "T1".

    from t1

    Union of all the

    Select the code,

    NVL (MODIFIED_DATE, create_date) dt.

    case nvl (modified_date, create_date)

    When modified_date then modify_userid

    of other create_userid

    end userid,

    Tbl 'T2 '.

    the t2

    )

    Select the code,

    Max (TBL) keep (dense_rank last order by dt, tbl) tbl.

    Max (DT) dt,

    Max (UserID) keep (dense_rank last order by dt, tbl) userid

    t

    Code group

    order by code

    /

    CODE TO DT USERID
    ---- -- -------------------- --------------------
    1001 T2 MAY 12, 2013 16:11:12 GRACIE
    1002 T2 12 APRIL 2013 13:04:12 AMY
    1003 T1 4 FEBRUARY 2014 12:01:01 MANON

    SQL >

    SY.

  • Update of the collection based on (wwv_flow.g_f01) report

    Hi all
    I have a page in my application that contains 3 standard reports based in a collection. There is a main report and from there you explore the other report, and from there you can go down to another (3rd report) that I'm trying to update a member of the collection based on an lov. I don't know how to insert the value from the lov in the 3rd report.


    Select seq_id
    IN CURR_SEQ_ID
    of apex_collections
    where collection_name = "ARGYLL_INVOICES."
    and c001 | C002 =: P12_EPSB_JE_HEAD_LINE_NUM;

    apex_collection.update_member_attribute (p_collection_name = > 'ARGYLL_INVOICES',)
    p_seq = > CURR_SEQ_ID p_attr_number = > 17, p_attr_value = > "EDMO");

    It works fine, but of course, it is hard coded. I would use the api wwv_flow.g_f01 but I can't make it work with my rudimentary understanding of this api call.

    apex_collection.update_member_attribute (p_collection_name = > 'ARGYLL_INVOICES',)
    p_seq = > CURR_SEQ_ID p_attr_number = > 17, p_attr_value = > wwv_flow.g_f01 (a few references here);


    Any guidance would be most appreciated.

    Thank you

    Here is an excerpt from a quick tutorial on the use of collections. I'm including the section of the report you can see the corresponding values:

    SELECT rownum, apex_item.hidden(1, c001),  --Key ID
         apex_item.text(2, c002, 8, 8) VALUE1,
         apex_item.text(3, c003, 3, 3) VALUE2,
         apex_item.text(4, c004, 8, 8) VALUE3,
         apex_item.date_popup(5, null,c005,'MMDDYYYY',10,10) MY_DATE
    FROM APEX_COLLECTIONS
    WHERE COLLECTION_NAME = 'MY_COLLECTION'
    

    It will be a report as a SQL report - you are just pulling the data from the collection. You can always ask the nice formatting, naming, sorting, etc. of a standard report. In the report, the user will have 3 values 'text' and a Date with the date picker. You can change the format, make sure just to change all four procedures.

    What is critical to note here are the numbers that come just before the column names. These numbers become identifier in the table used to capture data. What is APEX is creates an array of up to 50 items designated as F01 - F50. The F is static, but the number that follows, it matches the number on your tax report above, IE, F01 will contain the primary key value, F02 will contain the first numeric value, etc.. Although not strictly necessary, it is advisable to assign these values so you don't have to guess.

    A note more: I try to align c00x values in the column with the values of F0X collection in the table to stand straight, but they are values that do NOT have to match. If you have a request that you think could get developed, you can leave gaps where you want. Remember, however, that you have only 50 columns of table to use for the data entry. It is the limit of F0X table even if a collection can have up to 1000 values.

    Now, you need a way to capture the user input. I like to create this as a PRELIMINARY procedure CALCULATIONS/VALIDATIONS in this way the user can see what they changed (even if it is false). Use Validations to intercept errors.

    declare
      j pls_integer := 0;
    begin
    for j1 in (
      select seq_id from apex_collections
      where collection_name = 'MY_COLLECTION'
      order by seq_id) loop
      j := j+1;
      --VAL1 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>2,p_attr_value=>wwv_flow.g_f02(j));
      --VAL2 (number)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>3,p_attr_value=>wwv_flow.g_f03(j));
      --VAL3 (text)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>4,p_attr_value=>wwv_flow.g_f04(j));
      --VAL4 (Date)
      apex_collection.update_member_attribute (p_collection_name=> 'MY_COLLECTION',
          p_seq=> j1.seq_id,p_attr_number =>5,p_attr_value=>wwv_flow.g_f05(j));
    end loop;
    end;
    

    Clear as mud? Walk slowly through it. The syntax tells APEX Collection (p_collection_name) (p_seq) line, then what attribute/column (p_attr_number) updated with the value (wwv_flow.g_f0X (j)). The number of the attribute is the column number of the collection without the 'c' on the front (IE c004 in the collection = attribute 4).

    See if this helps answer the question. You'll notice that I'm grabbing values SEQ_ID of the collection and a loop through them one at a time and using them to find the index of the JavaScript array holding the corresponding value, I need to use in the update part.

  • Build/update dynamically the table 3D

    Hi all

    I'm having a problem with the dynamic generation of a 3D of the following set of data table:

    x: {1,2,3,4,5}

    y: {1,2,3,4,5}

    Z_1: {1,2,3,4,5}

    Z_2: {1,2,3,4,5}

    Z_3: {1,2,3,4,5}

    Z_4: {1,2,3,4,5}

    Z_5: {1,2,3,4,5}

    where there is (5) Z amplitudes associated with each measurement location.  What I am able to statically (from the above values x and y tables 1 d and 2D table Z) is to create a 3D Board made up of x and is indexed intensity to the graphic format of the 2D tables.  Each page of the table corresponds to each of the 5 Z amplitudes measured at each location.  In the attached VI, the Array Build function works perfectly for the static case where the entire data is available.  I followed the example of a another discussion forum will be subject to the provisions of nest two loops construction 2D array in the inner loop and incrementing the pages on the outer loop. The static situation is resolved.

    However, my goal is to graphically present data he is taken, point by point, to the user.  The other attached VI simulates this scenario, incrementation of x and y positions based on the measure button.  Z matrix indicator shows that the 2D Array (each individual page) is in the proper format.  The construction of the 3D picture is dynamically where I'm having problems.  I tried to build table and replace a subset of table, but none of these functions to produce the desired result.

    In the case of building table, 3D table is correctly based on the first measure: for x = y = 1, 2D array page0 is set Z_1 in position (1,1), page1 has the Z_2 value in the position (1,1), page2 Z_3, etc..  However, on the second measure, as expected, the berries are concatenated page5 have Z_1 values in the (1,1) and (2,2) positions.  This result is properly formatted, however, should the counted array 3D page is limited to 5 (page0, 1, 2, 3, 4).  So ideally, page5 should in this case replace page0.  So build array results in the correct format but concatenation is not desirable.

    The subset of spare board was made with the index of the page (outside of the loop) number to specify the subset of the 3D Board needs to be replaced.  The result was an empty 3D array.

    Thank you any help to solve this problem.

    kmsk wrote:

    Any suggestions on how to handle filling out table 3D of unknown size?

    If the size of the final table has a reasonable upper limit, you can initialize an array of slightly oversized, then keep using the subset of the table replace. It will be much faster and more effective memory than gradually more and more large networks.

    When the purchase is made, you can cut to the final size.

    Aircraft add to a table 3D using 'insert into array' or 'Build array' (favorite?), cause memory frequent shifts and might slow down your code by orders of magnitude in casing of excessive fragmentation of memory.

  • [ADF, JDev12.1.3] af:table - how to select by program level 1 (on the updating of the table)?

    Hallo,

    I have an af:table that displays the result of a custom search form.

    I need to update the properties of some of the buttons every time that a row in the table is selected.

    I would like to handle this in a SelectionListener I associated with the table.

    public void myTableSelectionListener(SelectionEvent selectionEvent) {
      ELUtils.invokeEL("#{bindings.SearchEmployee1.collectionModel.makeCurrent}",
                       new Class[] { SelectionEvent.class },
                       new Object[] { selectionEvent });
      Row selectedRow = (Row) ELUtils.evaluateEL("#{bindings.SearchEmployees1Iterator.currentRow}");
      System.out.println(selectedRow.getAttribute("Name") + " - " + selectedRow.getAttribute("Surname"));
    }
    
    

    I noticed the System.out.println prints the values of the selected line only when the user clicks on a line while that no value does print when the grid is recharged after clicking the search button.

    To resolve this problem, I guess I need to select by program level 1 in the table whenever the grid is charged, but I have not found a working method to do this.

    You kindly explain how to select by program level 1 of an af:table?

    Thank you

    Federico

    Hi Federico
    only for research you can handle this in your action of the search button (because your selection listener code works for another action), after research get the current row of your table (it would be the first rows) and run your code

    If you are using af:query, then override default query listener to run custom code

    See -Ashish Awasthi (Jdev/ADF) Blog: the substitution of the listener default query, validation in the field of af: query-Oracle ADF

    Thank you

  • How to share data in the tables ' User_ * ' with another schema

    I want to share the data in the table WHERE USER_SEGMENTS with another schema. If I create a view and grant select on the view, when the other schema queries the view data are identical to themselves querying the SYS.user_segments table directly.
    create view sys_user_segments as select * from sys.user_segments;
    grant select on sys_user_segments to A;
    My guess is that the SYS.user_segments table is a view based on the current user.

    Is there a way to share such data without creating a copy of the table?

    Oracle: 10g

    Thank you

    If the ADMINISTRATOR is concerned about B access to DBA_SEGMENTS (or by creating DBA_SEGMENTS views that belongs to a user who has access on top and then grant access to this view of B), it seems pretty crazy allow that kind of database connection.

    If you create a database link belonged to B that connects to A, B is, in substance, given any privilege that has exercises. But it is done in a very, very dark which will no doubt be neglected in the future when someone gets a check. He'll be sitting here to wait that someone (accidentally or intentionally) Decides to exploit the security hole and do something that is causing a problem (by removing all data from a table, grabbing all the sensitive data in a table, etc.). Risks of this almost certainly far, far* far * outweigh the risks of even leaving B to obtain direct access to DBA_SEGMENTS.

    Justin

  • Default value for the prompt based on another request

    Hello:

    I have a requirement where I need to define default values of messages based on another request.

    The guest is a quick Date.

    I have tried using the presentation variable and sql query writing, where is written "WHERE promo_id = @{variable}" "

    but it still does not.

    Please let me know a workaround for this problem.

    Thank you.

    -Vinay

    What determined your operator BETWEEN End Date? I guess it's variable. In addition, is the second report on the same page or another page of dashboard? Assuming that the two reports are on the same page, do the below. If this isn't the case, you can use the same guests on the second page of dashboard. Define the scope of "dashboard" and the selection of the user is wearing on the second page.

    The easiest way is to have 3 guests of dashboard: Promo_ID, Start_Dt and end_date. assign to these guests PVs: pvPromoID, pvStartDate and pvEndDate, respectively.

    Filter a report on pvPromoID and pvStartDate.

    The second report on the pvPromoID of the filter and use pvStartDate in the filter of the two report Date column. Assuming that the values BETWEEN are variable, so you can write the following on the column of your second report:

    "Table name". " Date ColumnName.<= '@{pvstartdate}'="" and="" table="" name"."date="" column="" name"=""><>

    And your Promo column, use the filter "Table name". "Class = ' @{pvPromoID}"

    When the user selects the Promo ID, Start Date and end Date in the guests, the first and second reports will be filtered accordingly.

  • Name of the dynamic property of object in the table based on the value of a variable

    I have two paintings of custom class objects

    var obj1:Object1
    var obj2:Object2
    
    var array1:Array = [obj1[0], obj1[1], ...]
    var array2:Array = [obj2[0], obj2[1], ...]
    

    Object1 has a property named. Name while Object2 has a property named. Title.

    Now I have a common function including cab accepts an array (array1 or array2) and the name of property the object ("Name" or "Title") as input and needs to access this name of the property of the objects in the array:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0].fieldName  = "xxx";
    }
    

    the problem I have this achievement does not because the code in the function assumes that the property of that object in the table is actually a string "fieldName" while I want to dynamically determine the names of the fields based on the value of this variable, but cannot understand the syntax to do!

    Don't know if I'm clear - hope that makes sense... ;-) Thank you

    Hey p3pp3r,

    I think I understood you. Try the following and see if you get good results:

    function myFunction(arr:Array, fieldName:String)
    {
        arr[0][fieldName]  = "xxx";
    }
    

    Let me know how it turns out. Good luck!

Maybe you are looking for

  • Why the controls Spyware Blaster to disabled Firefox, when the controls MSIE and blocked sites remain activated

    Used Spyware Blaster for about 5-6 years to control software malicious manipulation of Internet EXPLORER, Firefox and block certain websites w 100% success, now all of a sudden when I check status see the Firefox control being disabled/re-enabled to

  • IMAQ color image scale

    Hello I am trying to trace an image using a table 2D-data using IMAQ points. Creating a grayscale image is fairly simple, but is it possible to display the image as a spectral color image? i.e. Red corresponds to higher values, of the lowest and gree

  • How to set the size of the frame in the controls of decoration

    Hello I paint frames or boxes using the templates in the control of "Décorations" in labview. Is there another way to set the size of the frames or boxes rather than drag? also, how can I change the color of the borders? Thank you Joyce

  • 80244019 MS VISTA UPDATE FAILURE?

    MS Vista UPDATES failed, for the past few weeks, when I check (automatic updates turned off). Same error code 80244019 shows. The clues, please?

  • For Inspiron One 23 wireless speakers?

    I have the Inspiron One 2350 ('Inspiron One 23"on Dell.com).  I am looking to upgrade the low volume instead, tinny speakers on a machine also very nice.  I have my eyes on Dell Wireless Speaker System AC411, but the product page has a list of "compa