How to plan the CREATE statement (not MERGER-edit) without start/end of PL/SQL

I have dozens of instructions MERGE (also Create and Drop statements) that I want to run every morning.
I can do without this help:
1. the windows task scheduler (I don't like having to change my password) or relying on my machine to run at midnight
2 convert the "Execute Immediate" instructions statements within a PL/SQL block?

Ideally, I would like to put in place a procedure, but can't seem to find away around doing without the begin/end blocks.

We are running Oracle 10 g.

Thank you
Jason

Published by: Jason_S on Sep 2, 2011 10:42

Jason:

It looks like a GTT would be ideal for this. Non-recurring Yes:

CREATE GLOBAL TEMPORARY TABLE f_pi_sequ_list (
  pi_seq   )
  On commit delete rows;

Then, your script would become:

INSERT INTO f_pi_sequ_list
SELECT pp_pi_sequ AS pi_sequ
FROM f_pat_present
WHERE pp_sequ >= &min_pp_sequ AND
      pp_sequ <= &max_pp_sequ
GROUP BY pp_pi_sequ;

MERGE INTO f_patient_index dst
USING  (SELECT * FROM f_patient_index@REDC
        WHERE pi_sequ IN (SELECT pi_sequ FROM f_pi_sequ_list)) src
ON     (DST.PI_SEQU = SRC.PI_SEQU)
WHEN MATCHED THEN UPDATE
SET     big long list
WHEN NOT MATCHED THEN
INSERT big long list
VALUES big long list;

COMMIT;

I doubt that the indexes on the table of the single column contributes everything, so you could probably do without it.

After validation, the TWG will be empty, so the next time you need to use it, simply to make the insertion. If you will use the same list of values in the other queries as part of your script, change delete lines to preserve the lines, then the data will remain as long your session is active, or that you explicitly remove the lines.

John

Tags: Database

Similar Questions

  • How to change the key combination to merge again layer (Ctrl alt shift e)?

    How to change the key combination to merge again layer (Ctrl alt shift e)?

    I have not found it in keyboard shortcuts.

    You could make an action to a key to assign a F as a work-around

  • How to plan the propagation process and/or application

    Hi all

    Is it possible to predict the spread and application during the Oracle Streams configuration?, I mean, I don't want to run replication online because I have other object outside the Oracle who need to reproduce within the db to get my aplication (red only) in sync.

    So, when I can do? Here is an example of process apply and spread:

    BEGIN
    DBMS_STREAMS_ADM. () ADD_SCHEMA_RULES
    schema_name = > 'shm '.
    streams_type = > 'apply ',.
    streams_name = > 'apply_from_db1 ',.
    queue_name = > "strmadmin.from_db1"
    include_dml = > true,
    include_ddl = > true,
    source_database = > "db1.world"
    inclusion_rule = > true);
    END;
    /

    .....

    BEGIN
    DBMS_STREAMS_ADM. () ADD_SCHEMA_PROPAGATION_RULES
    schema_name = > 'shm '.
    streams_name = > 'db1_to_db2 ',.
    source_queue_name = > 'strmadmin.captured_db1 ',.
    destination_queue_name = > '[email protected] ',.
    include_dml = > true,
    include_ddl = > true,
    source_database = > "db1.world"
    inclusion_rule = > true,
    queue_to_queue = > true);
    END;
    /

    Perhaps, am I is not clear to my question, or maybe I do everything in the bad sense on propagation processes and the workflow application.

    So, I looked in all the documents available and I can't find how to plan the process... What is the part that I am missundertanding?

    As long I have it other non Oracle objects (system files objects, we say that some objects in ECM file system related with data) to replicate with the data schema, I can't replicate any changes to the schema of the source table to the schema database of fate (automatically). So, I'm replicated ECM file systems objects in other external tool (with build-in Windows Calendar integration)... but how I can program spread and/or application treats in the middle of stream 2-way?

    Please, I need a hint of someone as soon as possible.

    Thanks in advance.

    Your question is not very clear, so here's what you need to know abot schedules DBMS_STREAMS_ADM and spread:

    The schedule is done automatically when you add the spread with DBMS_STREAMS_ADM.
    This API DBMS_STREAMS_ADM encompass several other APIs:

    -DBMS_CAPTURE_ADM,
    -DBMS_RULE_ADM
    -DBMS_APPLY_ADM
    -DBMS_PROPAGATION_ADM.
    -DBMS_AQ_ADM

    This DBMS_STREAMS_ADM is supposed to make things easier, but it takes an important definition default values, so that you see all the actions that are performed as they are done quietly behind the scenes.
    The establishment of the regular spread is on of these silent setting and the time that occurs with a never ending cycle to wake up/run/sleep.
    The duration of sleep between 2 execution is defined by DBA_QUEUE_SCHEDULES. LATENCY

    From the spread itself, it's a job. When the next execution is set to null, he reschedule itself, like an endless loop.
    Here's how the job will appear:

    set embedded on
    set heading on
    set feedback off
    set linesize 162 pagesize 0
    col fail format 999  heading 'Errs'
    col broken   format a3   heading 'Bro|ken'
    
    col sess format 9999   heading 'Ses'
    col jid  format 999999  heading 'Job|Id'
    col subu format a10  heading 'Submitter'     trunc
    col secd format a10  heading 'Security'      trunc
    col proc format a30  heading 'Job'           word_wrapped
    col lsd  format a10  heading 'Last|Ok|Date'
    col lst  format a5   heading 'Last|Ok|Time'
    col nrd  format a10  heading 'This|Run|Date'
    col nrt  format a5   heading 'This|Run|Time'
    col fail format 99 heading 'Err'
    
    col proc format a50  heading 'Job'           word_wrapped
    col secd format a10  heading 'Security'      trunc
    
    select job jid, log_user  subu,   priv_user                  secd,    what proc,
                  to_char(last_date,'DD/MM/YYYY') lsd,
                  substr(last_sec,1,5)            lst,
                  to_char(next_date,'DD/MM/YYYY') nrd,
                  substr(next_sec,1,5)            nrt,
                  failures                        fail,
                  decode(broken,'Y','Y','N')      Broken
    from sys.dba_jobs;
    prompt
    
                                                                                     Last       Last  This       This
        Job                                                                          Ok         Ok    Run        Run       Bro
         Id Submitter  Security   Job                                                Date       Time  Date       Time  Err ken
    ------- ---------- ---------- -------------------------------------------------- ---------- ----- ---------- ----- --- ---
         55 SYS        SYS        next_date := sys.dbms_aqadm.aq$_propaq(job);                        27/11/2009 16:19     N
    

    Now, this work is performed in a session, always the same, which performs the actual transfer of waiting by using the global name DB link to target the area. You can check which session with the following queries:

    set linesize 125
    prompt
    set linesize 150
    col queue_name HEADING 'Source|Queue Name'
    col queue_schema HEADING 'Source|Queue Owner'
    col dblink format a34 head 'Destination|Database Link'
    COLUMN SCHEDULE_STATUS HEADING 'Schedule Status' FORMAT A23
    COLUMN PROPAGATION_NAME Heading 'Propagation|Name' format a25 wrap
    COLUMN START_DATE HEADING 'Expected |Start Date'
    COLUMN PROPAGATION_WINDOW HEADING 'Duration|in Seconds' FORMAT 9999999999999999
    COLUMN NEXT_TIME HEADING 'Next|Time' FORMAT A8
    COLUMN LATENCY HEADING 'Latency|in Seconds' FORMAT 9999999999
    COLUMN SCHEDULE_DISABLED HEADING 'Status' FORMAT A8
    COLUMN PROCESS_NAME HEADING 'Schedule|Process|Name' FORMAT A8
    COLUMN FAILURES HEADING 'Number of|Failures' FORMAT 99
    COLUMN LAST_ERROR_MSG HEADING 'Error Message' FORMAT A55
    COLUMN TOTAL_BYTES HEADING 'Total Bytes|Propagated' FORMAT 9999999999999999
    COLUMN CURRENT_START_DATE HEADING 'Current|Start' FORMAT A17
    COLUMN LAST_RUN_DATE HEADING 'Last|Run' FORMAT A17
    COLUMN NEXT_RUN_DATE HEADING 'Next|Run' FORMAT A17
    COLUMN LAST_ERROR_DATE HEADING 'Last|Error Date' FORMAT A17
    COLUMN LAST_ERROR_TIME HEADING 'Last|Error time' FORMAT A12
    column message_delivery_mode HEADING 'Message|Delivery|Mode'
    column queue_to_queue HEADING 'Q-2-Q'
    col destination format a50
    col sid for a4
    col tot_k for 999999999999 head 'Total |Sent (Kb)' justify L
    
    prompt
    prompt When the duration is NULL, the propagation is active
    prompt When the next time is NULL, the propagation job is currently running
    prompt
    
    SELECT substr(session_id, 0, instr(session_id,',')-1) sid ,
           p.propagation_name,TO_CHAR(s.START_DATE, 'HH24:MI:SS MM/DD/YY') START_DATE,
           s.PROPAGATION_WINDOW, s.NEXT_TIME, s.LATENCY,
           DECODE(s.SCHEDULE_DISABLED, 'Y', 'Disabled', 'N', 'Enabled') SCHEDULE_DISABLED,
           (select value/1024  from v$sesstat x, v$statname y
                    where  x.STATISTIC# = y.STATISTIC# and y.name = 'bytes sent via SQL*Net to dblink'
                       and x.sid=substr(session_id, 0, instr(session_id,',')-1) ) tot_k
      FROM
          DBA_QUEUE_SCHEDULES s,
          DBA_PROPAGATION p
      WHERE  p.DESTINATION_DBLINK = NVL(REGEXP_SUBSTR(s.destination, '[^@]+', 1, 2), s.destination)
             AND s.SCHEMA = p.SOURCE_QUEUE_OWNER
             AND s.QNAME = p.SOURCE_QUEUE_NAME
             and s.message_delivery_mode='BUFFERED'  and session_id is not null
      order by  propagation_name ;
    
    select p.propagation_name, s.message_delivery_mode,
           s.FAILURES,
           p.queue_to_queue,
           s.LAST_ERROR_MSG
      FROM
            DBA_QUEUE_SCHEDULES s,
            DBA_PROPAGATION p
      WHERE
             p.DESTINATION_DBLINK = NVL(REGEXP_SUBSTR(s.destination, '[^@]+', 1, 2), s.destination)
         AND s.SCHEMA = p.SOURCE_QUEUE_OWNER
         AND s.QNAME  = p.SOURCE_QUEUE_NAME
      order by propagation_name,s.message_delivery_mode ;
    
    SELECT p.propagation_name,  TO_CHAR(s.LAST_RUN_DATE, 'HH24:MI:SS MM/DD/YY') LAST_RUN_DATE,
       TO_CHAR(s.CURRENT_START_DATE, 'HH24:MI:SS MM/DD/YY') CURRENT_START_DATE,
       TO_CHAR(s.NEXT_RUN_DATE, 'HH24:MI:SS MM/DD/YY') NEXT_RUN_DATE,
       TO_CHAR(s.LAST_ERROR_DATE, 'HH24:MI:SS MM/DD/YY') LAST_ERROR_DATE,
       LAST_ERROR_TIME
      FROM DBA_QUEUE_SCHEDULES s, DBA_PROPAGATION p
        WHERE   p.DESTINATION_DBLINK =
            NVL(REGEXP_SUBSTR(s.destination, '[^@]+', 1, 2), s.destination)
      AND s.SCHEMA = p.SOURCE_QUEUE_OWNER
      AND s.QNAME = p.SOURCE_QUEUE_NAME order by  propagation_name;
    

    If you want to change the lag time, you can use this:

    -- adapt following your needs, defineds $prop (propagation name)  and $latency (value in secs, usually 1 or 3 or 5) :
    
    col DESTINATION_QUEUE_NAME new_value DESTINATION_QUEUE_NAME noprint
    col DESTINATION_DBLINK new_value DESTINATION_DBLINK noprint
    col source_queue_name new_value source_queue_name noprint
    
     select SOURCE_QUEUE_NAME, DESTINATION_QUEUE_NAME, DESTINATION_DBLINK from SYS.DBA_PROPAGATION  where propagation_name = upper('$fprop');
     set serveroutput on size 9999
      col cmd new_value cmd noprint
      execute DBMS_AQADM.ALTER_PROPAGATION_SCHEDULE( queue_name => 'STRMADMIN.&source_queue_name',  destination =>'&DESTINATION_DBLINK',  destination_queue=>'&DESTINATION_QUEUE_NAME',  latency=>$latency, duration=>null, next_time=>null) ;
    
  • What does the Create action not?

    Hello

    I use JDeveloper 10.1.3.4 and you have questions about the action Create {color} {color: blue}.

    I have a data table named USERS and a corresponding VO in the data control palette. Drag and drop the original Version of users to the page as a table with the column of enabled selection, I let the user be able both to delete a selected line and create a new line.

    I'm new to this, but for deletion, there is no problem: drag the delete action under the control of data users VO and drop it into the table {color: green} > table facets > Selection > af:tableSelectOne - Select and node {color}, then drop the request module commit an act on the page also as a commandButton control. And the selected line can be deleted and committed deletion using these two new buttons.

    Similarly, I dragged the action Create {color} {color: blue} and he fell in the table {color: green} > table facets > footer node {color} like a command button. When the page is running, nothing is visibly when you click on the button create {color} of {color: blue}. I understand that you do not select a line to create a new line, so I did not put the button create in the same node with the button Delete. And I guess I'll have to create a separate page for the user to enter the values in the fields on the line must be created.

    What I want to know, what's this button with the action {color: blue} create {color} inside is different than a generic commandButton created from the ADF Faces Core > commandButton? If I create a commandButton control in the component palette that is empty inside. But by using the action of creation as a commandButton control, is not yet clear to me that creating would make the action inside the key. On the other hand, there must be a reason for the {color: blue} action Create {color} be there slot that VO in the range of control data for us to use. What is the reason? And that makes the action Create {color} {color: Blue}?

    Thanks for answering my question!


    Newman

    Hello Newman,

    If you want your new line to be available in the whole of current lines (for example to edit directly in the table, not on a form), then take a look on the CreateInsert operation. Otherwise, you need a form to edit the new line.

    Check out these links:
    [13.6 creating an entry form: http://download.oracle.com/docs/cd/B32110_01/web.1013/b25947/web_form.htm#CACECCJA] in the dev guide
    [10.4 how to add a button create on a Page | http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/bcdcpal004.htm#sthref820] in the dev guide
    [New line using operation CreateInsert | http://andrejusb.blogspot.com/2006/12/creating-new-row-using-createinsert.html] in Blog of Andrejus Baranovskis

    What I want to know is how this button with the create action that it is different than a generic commandButton created from the ADF Faces Core > commandButton?

    When you create a button for the create action, your page links are configured automatically, then a link to action to create a to-do from the iterator is added to your pageDef (and this iterator is bound to your view object).

    And what is the Create action not?

    The create action creates a new line but does not insert it in the whole of lines.

    Kind regards
    Patrik

  • How to change the angle of a gradient layer without changing anything else?

    How to change the angle of a gradient layer without changing anything else?

    When I try it myself my gradient everything turns black.

    To add to the above, you can just set the angle. If you want to use other existing parameters, you need to get from the layer. The code in this other thread shows a way to get them.

    But if you do not have the values for any other reason, you can get the handle to the layer, make a duplicate of it with all the settings and just crush those you want to change.

    It is a way to just change the angle while keeping the other existing settings.

    // helper function for working with descriptors
    function getProperty( psClass, psKey, index ){// integer:Class, integer:key
        var ref = new ActionReference();
        if( psKey != undefined ) ref.putProperty( charIDToTypeID( "Prpr" ), psKey );
        if(index != undefined ){
            ref.putIndex( psClass, index );
        }else{
            ref.putEnumerated( psClass , charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
        }
        try{
            var desc = executeActionGet(ref);
        }catch(e){ return; }// return on error
        if(desc.count == 0) return;// return undefined if property doesn't exists
        var dataType = desc.getType(psKey);
        switch(dataType){// not all types supported - returns undefined if not supported
            case DescValueType.INTEGERTYPE:
                return desc.getInteger(psKey);
                break;
            case DescValueType.ALIASTYPE:
                return desc.getPath(psKey);
                break;
            case DescValueType.BOOLEANTYPE:
                return desc.getBoolean(psKey);
                break;
            case DescValueType.BOOLEANTYPE:
                return desc.getBoolean(psKey);
                break;
            case DescValueType.UNITDOUBLE:
                return desc.getUnitDoubleValue(psKey);
                break;
            case DescValueType.STRINGTYPE:
                return desc.getString(psKey);
                break;
            case  DescValueType.OBJECTTYPE:
                return desc.getObjectValue(psKey);
                break;
            case  DescValueType.LISTTYPE:
                return desc.getList(psKey);
                break;
            case  DescValueType.ENUMERATEDTYPE:
                return desc.getEnumerationValue(psKey);
                break;
        }
    };
    function duplicateDescriptor( descriptor ) {
        var newDescriptor = new ActionDescriptor;
        newDescriptor.fromStream( descriptor.toStream() );
        return newDescriptor;
    };
    function localizeDescriptor( desc ) {
        var stream, pointer, zStringLength, zstring, localized_string, newZStringLength, previousStream, followingStream, newDesc;
        stream = desc.toStream();
        while( true ) {
            pointer = stream.search(/TEXT....\x00\$\x00\$\x00\$/);
            if( pointer === -1 ) {
                break;
            }
            zStringLength = getLongFromStream( stream, pointer + 4 );
            zstring = readUnicode( stream.substr( pointer + 8, ( zStringLength - 1 ) * 2) );
            localized_string = ( localize( zstring ) ) + '\u0000';
            newZStringLength = localized_string.length;
            previousStream = stream.slice( 0, pointer);
            followingStream = stream.slice( pointer + 8 + zStringLength * 2);
            stream = previousStream.concat( 'TEXT', longToString( newZStringLength ), bytesToUnicode( localized_string ), followingStream );
        }
        newDesc = new ActionDescriptor();
        newDesc.fromStream( stream );
        return newDesc;
    };
    function getShortFromStream( stream, pointer ) {
        var hi, low;
        hi = stream.charCodeAt( pointer ) << 8 ;
        low = stream.charCodeAt( pointer + 1 );
        return hi + low;
     };
    function getLongFromStream( stream, pointer ) {
        var hi, low;
        hi = getShortFromStream( stream, pointer) << 16;
        low = getShortFromStream( stream, pointer + 2);
        return hi + low;
    };
    function readUnicode( unicode ) {
        var string = "";
        for( i = pointer = 0; pointer < unicode.length; i = pointer += 2) {
            string +=String.fromCharCode( getShortFromStream( unicode, pointer ) );
        }
        return string;
    };
    function longToString( longInteger ) {
        var string;
        string = String.fromCharCode( longInteger >>> 24 );
        string += String.fromCharCode( longInteger << 8 >>> 24 );
        string += String.fromCharCode( longInteger << 16 >>> 24 );
        string += String.fromCharCode( longInteger << 24 >>> 24 );
        return string;
    };
    function bytesToUnicode( bytes ) {
        var unicode = "", char_code, charIndex;
        for( charIndex  = 0; charIndex < bytes.length; charIndex ++ ) {
            char_code = bytes.charCodeAt( charIndex );
            unicode += String.fromCharCode(char_code >> 8 ) +  String.fromCharCode( char_code & 0xff );
        }
        return unicode;
    };
    
    function setGradientAdjustmentAngle( angle ) {
        var adjustmentDesc = getProperty( charIDToTypeID("Lyr "), charIDToTypeID( 'Adjs' ) ).getObjectValue(0);
        var newAdjustmentDesc = duplicateDescriptor( adjustmentDesc );
        newAdjustmentDesc.putUnitDouble( charIDToTypeID('Angl'), charIDToTypeID('#Ang'), angle );
    
        var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putEnumerated( stringIDToTypeID('contentLayer'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc.putReference( charIDToTypeID('null'), ref );
        desc.putObject( charIDToTypeID('T   '), stringIDToTypeID('gradientLayer'), newAdjustmentDesc);
        executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
    };
    var newAngle = 45;
    setGradientAdjustmentAngle( newAngle );
    
  • How to use FOLLOW-UP and COMPRESS the clause of the CREATE statement TABLE?

    my oracle's 10g and the statement of create table below:

    CREATE TABLE S005.q100

    (

    Q1 tank (1)

    )

    NOMONITORING;

    After you create this table, I ask USER_TABLES, but the value of the follow-up column is YES.

    I think there should be no how is? and also I have the same problem with the COMPRESS.

    Thank you very much


    Hello

    Heap - organized tables are your usual routine tables. It is created using the BUNCH of the ORGANIZATION of the CREATE TABLE statement clause. This is the default value.

    The other variant of this clause is ORGANIZATION INDEX, which means that you will create an organized Index of Table. In other words, it is a table that is stored in a B-tree, like an index.

    You also have an EXTERNAL BODY, which means that you will create an external table. Here is generally flat files outside of the database that you can order the database to see tabular to use SQL (read only) against. You will also need the settings on how the data are presented on the file, so that your database knows which column will match that of the data.

    The COMPRESS on 10G is known as the "basic compression" and it works on ordinary table segment blocks, which are organized by a bunch of tables.

  • How to get the create view sql statement

    I have a technical problem

    There is a view in the database, for example "topstudentsview" and sql statement is ' select * student where scores > 90;

    My question is how to get the sql statement of the view. I want to get the sql statement in the topstudentsview

    Is the equivalent in MS Sql

    sp_helptext 'topstudentsview '.

    How in Oracle?

    Thank you

    user10182401 wrote:
    My question is how to get the sql statement of the view.

    Simple answer: use a tool. Almost every development tool will give you an option for this requirement.

    In Oracle SQL Developer (free), it's as simple as:

    Connect to the database with the user and click on "views".
    Select the appropriate view, and then click the SQL tab.

  • How can rewrite the query statement effectively

    Hi gurus,

    BANNER

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

    Oracle Database 10g Release 10.2.0.4.0 - Production 64-bit

    PL/SQL Release 10.2.0.4.0 - Production

    CORE 10.2.0.4.0 Production

    AMT for Linux: release 10.2.0.4.0 - Production

    NLSRTL Version 10.2.0.4.0 - Production

    Table scripts


    CREATE TABLE WAREHOUSE

    (

    IDZONE VARCHAR2 (6 BYTE) NOT NULL,

    ZONE_CREATEDATE DATE NOT NULL,

    DATE OF DT_WAREHOUSE,

    DATE OF DT_POSTING

    )

    AREA ID, ZONE_CREATEDATE is PK

    CREATE TABLE ZONE_VIEW

    (

    IDZONE VARCHAR2 (6 BYTE) NOT NULL,

    ZONE_CREATEDATE DATE NOT NULL,

    ZONE_NUM NUMBER (2) NOT NULL,

    DATE OF TRANX_DATE

    )

    ID of the AREA, ZONE_CREATEDATE, ZONE_NUM is PK

    Query

    SELECT ID area, zone_createdate

    Of

    (

    SELECT ID area, zone_createdate,

    MAX (CASE WHEN zone_num = 18 AND tranx_date 'n' IS NOT NULL, THEN 1 TIME zone_num = 18 AND tranx_date IS NULL THEN 0 ELSE-1 END) region_18,.

    MAX (CASE WHEN zone_num = 110 AND not IS NOT NULL, THEN 1 TIME = 110 zone_num tranx_date AND tranx_date IS NULL THEN 0 ELSE-1 END) region_110,.

    MAX (CASE WHEN zone_num = 135 AND tranx_date no IS NOT NULL, THEN 1 TIMES zone_num = 135 AND tranx_date IS NULL THEN 0 ELSE-1 END) region_135,.

    MAX (CASE WHEN zone_num = 140 AND tranx_date 'n' IS NOT NULL, THEN 1 TIME zone_num = 140 AND tranx_date IS NULL THEN 0 ELSE-1 END) region_140

    OF zone_view

    GROUP BY IDZone, zone_createdate

    ) zrn

    WHERE zrn.region_18 <>0

    AND (((zrn.region_110 = 1) OR (zrn.region_110 = - 1)) AND (there IS NOT (SELECT null from warehouse w WHERE w.zoneid = zrn.zoneid AND w.zone_createdate = zrn.zone_createdate AND w.dt_warehouse IS NULL)))

    AND (((zrn.region_135 = 1) AND (there IS NOT (SELECT null from warehouse w WHERE w.zoneid = zrn.zoneid AND w.zone_createdate = zrn.zone_createdate AND w.dt_posting IS NULL))) OR (zrn.region_140 = 1))

    OR ((zrn.region_18 >-1) AND (zrn.region_135 = - 1) AND (zrn.region_140 < 1))

    OR ((zrn.region_110 = 1) AND (zrn.region_135 = - 1) AND (zrn.region_140, <>, 0))

    );

    Top query runs too slowly on the real data set. Is there an effective way to rewrite the query which can perform the dough?

    Any help or suggestion would be appreciated

    Thanks in advance

    At the time where the application may not throw anything until after he has retrieved and grouped all the ranks of zone_view. His estimate of 7.5 minutes to scan millions 639 lines really fast enough - it's 85 million lines per minute.

    This seems to be where the time went. The only way that the query can be accelerated is to recover some of the conditions that must be applied before the grouping. The only obvious possibilities for this are

    (a) filter values of zone_num

    (b) move the audit only

    NOT EXISTS (SELECT null from warehouse w WHERE w.zoneid = zrn.zoneid AND w.zone_createdate = zrn.zone_createdate AND w.dt_warehouse IS NULL)

    within the group, because this condition is applied regardless of the values in calculated fields. The AREA ID, ZONE_CREATEDATE are not null, so I suggest to try:

    SELECT ID area, zone_createdate

    Of

    (

    SELECT ID area, zone_createdate,

    MAX (CASE WHEN zone_num = 18 AND tranx_date 'n' IS NOT NULL, THEN 1 TIME zone_num = 18 AND tranx_date IS NULL THEN 0 ELSE-1 END) region_18,.

    MAX (CASE WHEN zone_num = 110 AND not IS NOT NULL, THEN 1 TIME = 110 zone_num tranx_date AND tranx_date IS NULL THEN 0 ELSE-1 END) region_110,.

    MAX (CASE WHEN zone_num = 135 AND tranx_date no IS NOT NULL, THEN 1 TIMES zone_num = 135 AND tranx_date IS NULL THEN 0 ELSE-1 END) region_135,.

    MAX (CASE WHEN zone_num = 140 AND tranx_date 'n' IS NOT NULL, THEN 1 TIME zone_num = 140 AND tranx_date IS NULL THEN 0 ELSE-1 END) region_140

    OF zone_view

    where (IDZone, zone_createdate) NOT IN (select the zone ID, w warehouse zone_createdate WHERE w.dt_warehouse IS NULL)

    and zone_num (18, 110, 135, 140)

    GROUP BY IDZone, zone_createdate

    ) zrn

    WHERE zrn.region_18 <> 0

    AND ((zrn.region_110 = 1) OR (zrn.region_110 = - 1))

    AND (((zrn.region_135 = 1) AND (there IS NOT (SELECT null from warehouse w WHERE w.zoneid = zrn.zoneid AND w.zone_createdate = zrn.zone_createdate AND w.dt_posting IS NULL))) OR (zrn.region_140 = 1))

    OR ((zrn.region_18 >-1) AND (zrn.region_135 = - 1) AND (zrn.region_140)<>

    OR ((zrn.region_110 = 1) AND (zrn.region_135 = - 1) AND (zrn.region_140 <> 0))

    )

    Unfortunately, if the plan of the query time estimates are correct, most of the duration of the query is spent doing a reading zone_view in a full analysis, and which will not be changed by this query.

    If there are many rows for each (IDZone, zone_createdate) zone_view pair, then it is possible that an index on (area ID, zone_num, zone_createdate) would contribute to this request, especially if most (IDZone, zone_createdate) pairs are filtered with the NOT IN (select the zone ID, zone_createdate w warehouse WHERE w.dt_warehouse IS NULL). More radical but probably effective measure would be a functional on index

    zone_view (zone_num, IDZone, zone_createdate, case when tranx_date is null then 0 otherwise 1 end)

    and using the expression in the query box:

    SELECT ID area, zone_createdate

    Of

    (

    SELECT ID area, zone_createdate,

    NVL (MAX (CASE WHEN zone_num = 18 then case when tranx_date is null, then 0 or 1 end end),-1) region_18,.

    NVL (MAX (CASE WHEN zone_num = 110 then case when tranx_date is null, then 0 or 1 end end),-1) region_110,.

    NVL (MAX (CASE WHEN zone_num = 135 then case when tranx_date is null, then 0 or 1 end end),-1) region_135,.

    NVL (MAX (CASE WHEN zone_num = 140 then case when tranx_date is null, then 0 or 1 end end),-1) region_140

    OF zone_view

    where (IDZone, zone_createdate) NOT IN (select the zone ID, w warehouse zone_createdate WHERE w.dt_warehouse IS NULL)

    and zone_num (18, 110, 135, 140)

    GROUP BY IDZone, zone_createdate

    ) zrn

    WHERE zrn.region_18 <> 0

    AND ((zrn.region_110 = 1) OR (zrn.region_110 = - 1))

    AND (((zrn.region_135 = 1) AND (there IS NOT (SELECT null from warehouse w WHERE w.zoneid = zrn.zoneid AND w.zone_createdate = zrn.zone_createdate AND w.dt_posting IS NULL))) OR (zrn.region_140 = 1))

    OR ((zrn.region_18 >-1) AND (zrn.region_135 = - 1) AND (zrn.region_140)<>

    OR ((zrn.region_110 = 1) AND (zrn.region_135 = - 1) AND (zrn.region_140 <> 0))

    )

    This gives a very different plan on my database, by performing an iteration on relevant areas of performance status:

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

    | ID | Operation | Name |

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

    |   0 | SELECT STATEMENT |              |

    |*  1 |  FILTER                          |              |

    |   2.   VIEW                           |              |

    |*  3 |    FILTER                        |              |

    |   4.     HASH GROUP BY.              |

    |   5.      ANTI NESTED LOOPS.              |

    |   6.       INLIST ITERATOR.              |

    |*  7 |        INDEX RANGE SCAN | ZV_F1 |

    |*  8 |       TABLE ACCESS BY INDEX ROWID | WAREHOUSE |

    |*  9 |        INDEX UNIQUE SCAN | WAREHOUSE_PK |

    | * 10 |   TABLE ACCESS BY INDEX ROWID | WAREHOUSE |

    | * 11 |    INDEX UNIQUE SCAN | WAREHOUSE_PK |

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

    Your plan will be different because you have data volumes (I didn't create millions of lines of test data)

    It would be useful to know how many rows there are in the WAREHOUSE, how many distinct (IDZone, zone_createdate) pairs there are in zone_view and the number of rows actually returns the query, and how much is NOT IN (select the zone ID, w zone_createdate warehouse WHERE w.dt_warehouse IS NULL) because these relative numbers determine how these approaches are.

    If there is a table containing all of the (area ID, zone_createdate) pairs which could take place in zone_view, which would have may another possible approach:

    First filter possible pairs against NOT IN (select the zone ID, w warehouse zone_createdate WHERE w.dt_warehouse IS NULL)

    Then attach them to the zone_view to retrieve only the rows in the filtered (IDZone, zone_createdate) pairs.

    Good luck.

  • How to set the initial state to hide/show buttons on opening PDF files?

    InDesign offering a wonderful object multi-state capacity which unfortunately does not work in PDF files. It took a bit of research for me to come with this information, the UI program itself gives indications that this should work. (Why not maybe another forum of discussion.)

    So, I create an interactive PDF using buttons to hide/show specific paragraphs (which are also implemented as buttons because only the buttons and forms can be hidden or shown, AFAIK).

    I've set up a PDF created via InDesign using the six control keys and seven paragraphs - one of these paragraphs is the initial state that I want to see when the document is opened. As long as the PDF file that I create is distributed, that's how it works: an initial paragraph appears, buttons can be clicked and the stuff of Heroes appears the mark.

    However, a colleague thoughtfully saved the PDF file (so it could rename something more to his liking). When he does this, he left one of the displayed subsidiary paragraphs, rather than the initial paragraph I intended... and of course, this is the version that came out to the customer.

    Question: Is there a way to set the initial state to hide/show buttons when a PDF document is opened first, regardless of the State in which he could let or saved? I guess it's sort of ON OPEN event that would allow me to define an initial state as a safety net to the way I save the original document. Obviously, the PDF AS I DELIVER IT will pave the way, I want it, but I'm trying to overcome the appearance of the Murphy's law of a document that can be re-recorded in another State. An event which OPENED on that cure.

    Thank you.

    in this case you would have been better if you had locked the PDF file in order to prevent changes ANDS record as actions...

  • How to recover the PSADMIN State of origin user profile?

    People,

    Hello. My user ID to log in the application designer is "PSADMIN". I just created PIA. "http://localhost/psp/ps/?cmd=login" accesses PeopleSoft access code page, and I use "PSADMIN" to connect. I can open all web pages after login. "PSADMIN" is the access profile and user profile.

    But after I create a "newUser" role and assign a list of the permissions for the role, then the role "newUser" a link to the user "PSADMIN" profile, I can't open most web pages after login in PeopleSoft signon page using "PSADMIN". The system get the message: "you do not have access to the collection of Navigation. Please contact your portal administrator.

    Can any people tell me how to recover the profile user "PSADMIN" State of origin so that all web pages open after the connection?


    Thank you.

    go to PIA by using a root as VP1 or PS user and remove what you added to the PSADMIN.

    If you have locked your root user by chance... unlocked by using backend.

    PSOPRDEFN TABLE, unlock root user using the acctlock update.

    then sign in using that and make changes to the PSADMIN. or just the background, you can delete the additional role of PSADMIN profile using the same table.

  • How to get the current state of the son process

    Hello

    If I know that the instance id of a child process.
    How can I get the current state of the child (e.g., completed, running, etc.) process in the code "PBL"?

    Thank you in advance.

    Hello

    Here's a way to display the status of children sub-process engendered by a process parent process creation activity. In this sense, the process id of the subprocedure is "ChildProcess. The id of the activity of creating processes in the parent process that causes the work item instance in the child process called 'SpawnChildren '. This logic is performed from inside the process parent in an activity downstream process creation activity, called "SpawnChildren".

    Display statements have been added just to see you return values (do) their leash not when going into production.

    display "Children: " + children + "\nKeys: " + children.keys + "\nLength: " + length(children) +
    "\nInstance id of child: [" + children["SpawnChildren"] + "]"
    
    if children["SpawnChildren"] = null or children["SpawnChildren"] = "" then
         display "Child is completed"
    else
    
         bp as BusinessProcess
    
         connectTo bp
                         using url = Fuego.Server.directoryURL,
                             user = "test",
                             password = "test",
                             process = "/ChildProcess"
    
         instance as Fuego.Papi.Instance
         instance = getInstance(bp, instance : children["SpawnChildren"])
         logMessage "run Instance: " + instance.id
                          using severity = DEBUG
    
         display "Status: " + instance.status + "; inside the child process in the activity: " + instance.activityName
    
         disconnectFrom bp
    end
    

    I downloaded the project I used this in to http://www.4shared.com/file/130890113/2d825960/ChildrenOfaParent.html.

    Hope this helps,
    Dan

  • Help! How to plan the small/medium business

    Hello

    I have the basic configuration is already done (staticly)

    Since the system (WCS) wireless controller, I can see the controller and the lwapp.

    We plan to add more APs in places diffrenet and control each device.

    in any case, now after the basic configuration what should I do?

    Add aps more? or download the plan or safety?

    Can you please give me an advice how to plan a small / medium business building of 3 floors

    BR

    Yamani

    I don't know how you have failed, but once you get the WLC and AP, test and make sure that it meets your requirements.  You don't need WCS right now.  Do all SSID, security stuff and try it again.  When you have this job, then you can move you.  Once you have a stable environment, then go ahead and add AP and ensure again that you have signal where you need signal and that everything works.  After that, then go ahead and add the floor plan for WC and access point to the map.  WCS is for management and does not need to be in place so that your wireless network is working.  I hope this helps.

  • How to plan the report filtered by dynamic date based on the date, the Agent is running

    Hello

    I have a question about account using OBIEE agent.

    If I run an agent today to deliver A report, can I me A report based on the date of last Monday or any dynamic dates?

    For example, say is today, December 18, 2013, and my agent is run according to how I put the calendar. Now the content of the delivery report one being delivered. Now A report has a date column, normally this column is filtered by the current date. But if it comes through the agents to different users, the data should be the previous Monday, so in this case, 9 December 2013. When this agent is run once again, declared December 27, 2013, then the report must be filtered by December 16, 2013, which is the previous Monday 27 dec.

    Something like this is possible in OBIEE 11 G?

    Thanks in advance.

    Yala,

    Not in a straightforward way

    (1) let the report through Agent with filter current Date

    (2) after he ran for the first time you can see IBOT name/last execution time (LAST_RUNTIME_TS) in S_NQ_JOB

    Create a variable reference 'last_run_agent' to aid in sql to get max (LAST_RUNTIME_TS)

    SELECT max (LAST_RUNTIME_TS) from s_nq_job, whose name = "AGENT_NAME;

    Change analysis with current date filter report and amend accordingly the condition of filter to filter on repository variable, newly created

    Thank you

    Angelique

  • How to make the password does not expire at all times.

    Hi all


    I have to set passwords for users do not expire, I have to change the password every six months.

    How can I make password does not expire at all times.

    Default tablespace, SPODIL
    Temporary tablespace, TEMP
    DEFAULT profile
    User created, XXXXXX
    (Locked) status, OPEN
    Password expires Date, 6/27 / 20105:59: 39 PM (I do this expiration date forever)
    Date of the lock,
    External name


    You can help.


    Thank you

    So what profile do you want to not apply the limitation of password change?
    Choose 1 & change it, and then make sure that this profile is applied to all users

  • How to change the initial state of the button text?

    blank_page

    The initial state of a button switches is one established in IUR editor before the program runs in the Panel of property whose screenshot you have set. I'm not aware of a way to programmatically change the IUR, especially if the target computer is not installed on the development system.

    If for some reason you won't change the default value in the editor of the UIR, then what you have to do is to define the corresponding attribute BEFORE the Panel opens and possibly call DefaultCtrl before you set the value by default so that the control is set programmatically by default, you have just put , depending on what it is.

Maybe you are looking for