Rename two-way level replication Tables/columns / schema

I have a bidirectional 10.2 - level schema replicated configured environment. Enforcement staff feels the need to rename tables or columns. We are DDL replication.

It is: after we modify rename table, it is necessary/best practices/best practice to run DBMS_CAPTURE_ADM. PREPARE_SCHEMA_INSTANTIATION? We we cast no re-instantiation. In our lab tests, I did not saw that it had to be done, but curious if it must be done.

Mike,

You don't need to run DBMS_CAPTURE_ADM. PREPARE_SCHEMA_INSTANTIATION again after the table has been renamed or some DOF has been issued on this subject. If you rename a table, the object_id does not change. This object that spread in the target with the same object_id already has information flow existing dictionary on the site to apply it and so you do not need to rerun PREPARE_SCHEMA_INSTANTIATION on the source.

SQL > set off head
SQL > create table xx22 (x number);

Table created.

SQL > select object_id from user_objects where object_name = 'XX22;

84717

SQL > alter table rename xx22 XX33.

Modified table.

SQL > select object_id from user_objects where object_name = 'XX33. "

84717

If you add additional columns and you feel these columns must be connected supplementally then you can manually enable additional logging for these columns.

Let me know if you have any other doubts.

Thank you
Florent

Tags: Database

Similar Questions

  • Which way is the best instantiate the Table level replication tables

    Hello

    I just got a doubt. Which way is the best to instantiate the tables of replication at the Table level.
    I need 20 100 tables replicate tables.
    In this way or

    DECLARE
    ISCN NUMBER;
    BEGIN
    ISCN: = DBMS_FLASHBACK. GET_SYSTEM_CHANGE_NUMBER();
    DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
    source_object_name = > ' SCOTT. EMP',.
    source_database_name = > ' DB1. WORLD ',.
    instantiation_scn = > iscn);
    DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
    source_object_name = > ' SCOTT. DEP. ',.
    source_database_name = > ' DB1. WORLD ',.
    instantiation_scn = > iscn);
    END;
    /


    This way:

    DECLARE
    ISCN NUMBER;
    BEGIN
    ISCN: = DBMS_FLASHBACK. GET_SYSTEM_CHANGE_NUMBER();
    DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
    source_object_name = > ' SCOTT. EMP',.
    source_database_name = > ' DB1. WORLD ',.
    instantiation_scn = > iscn);
    END;
    /


    DECLARE
    ISCN NUMBER;
    BEGIN
    ISCN: = DBMS_FLASHBACK. GET_SYSTEM_CHANGE_NUMBER();
    DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
    source_object_name = > ' SCOTT. DEP. ',.
    source_database_name = > ' DB1. WORLD ',.
    instantiation_scn = > iscn);
    END;
    /


    How can I apply ISCN even or the of the ISCN individual.

    Thank you
    Ray

    Hello

    Find the RCS of the source, and set if for all tables by using the dbms_apply_adm.set_table_instantiation_scn API.

    Thank you
    Florent

  • Of many level replication table

    Hi all

    I was configuration of replication of flow between a table at many tables (3) in the same database (10.2.0.4)
    Below figure states my requirement.
    
                                        |--------->TEST2.TAB2(Destination)  
                                        |
    TEST1.TAB1(Source) ---------------->|--------->TEST3.TAB3(Destination)
                                        |
                                        |--------->TEST4.TAB4(Destination)
    Here are the steps I followed. But replication does not work.
    CREATE USER strmadmin 
    IDENTIFIED BY strmadmin
    / 
    
    GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE, DBA to strmadmin; 
    
    BEGIN 
    DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE( 
    grantee => 'strmadmin', 
    grant_privileges => true); 
    END; 
    / 
    
    check  that the streams admin is created: 
    SELECT * FROM dba_streams_administrator; 
    
    
    SELECT supplemental_log_data_min,
    supplemental_log_data_pk,
    supplemental_log_data_ui,
    supplemental_log_data_fk,
    supplemental_log_data_all FROM v$database;
    
    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
    
    alter table test1.tab1 ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
    alter table test2.tab2 ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
    alter table test3.tab3 ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
    alter table test4.tab4 ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS;
    
    conn strmadmin/strmadmin
    
    var first_scn number;
    set serveroutput on
    DECLARE  scn NUMBER;
    BEGIN
      DBMS_CAPTURE_ADM.BUILD(
             first_scn => scn);
      DBMS_OUTPUT.PUT_LINE('First SCN Value = ' || scn);
      :first_scn := scn;
    END;
    /
    
    exec dbms_capture_adm.prepare_table_instantiation(table_name=>'test1.tab1');
    
    begin
    dbms_streams_adm.set_up_queue( 
    queue_table => 'strm_tab', 
    queue_name => 'strm_q', 
    queue_user => 'strmadmin'); 
    end; 
    / 
    
    var first_scn number;
    exec :first_scn:= 2914584
    
    BEGIN
      DBMS_CAPTURE_ADM.CREATE_CAPTURE(
         queue_name         => 'strm_q',
         capture_name       => 'capture_tab1',
         rule_set_name      => NULL,
         source_database    => 'SIVIN1',
         use_database_link  => false,
         first_scn          => :first_scn,
         logfile_assignment => 'implicit');
    END;
    /
    
    BEGIN
      DBMS_STREAMS_ADM.ADD_TABLE_RULES(
         table_name         => 'test1.tab1',
         streams_type       => 'capture',
         streams_name       => 'capture_tab1',
         queue_name         => 'strm_q',
         include_dml        => true,
         include_ddl        => false,
         include_tagged_lcr => true,
         source_database    => 'SIVIN1',
         inclusion_rule     => true);
    END;
    /
    
    
    BEGIN  
      DBMS_STREAMS_ADM.ADD_TABLE_RULES(
              table_name         => 'test2.tab2',
              streams_type       => 'apply',
              streams_name       => 'apply_tab2',
              queue_name         => 'strm_q',
              include_dml        => true,
              include_ddl        => false,
              include_tagged_lcr => true,
              source_database    => 'SIVIN1',
              inclusion_rule     => true);
    END;
    /
    
    BEGIN  
      DBMS_STREAMS_ADM.ADD_TABLE_RULES(
              table_name         => 'test3.tab3',
              streams_type       => 'apply',
              streams_name       => 'apply_tab3',
              queue_name         => 'strm_q',
              include_dml        => true,
              include_ddl        => false,
              include_tagged_lcr => true,
              source_database    => 'SIVIN1',
              inclusion_rule     => true);
    END;
    /
    
    BEGIN  
      DBMS_STREAMS_ADM.ADD_TABLE_RULES(
              table_name         => 'test4.tab4',
              streams_type       => 'apply',
              streams_name       => 'apply_tab4',
              queue_name         => 'strm_q',
              include_dml        => true,
              include_ddl        => false,
              include_tagged_lcr => true,
              source_database    => 'SIVIN1',
              inclusion_rule     => true);
    END;
    /
    
    select STREAMS_NAME,
          STREAMS_TYPE,
          TABLE_OWNER,
          TABLE_NAME,
          RULE_TYPE,
          RULE_NAME
    from DBA_STREAMS_TABLE_RULES;
    
    begin  
      dbms_streams_adm.rename_table(
           rule_name       => 'TAB245' ,
           from_table_name => 'test1.tab1',
           to_table_name   => 'test2.tab2',
           step_number     => 0,
           operation       => 'add');
    end;
    /
    
    begin  
      dbms_streams_adm.rename_table(
           rule_name       => 'TAB347' ,
           from_table_name => 'test1.tab1',
           to_table_name   => 'test3.tab3',
           step_number     => 0,
           operation       => 'add');
    end;
    /
    
    begin  
      dbms_streams_adm.rename_table(
           rule_name       => 'TAB448' ,
           from_table_name => 'test1.tab1',
           to_table_name   => 'test4.tab4',
           step_number     => 0,
           operation       => 'add');
    end;
    /
    
    
    col apply_scn format 999999999999
    select dbms_flashback.get_system_change_number apply_scn from dual;
    
    begin  
      dbms_apply_adm.set_table_instantiation_scn(
      source_object_name   => 'test1.tab1',
      source_database_name => 'SIVIN1',
      instantiation_scn    => 2916093);
    end;
    /
    
    exec dbms_capture_adm.start_capture('capture_tab1');
    
    exec dbms_apply_adm.start_apply('apply_tab2');
    exec dbms_apply_adm.start_apply('apply_tab3');
    exec dbms_apply_adm.start_apply('apply_tab4');
    Could someone help me please... Please let me where I've gone wrong.

    If the steps above are not correct, then please let me know the desired measures.

    -Yasser

    First of all that I suggest to implement next to a single destination.

    Here is a good example, what I've done

    Just use it and test. Then prepare table your other schema (3 destination I mean)

    ALTER system set global_names = TRUE scope = both;

    Oracle@ULFET-laptop: / MyNewPartition/oradata/my$ mkdir Archive

    immediate stop
    Startup mount
    ALTER database archivelog
    change the database open

    ALTER SYSTEM SET log_archive_format='MY_%t_%s_%r.arc' SCOPE = spfile;

    ALTER SYSTEM SET log_archive_dest_1 = ' location = / MyNewPartition/oradata/MY/Archive MANDATORY ' SCOPE = spfile;

    # alter system set streams_pool_size = 25 M scope = both;

    create tablespace streams_tbs datafile ' / MyNewPartition/oradata/MY/streams_tbs01.dbf' size 25 M autoextend on maxsize unlimited;

    grant dba to strmadmin identified by Brooks;

    change the quota user strmadmin unlimited tablespace streams_tbs default on streams_tbs;

    exec dbms_streams_auth.grant_admin_privilege (-)
    dealer-online "strmadmin, -.
    grant_privileges-online true)

    grant dba to demo identified by demo;

    create table DEMO. EMP in select * from HR. EMPLOYEES;

    ALTER table demo.emp add the primary key constraint emp_emp_id_pk (employe_id);

    Start
    () dbms_streams_adm.set_up_queue
    queue_table-online "strmadmin.streams_queue_table."
    queue_name-online 'strmadmin.streams_queue');
    end;
    /

    SELECT name, queue_table from dba_queues where owner = 'STRMADMIN;

    set linesize 150
    Col rule_owner to a10
    Select rule_owner, streams_type, streams_name, rule_set_name, dba_streams_rules nom_regle;

    BEGIN
    () dbms_streams_adm.add_table_rules
    table-name => ' HR. EMPLOYEES,
    streams_type-online "CAPTURE."
    streams_name-online "CAPTURE_EMP."
    queue_name => ' STRMADMIN. STREAMS_QUEUE',.
    include_dml => TRUE,
    include_ddl => FALSE,
    inclusion_rule => TRUE);
    END;
    /

    Select capture_name, rule_set_name, dba_capture capture_user;

    BEGIN
    DBMS_CAPTURE_ADM. () INCLUDE_EXTRA_ATTRIBUTE
    capture_name-online "CAPTURE_EMP."
    ATTRIBUTE_NAME => "USERNAME."
    include-online true);
    END;
    /

    Select source_object_owner, source_object_name, dba_apply_instantiated_objects instantiation_scn;

    -no row returned - why?

    DECLARE
    ISCN NUMBER;
    BEGIN
    ISCN: = DBMS_FLASHBACK. GET_SYSTEM_CHANGE_nUMBER();
    DBMS_APPLY_ADM. () SET_TABLE_INSTANTIATION_SCN
    source_object_name => ' HR. EMPLOYEES,
    source_database_name-online "MY."
    instantiation_scn-online iscn);
    END;
    /

    Conn strmadmin/flow

    SET SERVEROUTPUT ON
    DECLARE
    emp_rule_name_dml VARCHAR2 (30);
    emp_rule_name_ddl VARCHAR2 (30);
    BEGIN
    DBMS_STREAMS_ADM. () ADD_TABLE_RULES
    table_name-online "hr.employees."
    streams_type-online "apply."
    streams_name-online "apply_emp."
    queue_name-online "strmadmin.streams_queue."
    include_dml to-online true.
    include_ddl-online fake,
    source_database-online "my."
    dml_rule_name-online emp_rule_name_dml,
    ddl_rule_name-online emp_rule_name_ddl);
         
    DBMS_OUTPUT. Put_line (' name of the DML rule: ' | emp_rule_name_dml);
    DBMS_OUTPUT. Put_line (' DDL rule name: ' | emp_rule_name_ddl);
    END;
    /

    BEGIN
    DBMS_APPLY_ADM. SET_PARAMETER)
    apply_name-online "apply_emp."
    parameter-online "disable_on_error."
    value => ' n ");"
    END;
    /

    SELECT a.apply_name, a.rule_set_name, r.rule_owner, r.rule_name
    Dba_apply a, dba_streams_rules r
    WHERE the a.rule_set_name = r.rule_set_name;

    -Select nom_regle value and write below - field example group16

    BEGIN
    DBMS_STREAMS_ADM. RENAME_TABLE)
    nom_regle => ' STRMADMIN. TEMPS14 ',.
    from_table_name => ' HR. EMPLOYEES,
    to_table_name => ' DEMO. EMP',.
    operation => "ADD"); -can be ADD or REMOVE
    END;
    /

    BEGIN
    DBMS_APPLY_ADM. () START_APPLY
    apply_name-online 'apply_emp');
    END;
    /

    BEGIN
    DBMS_CAPTURE_ADM. () START_CAPTURE
    capture_name-online 'capture_emp');
    END;
    /

    change user HR identified per hour;

    change the hr user account unlock;

    Conn h/h

    Insert the values of the employees
    (400, "Ilqar", "Ibrahimov', '[email protected]', '123456789', sysdate, 'ST_MAN', 0, 30000, 110, 110);

    Insert the values of the employees
    (500, 'Ulfet', 'Tanriverdiyev', '[email protected]', '123456789', sysdate, 'ST_MAN', 0, 30000, 110, 110);

    Conn demo/demo

    grant all on emp to the public;

    Select last_name, first_name from emp where employee_id = 300;

    strmadmin/streams
    Select apply_name, nom_file_attente, dba_apply;

    Select capture_name, dba_capture State;

  • Merits and demerits of the replication of schema-level and Table

    Hello

    We evaluate the streams for our needs of replication. We reproduce nearly 2000 two-way tables. Most of the tables are in a schema. The main schema has a few tables that are not replicated.

    Replicate us schema level? Or at the level of the table? What are the advantages and disadvantages?

    Replication of level schema included with a handful of exclusionary rules seems simpler.

    In water courses at the level of the tables as well as creating 2000 table rules in the beginning, add a new table to an existing configuration of streams, will require additional steps to stop capture/apply/spread, creating new rules for the new table and restart replication. However, it seems that level replication table offering flexibility in terms of group tables. We wanted to group tables about 10 groups of 20 to 300 tables in each group. Each group will have its own capture, propagate and apply. In this way, we can isolate large groups of those unimportant?

    Who is a better setup in terms of maneuverability, flexibility, parallelism and performance?

    Thank you.

    Hello Stargaze,

    OK, so I understand that the grouping is based on the type of transactions and its importance. In this case the grouping would help you in many ways such as:

    1. If you encounter a problem or a bug with one of the processes of capture/apply then the other groups would work fine. Therefore, you have the opportunity to shoot a game of capture, propagation and applies until solve you the problem.

    2. in case if you perform any load batch where the transaction will affect over 10000 + records then it is possible that you could get stuck at 'SUSPENDED for FLOW CONTROL' on any of the feed items. With different groups would give you more flexibility to solve this problem by activating and deactivating groups.

    For more information on this please check the following:

    Apply process is active, inactive, and just stopped in change application

    3. with the schema level replication even if you have the advantage of being simple and have fewer rules in the set of rules, you must consider the 2 points above before you implement it. You need to test both diagrams and tables with a typical load (simulation of the production) and need to identify potential problems in both. Some more points to consider:

    -apply the game patches 10.2.0.4 or at least 10.2.0.3
    -apply all the patches required streams (Note: 437838.1> on metalink)
    -follow the recommendations as indicated:
         Note: 418755.1 broadcast 10.2.0.x.x of recommendations
         Note: 335516.1 Performance of flow recommendations
    Note: 413353.1 10.2 best practices for streams in RAC environment

    Thank you
    Florent

  • Two-way replication in two databases in a single server

    I have two instances of installation OGG, one for each database. Let's say that they are respectively OGG1 and OGG2 for DB1 and DB2. Ogg1 has two extracts and OGG2 has 1 replicat for replication of the first. It works well independently.  OGG2 has two excerpts and OGG1 1 replicat for replication of the second, which is for the direction of backword. It also works well independently. As I got to know previously, this is how I do two-way replication, by running these two processes together. I did it.

    But when I did, it gives me the desired result. What currently happening given cannot be changed in one of the databases. When the data changes, it shows the change. but when committed, itself data is modified in its original values. What's the harm? Two processes works well independently.


    ORASCN Hi Vicky, you were the subject of this question with me. It's good if you can have a look.

    Yes, that was the problem. I added "TranLogOptions ExcludeUser ogguser" the main excerpt from two replications. ogguser is my user goldengate.

    Extract einta1q

    SETENV (ORACLE_SID = "dd")

    UserIdAlias ogg_user

    TranlogOptions IntegratedParams (max_sga_size 256)

    TranLogOptions ExcludeUser ogguser

    Exttrail ./dirdat/ip

    LOGALLSUPCOLS

    UPDATERECORDFORMAT COMPACT

    Table SC2.*;

    Now looping does not occur. Replication is as expected. Thank you.

  • Is it possible to create two-way multiselect tables? Help.

    Hey everyone (once again since you're indeed great to help me to).

    I was wondering if it would be possible to create two-way multiselect tables to interact with each other, as qlikview behavior have, because that's my goal.

    Imagine that I have 3 tables in my schema/database:

    Departments (of an HR diagram), with the following attributes: department_id (primary key), department_name, manager_id, location_id;

    Salary_by_job (created for this purpose), with the following attributes: job_id (primary key), department_id, salary, min_salary, max_salary;

    Employees (from HR diagram), with the following attributes: employe_id,..., job_id, salary, manager_id, department_id

    Would it be possible to creat multiselect two-way tables?

    Like the following:

    -I click on a Department, it shows the data relevant to this Department in the table salary_by_job and the employees table.

    And after having clicked on that, I could click on a single employee and the department table would be the same (because it's an employee in the same Department), but the salary_by_job would show only the information about the argument job_id for this employee.

    I'll try to show some text here:

    Department (selected line = 1) = Department of Public Information (which has 3 employees)

    Employees = X (with the job_id = adminargument), are (with the job_id = managerargument) and Z (with the job_id = Internargument)

    Salary_by_job = Admin, with data blah blah blah, Manager, with data blah blah blah and trainee, with data blah blah blah

    And then I have to click on the X of the employee and the result would be:

    Department (selected line = 1) = Department of Public Information (which has 3 employees)

    Employees = X (with job_id = adminargument)

    Salary_by_job = Admin, with data blah blah blah

    Can do something like this? If so, how?

    I think attached with fasteners at each table and have links to move forward and backward.

    If anyone has an idea how to do this, please respond, it may be useful.

    Thanks a lot for all the help. Have a beautiful day!

    Kind regards

    Frederico Barracha.

    BTW, I use jdeveloper 12.1.2.0.0

    Mensagem editada por: FredericoSB

    FredericoSB,

    Have you tried to add a setPropertyListener for tables and change the collectionModel to the 3rd table accordingly?

    Ex: Suppose you have three tables, Parent (VL)-> child (VL)-> grandchild. There is a relationship between the (VL) Parent-> child.

    Now, you can have links to tree for both the GrandChilds (for example GrandChildViaParent and GrandChildViaChild).

    Your jspx could be something like

    
    
    
    

    If all your tables are read-only, then you can change it to something like

    
         
    
    
         
    
    
    

    This is just a sample. You could implement the same for all properties in the table of a grandchild as EL to make editable as well.

    It comes without coding. If you care to code a little, you could use a dynamic array in place and tie the value accordingly in each of the selectionListener in the table (that would be a neat approach)

    Arun-

  • Error - ' Manager of power strategy cannot set the regime... two revision levels are incompatible "when trying to save the scheme in power options.

    Original title: cannot set a power scheme in Power Options

    Cannot set a power scheme. When I try to save the scheme, "Manager power strategy impossible to define the... two revision levels are incompatible."

    How can I fix it?

    Hi BernieHopkins,

    1 have you properly previously defined the power scheme?

    2 have you made any hardware changes or software on the computer before this problem?

    3. What is the full error message that you receive?

    If you receive the same error as mentioned in this link, you can follow this link & check if the problem persists.

    Error message: Power Manager political unable to define a strategy. Indicates two revision levels are incompatible

    Hope the helps of information.
    Please post back and we do know.

  • two-way replication

    I'm working on two-way replication between 11.2 and 12.1, can I use ogg 12.2.0.1.0 for databases of 11.2 and 12.1

    Thanks in advance

    Hello

    Yes, you can use it.

    Please check the link to the certification for Oracle GoldenGate 12.2 below. In this quest for link "configuration system required and taken platforms supported for Oracle GoldenGate 12 c (12.2.» *) ( xls) »

    http://www.Oracle.com/technetwork/middleware/IAS/downloads/fusion-certification-100350.html

    Kind regards

    Veera

  • Help with Ora-19046: Out-of-table row cannot be shared by two top-level tab

    Hello!
    My tutor asked me to store and query xml "natively" files in xml db. First, I tried to save the patterns that rely on these xml files. There are about 30 patterns thus between them, and I have to use 'FORCE' them to save, like this:

    BEGIN
    () DBMS_XMLSCHEMA.registerSchema
    "http://www.isotc211.org/gmd/metadataEntity.xsd,"
    BFILENAME ('ISOGMD', 'metadataEntity.xsd'),
    TRUE,
    TRUE,
    FAKE,
    TRUE,
    (TRUE);
    END;

    So no tables are created automatically. And when I wanted to create a XML based on patterns of thses manually, he proped error: ORA-19046: Out-of-table row cannot be shared by two top-level tab. He mistook me for a week. Does anyone know what is the problem with registration? Forward online! Thank you!

    Maybe you're missing type due to the DeffaultTable = ""-xdb:annotation "
    Try to understand it with the trace file that will be created if you set

    ALTER SESSION SET EVENTS = '31098 TRACE NAME CONTEXT FOREVER' 
    
  • Skip a level of table

    Hi, I have these 3 tables (right FKs and joins) in my Dimension product:

    CITY, SUPPLIER, PRODUCT.

    The right hierarchy should be high in leaves: City-> provider-> product

    We would like to build the hierarchy of these dimensions:

    City-> product, but we get this warning in BI Admin (and the error then in the answers)

    [39008] logical dimension CITY table has a source of the CITY who do not adhere to any source of fact.

    It cannot sail in joins, the level of the intermediate jump table?
    Are we obliged to build the whole hierarchy and spend level (and table) defining a privileged way of exploration? (this solution worked)

    Thanks in advance!

    To resolve this problem, you have two options.

    Don't forget that you have in the correct join FK relationships of physical layer between these tables as follows:

    City-<><>

    In the MDB do logical table (dimension table) with source logical table product. Now, in the source of the product logic table properties general tab add physical tables and joins (add first table beg and join product >-provider, and then add the picture of the city and join provider >-City). Now, drag - move the columns in all tables that you want to use in the levels in the dimension.

    Build the dimension with levels object and columns on each level.

    Option 1 (all three levels):

    The city level: use for drilldown checked key
    Provider level: use for the uncontrolled descent of key
    Product level: use for extraction of key checked or unchecked

    Now you can dig in the answers given by the city to the product, the intermediate level is not displayed, obiee do reach across the three tables.

    Option 2 (city and produced only in levels):

    The city level: use for drilldown checked key
    Product level: use for extraction of key checked or unchecked

    Now you can dig into the responses made by the city to the product, obiee do reach across the three tables, because you set this additional physical tables and joins in logical table product source.

    Concerning
    Goran
    http://108obiee.blogspot.com

  • Dynamic calculation of the number of days between two dates in a table

    Hello

    I'm working on request where I dynamically calculate the number of days between two dates in a table.

    The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.

    APEX version: 5.0

    Hi BO123,

    BO123 wrote:

    Hello

    I'm working on request where I dynamically calculate the number of days between two dates in a table.

    The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.

    APEX version: 5.0

    one of the way to do this by calling ajax on change of end_date.

    See the sample code given below to fetch the resulting duration and making the field read only after calculation

    Step 1: Change your page

    under CSS-> Inline, put the code below

    .row_item_disabled {
      cursor: default;
      opacity: 0.5;
      filter: alpha(opacity=50);
      pointer-events: none;
    }
    

    Step 2: Create on demand Ajax process I say CALC_DURATION

    Please check Procces Ajax, see line 6.7 How to assign a value to the variable sent by ajax call

    Declare
      p_start_date  date;
      p_end_date    date;
      p_duration number;
    Begin
      p_start_date  := to_date(apex_application.g_x01);
      p_end_date    := to_date(apex_application.g_x02);
    
       --do your calculation and assign the output to the variable p_duration
      select p_end_date - p_start_date into p_duration
        from dual;
    
      -- return calculated duration
      sys.htp.p(p_duration);
    End;
    

    Step 3: Create the javascript function

    Change your page-> the function and the declaration of the Global Variable-> put the javascript function

    You must extract the rowid in the first place, for which you want to set the time, see line 2

    assuming f06, f07 and f08 is the id of the start date, and end date columns respectively, and duration

    See no line no 8 how set the value returned by the process of ajax at the duration column

    Replace your column to the respective column identifiers in the code below

    function f_calulate_duration(pThis) {
      var row_id  = pThis.id.substr(4);
      var start_date = $('#f06_'+row_id).val();
      apex.server.process ( "CALC_DURATION", {
      x01: start_date,x02: $(pThis).val()
    }, { success: function( pData ) {
    // set duration to duration column
    $('#f08_'+row_id).val(pData);
    // disable duration column
    $("#f08_" + row_id).attr("readonly", true).addClass('row_item_disabled'); }
    });
    }
    

    Step 4: choose the end date call the javascript function

    Go to report attributes-> edit your Date column end-> column-> Attrbiutes element attributes-> put the code below

    onchange="javascript:f_calulate_duration(this);"
    


    hope this helps you,

    Kind regards

    Jitendra

  • Works with tables/columns of the lines and the parameter names... syntax help

    I am trying to create a function that returns the distinct value and counts of a user defined schema/table/column.

    The code below defines a [stats_on_column_obj] object type and creates a single table of this type [stats_on_column_tab].

    The function is supposed to take three input variables: p_schema_name, nom_table_p, p_column_name and return an array (above).

    I can hardcode a select into (the)... but once I try to convert it into settings & immediate exec I'm stuck. The red section is where the problem is (I think).

    Oracle 10g.

    Stats_on_column_obj CREATE TYPE IS OBJECT (

    COL_VAL VARCHAR2 (500),

    NUMBER OF COL_VAL_CNT (7)

    );

    CREATE TYPE Stats_on_column_tab IS TABLE OF stats_on_column_obj;


    FUNCTION to CREATE or REPLACE get_STATS_ON_COLUMN

    (

    p_schema_name IN varchar2,

    nom_table_p IN varchar2,

    p_column_name IN varchar2

    )

    RETURN STATS_ON_COLUMN_tab

    IS

    l_STATS_ON_COLUMN_tab STATS_ON_COLUMN_tab: = STATS_ON_COLUMN_tab ();

    n INTEGER: = 0;

    str_select_tbl varchar2 (5000);

    BEGIN

    str_select_tbl: = 'SELECT'. p_column_name |' as col_val, count (*) as col_val_cnt FROM ' | p_schema_name |'. ' || nom_table_p: ' group of ' | p_column_name;

    FOR r IN (str_select_tbl)

    LOOP

    l_STATS_ON_COLUMN_tab. EXTEND;

    n: = n + 1;

    l_STATS_ON_COLUMN_tab (n): = STATS_ON_COLUMN_obj (r.col_val, r.col_val_cnt);

    END LOOP;

    RETURN l_STATS_ON_COLUMN_tab;

    END;

    /

    [Error] PLS-00103 (124:4): PLS-00103: encountered the symbol "LOOP" when expecting one of the following numbers: * & - + / at rem rest mod.. < an exponent (*) > | multiset year DAY_

    [Error] PLS-00103 (126:9): PLS-00103: encountered the symbol "=" when expected in the following way: constant exception < an ID > < a between double quote delimited identifiers > double Ref table Fedya Chariot of time timestam

    [Error] PLS-00103 (127:29): PLS-00103: encountered the symbol "

    [Error] PLS-00103 (128:4): PLS-00103: encountered the symbol "END" when waiting for one of the following numbers: begin function package pragma procedure subtype type use < an ID > < a double quote delimited identifier > form

    SELECT * FROM TABLE (get_STATS_ON_COLUMN ('SCHEMAS_X', 'TABLE_X', 'COLUMN_X'));

    Scott@ORCL > CREATE OR REPLACE
    FUNCTION get_STATS_ON_COLUMN () 2
    3 p_schema_name IN varchar2,
    4 nom_table_p IN varchar2,
    5 p_column_name IN varchar2
    6                                )
    7 STATS_ON_COLUMN_tab of RETURN
    8 EAST
    9 v_STATS_ON_COLUMN_tab STATS_ON_COLUMN_tab: = STATS_ON_COLUMN_tab ();
    10 v_n INTEGER: = 0;
    11 v_str_select_tbl VARCHAR2 (5000);
    BEGIN 12
    13 v_str_select_tbl: = ' SELECT stats_on_column_obj (' | p_column_name |) ', Count OF ' |
    14 p_schema_name | '.' || nom_table_p | "Group of" | p_column_name;
    15 v_str_select_tbl EXECUTE IMMEDIATE
    COLLECTION IN BULK 16
    17 IN v_STATS_ON_COLUMN_tab;
    18 RETURN v_STATS_ON_COLUMN_tab;
    END 19;
    20.

    The function is created.

    Scott@ORCL > select *.
    2 from table)
    (3 get_STATS_ON_COLUMN)
    4                                            'SCOTT',
    5                                            'EMP',
    6                                            'JOB'
    7                                           )
    8                       )
    9.

    COL_VAL COL_VAL_CNT
    -------------------- -----------
    CLERK                          4
    SELLER 4
    PRESIDENT 1
    MANAGER 3
    ANALYST 2

    Scott@ORCL >

    Or better change function in the pipeline.

    SY.

  • Mobile table column

    I am able to add a column to a table through SQL Workshop Object Explorer. The column is added at the end of the table.

    However, I don't see any way to move the column added to a position in the table. It is possible to move a table column in the Apex, or do I have to use another tool?

    Hello

    You can't change order of column in the tables. New columns always comes last. And it's not Apex, the Oracle database operation.

    If you rearrange the columns, change the name of the table.
    Create the new table with the old order of columns name and correct.
    Insert the new renamed table table data and then drop a renamed table.

    Kind regards
    Jari

  • Any way to edit tables in Textedit or Bean?

    Hello

    I used to use LibreOffice as my preferred burning software but I have questions of sensory processing, strobe and migraines, so I need to ripheriques in order to avoid painful flashing cursors. The demo Pages and NeoOffice, OpenOffice have similar flashing cursors. TextEdit and Bean allow users to turn off blinking cursors if we used the terminal hack to change their schedule.

    Unfortunately, I can't change the tables in Textedit and the bean. I can add or delete rows and columns at the end, but not between existing lines, and I can't copy and move a block of existing lines either.

    Can anyone suggest a way to edit tables in Textedit or bean or other compatible software without flashing cursors?

    My latest project docs are odt and my next will probably be in rtf.

    Thank you!

    (display using OS X El Capitan and crossposting to accessibility because the flashing is a Visual accessibility issue, at least for me).

    Right click-> add a line above works now at the bean. Nothing like it in Textedit.

  • HP Deskjet 1050 (J410 series): unable to establish two way connection printer

    Hello

    My printer is connected to my laptop via a USB port and provides ink level readings. It will not print any documents or test pages and when I try to align/clean ink cartridges a message "Unable to establish two track with device connection".

    Can someone advise me on how to solve this problem as soon as possible? Thank you!

    Hello @West__44,

    I would like to help you today to correct the problems of two-way communication that you encounter when using the USB connected HP Deskjet 1050 all-in-One printer on your computer Windows 8.1. Because you get this error via a USB cable connection there are likely a driver or software conflicts between your HP Deskjet and your Windows computer. Can I please you follow the steps below to resolve this issue.

    • Please, unplug your USB cable from your printer and your computer before you continue.

    Step 1: Remove the driver:

    For the purposes of troubleshooting, it is essential that we have a clean slate to work with. Therefore, I will be having remove you all traces of your HP Deskjet from your computer in Windows before you run the hotfix.

    1. Open the screen, Start by selecting the Windows icon at the bottom left of your computer screen or by selecting the Windows key bottom left of your keyboard, to the right of the Ctrl key.
    2. On the start screen, type programs and features. Click on programs and features to start.
    3. Under the window programs and features will populate a list of the programs installed on your computer. Please scroll through the list and select your Printer HP Deskjet. Click Uninstall.
    4. Please follow the prompts on the screen to complete the uninstallation. Once the uninstall is complete, proceed to the next step.

    Step 2: Remove temporary files:

    1. Open the screen, Start by selecting the Windows icon at the bottom left of your computer screen or by selecting the Windows key bottom left of your keyboard, to the right of the Ctrl key.
    2. On the start screen, type run. Click on Run to launch the run dialogue box.
    3. In the run box type %temp% , and then click OK
    4. When the Temp folder opens, select Ctrl + A at the same time on your keyboard. Everything in this folder will highlight now.
    5. Select the "delete" button on your keyboard. The Temp folder contains the temporary internet files. None of the actual files or folders on your computer will be affected by deleting Temp files. A Temp file should you will automatically get the pop up to 'jump' this point.
    6. Close the Temp folder when it is empty
    7. Right-click the recycling bin on your desktop and select empty recycling bin. Please proceed to the next step.

    Step 3: Install the device:

    1. Please click here to download the package full feature software and driver for your HP Deskjet printer.
    2. Once the download is complete, follow the prompts on the screen to install your printer
    3. Do not connect the USB cable until the installation program invites you to
    4. On your laptop, please make sure that the USB cable is plugged directly from the back of your printer to the laptop. Avoid USB Extenders and home stations as they can cause conflicts of USB communication.

    Once the installation is completed successfully, please test print to confirm that the problem has been resolved.

    Please reply to this message with the result of your troubleshooting. Thanks for joining the Forums from HP Support. I can't wait to hear strings attached good luck!

Maybe you are looking for

  • I have a problem with my CALS bouncing off every day that I'm using windows Server 2003

    Thuis everything happened after that I upgraded my symantec support see below SYMulti-tier Protection has reached its end of life (EOF), that's why I quoted you on the replacement product. MC PROTECTION SUITE SMALL BUSINESS EDITION 3.0 PROMO RENEWAL

  • The failure of the Installation Windows 10

    I have an Acer V 17 Nitro Black Edition (VN7 - 791-G) I tried more than 10 times to upgrade to Windows 10. Using the application (said I was ready to be upgraded) using a USB Microsoft Media creation tool installation disc. I tried to update each tim

  • DEP maintains close my "my pictures" file before doing anything

    Now, whenever I try to open anything in my photos, data execution prevention area opens and closes the file. I tried the suggestions on this site, but it does not help. I tried to save pictues to another file, but it still happens. I can't do anythin

  • HP OFFICE JET 4630 printer: HP officejet all-in-one 4630

    Printer HP 4630 will sleep (extended) every time I have stop printing for about 10 minutes.  When I try to print a different document/photo I have to press the power button to wake it up.  I then have to close the wireless connection, and then reconn

  • HP laptop: green screen can not see the video

    Hi guys, I bought a new laptop and now all of a sudden I can't watch a video because it is a green screen. is there an obvious reason for this? Thank you, Diane