on systimestamp as variable interval

Hi all

just a quick question and I think it's just very simple for you.
select to_char(systimestamp- INTERVAL '120:00' MINUTE TO SECOND, 'Dy DD-Mon-YYYY HH24:MI:SS') from dual;
works very well...
But I want to replace the '120:00' with a variable 'v_interval', so that the interval is not fixed.

But every time I finish the of in "invalid interval..."

Please help me.

Thank you
Joerg

Joerg Lang wrote:
But I want to replace the '120:00' with a variable 'v_interval', so that the interval is not fixed.

You're talking about SQL * more variable? If so, SQL * more does not interval variables. But this isn't a big problem. Like number set and use the NUMTODSINTERVAL function:

SQL> variable n number
SQL> exec :n := 120;

PL/SQL procedure successfully completed.

SQL> select to_char(systimestamp - numtodsinterval(:n,'minute'), 'Dy DD-Mon-YYYY HH24:MI:SS') from dual;

TO_CHAR(SYSTIMESTAMP-NUM
------------------------
Thu 25-Jun-2009 07:02:00

SQL> 

SY.

Tags: Database

Similar Questions

  • customer value variable interval purge with adminapi?

    We have a cfml page that implements the configuration of new servers using the adminapi package.  I am able to find methods to define almost every configuration option, I need, except for the interval purge for client variables.  It is by default in 1 hour and 7 minutes; I want to make it longer.  Note that I don't know purge timeout, which defaults to 90 days, I'm looking for a way to set purge interval using adminapi. Any suggestions?

    It is an omission in the API.

    --

    Adam

  • assign the interval

    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for HPUX: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    is it possible to assign a data type of a table variable interval?
    CREATE TABLE mytable
    AS
       (SELECT '4' num_of_days FROM DUAL);
    
    DECLARE
       myinteverval   INTERVAL DAY TO SECOND;
    BEGIN
       myinterval := INTERVAL '4' DAY;  --happy
    
       SELECT num_of_days INTO myinteverval FROM mytable;
    
       myinteverval := interval myinteverval day; -- not happy
    end;

    Hello

    Pollywog wrote:

    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for HPUX: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    

    is it possible to assign a data type of a table variable interval?

    CREATE TABLE mytable
    AS
    (SELECT '4' num_of_days FROM DUAL);
    
    DECLARE
    myinteverval   INTERVAL DAY TO SECOND;
    BEGIN
    myinterval := INTERVAL '4' DAY;  --happy
    

    What is the reason why he is happy

    INTERVAL '4' DAY
    

    a perfectly formed INTERVAL is literal. By itself

    '4'
    

    would be a VARCHAR2 interval, but is not in itself. immediately before the first quotation mark is the INTERVAL keyword, which means that the expression is a literal INTERVAL, and a literal INTERVAL must contain a certain number in single quotes; No matter what kind of expression.

    SELECT num_of_days INTO myinteverval FROM mytable;
    
    myinteverval := interval myinteverval day; -- not happy
    end;
    

    Use the NUMTODSINTERVAL function:

    myinterval := NUMTODSINTERVAL (4, 'DAY');
    
  • Question about ticks in time

    I have a question about the number of ticks.

    CREATE function abc (netTicks in number)

    RETURNS THE TIMESTAMP

    as

    DATE date1: = '' 2010-11-01;

    v_ticks_for_2010_11_01 NUMBER (19.0): = 634241664000000000; -I did not understand how this number came

    v_ticks_in_a_second NUMBER (19.0): = 10000000; -THERE ARE 10 MILLION OF TICKS IN ONE SECOND

    Start

    utils. DateAdd ('SECOND', ((netTicks-v_ticks_for_2010_11_01) / v_ticks_in_a_second), date1); - what do what is this function?

    end

    /

    Thank you

    Hello

    NewLearner wrote:

    Hi, I have a data type of bigint type in SQL server. During the migration I changed it to number (19.0) in oracle. But how to have a variable equal to bigint in oracle that is coming as an input parameter. I can not give number (19.0) for the input parameter. His gift of syntax error. How to make this support in oracle?

    In the function declaration, you give just the type of data (e.g., NUMBER).  Sizes, as NUMBER (19, 0) , are given to variables that pass to the function.  For example:

    DECLARE

    x_ticks NUMBER (19, 0): =...;

    x_ts TIMESTAMP

    BEGIN

    x_tx: = abc (x_ticks);

    ...

    When writing to abc, suffice to say that it will be passed a NUMBER.  When you call with a certain NUMBER (19, 0), then it will use this NUMEBR (19, 0) value.

    Also in the Sub function return to_timestamp (' 2014-01-01') + interval '10' sec; instead of having fixed the value of 10 for the interval. I want to spend a dynamic value. example: something like v_interval: = (a - b) / c; return to_timestamp ('2010-11-01') + v_interval second interval;  Help, please

    TO_TIMESTAMP call with 1 single argument is just begging for trouble.  Always use a 2nd argument, for example

    TO_TIMESTAMP ('2014-01-01', "YYYY-MM-DD")

    Rather than use a literal INTERVAL here, you could use a variable INTERVAL, use NUMTODSINTERVAL to convert a variable NUMBER of INTERVAL.

  • Retraining due

    Hello

    I have a problem with transition deadline. I want to change expiration transition value dynamically.

    initially due value of transition is 5 m "." I want to change this value to 10 m "once I received external application events.

    Please tell me how we can do it in OBPM.

    Thank you
    Suresh

    Hi Suresh,

    A common problem occurs when the interval based on the regular transition instance variable is set in the same activity which is the regular transition. The logic in an Interactive activity will not run until an end user runs the item of work sitting in the activity instance. If the variable interval was 10 m "before arriving at the activity, even if the logic of the Interactive activity resets the time interval to 5 m", the regular transition will still wait 10 minutes to run.

    If you have an external notification and you want to reset this interval of time, here are the high level steps to achieve this:

    1 Add a Message to wait and change its properties to allow the interruption and served outdoors.
    2 Add the argument variable activity wait Message sends in the new time interval.
    3. Add an automatic activity orphan who has the logic that defines the instance variable interval to the value of the argument of the waiting Message activity. The last line of the auto business logic must be 'action = BACK '.
    4. from your external application, send a past in the process via PAPI, don't forget to send the new value of the time interval.

    Here is a thread with a bit of detail around to send notification and passing arguments in the process of PAPI Re: access Oracle BPM process through independent Java program

    Hope this helps,
    Dan

  • Adding interval to systimestamp

    Hello

    With the help of Oracle 11 g R2.

    I need to create a query that displays the records that exceed a certain length of time. I decided (with the help of Frank) that I need to add 2 hours to my query in order to get the correct results, but I'm having a hard time understanding why this interval of 2 hours must be added to the query. The structure of the table and query are simple and are as follows.

    create table testtime (col1 number, col2 timestamp(6))
    
    insert into testtime values (1, systimestamp)
    insert into testtime values (2, systimestamp)
    
    

    Most likely your time zone is different from the time zone database. For example:

    SQL > alter session set time_zone = "00:00 '"
    2.

    Modified session.

    SQL > select sessiontimezone,.
    2 dbtimezone
    3 double
    4.

    SESSIONTIMEZONE DBTIME
    --------------------------------------------------------------------------- ------
    +00:00                                                                      -05:00

    SQL >

    Systimestamp Function Returns the current timestamp to the zone database. So, return time to the time zone IS:

    SQL > select systimestamp
    2 double
    3.

    SYSTIMESTAMP
    -----------------------------------
    28 DECEMBER 13 02.51.29.650000 PM - 05:00

    SQL >

    Now, it is inserted into the column and what data type is timestamp. Timestamp data type has no concept of timezone, so inserted value is:

    DECEMBER 28, 13 02.51.29.650000

    Then you subtract from systimestamp. Now systimestamp has time zone while the column is not. Why Oracle applies by default rule - adds session time zone. So the value of the column is:

    28 DECEMBER 13 02.51.29.650000 PM-00:00

    As you can see, we just lost 5 hours. and example to illustrate the it:

    SQL > alter session set time_zone = "00:00 '"
    2.

    Modified session.

    SQL > select sessiontimezone,.
    2 dbtimezone
    3 double
    4.

    SESSIONTIMEZONE DBTIME
    --------------------------------------------------------------------------- ------
    +00:00                                                                      -05:00

    SQL > drop table tbl purge
    2.

    Deleted table.

    SQL > create table tbl (t timestamp)
    2.

    Table created.

    SQL > insert
    2 tbl
    3 values (systimestamp)
    4.

    1 line of creation.

    SQL > select t,.
    2 systimestamp,
    3 systimestamp - t diff
    4 tbl
    5.

    T SYSTIMESTAMP DIFF
    ------------------------------ ----------------------------------- --------------------------
    DECEMBER 28, 13 03.02.55.851000 PM DECEMBER 28, 13 03.02.55.861000 PM - 05:00 + 05:00:00.010000 000000000

    SQL >

    As you can see, the difference became 5 hours. This is why you have been suggested for 2 hours (I guess that your time zone session differs from database 2 hours time zone). But this is a "band-aid" solution It simply hides your misconception. Column should be timestamp with time zone, then:

    SQL > alter session set time_zone = "00:00 '"
    2.

    Modified session.

    SQL > select sessiontimezone,.
    2 dbtimezone
    3 double
    4.

    SESSIONTIMEZONE DBTIME
    --------------------------------------------------------------------------- ------
    +00:00                                                                      -05:00

    SQL > drop table tbl purge
    2.

    Deleted table.

    SQL > create table tbl (t timestamp with time zone)
    2.

    Table created.

    SQL > insert
    2 tbl
    3 values (systimestamp)
    4.

    1 line of creation.

    SQL > select t,.


    2 systimestamp,
    3 systimestamp - t diff
    4 tbl
    5.

    T SYSTIMESTAMP DIFF
    ------------------------------ ----------------------------------- --------------------------
    28 DECEMBER 13 03.08.40.176000 PM - 03.08.40.176000 PM - 05:00 + 000000000 00:00:00.000000 28 DECEMBER 13
    05:00

    SQL >

    Or, if you stay with a current design, you must verify that all insertions/changes would be to convert timestamp inserted/updated to date to the same time zone (utc, for example):

    SQL > alter session set time_zone = "00:00 '"
    2.

    Modified session.

    SQL > select sessiontimezone,.
    2 dbtimezone
    3 double
    4.

    SESSIONTIMEZONE DBTIME
    --------------------------------------------------------------------------- ------
    +00:00                                                                      -05:00

    SQL > drop table tbl purge
    2.

    Deleted table.

    SQL > create table tbl (t timestamp)
    2.

    Table created.

    SQL > insert
    2 tbl
    3 values (systimestamp to the "utc" time zone)
    4.

    1 line of creation.

    SQL > select t,.
    2 systimestamp,
    3 systimestamp to the time zone "utc" - t diff
    4 tbl
    5.

    T SYSTIMESTAMP DIFF
    ------------------------------ ----------------------------------- --------------------------
    DECEMBER 28, 13 08.11.41.052000 PM DECEMBER 28, 13 03.11.41.062000 PM - 05:00 + 00:00:00.010000 000000000

    SQL >

    SY.

  • problem with INTERVAL using the dynamic variable

    Hi gurus

    SQL > SELECT INTERVAL '1' DAY OF DOUBLE;

    '1'-DAY INTERVAL

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

    + 01 00:00:00

    SQL > SELECT INTERVAL '1' HOUR OF the DOUBLE;

    '1' TIME INTERVAL

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

    + 00 01:00

    JavaScript:void (0);

    SQL > SELECT INTERVAL '1' MINUTE FROM DUAL;

    '1' MINUTE INTERVAL

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

    + 00 00:01:00

    I want to design an Interior that will contain three input parameters to make the above statement sql dynamic

    can you please help with error code below.

    QL > CREATE OR REPLACE PROCEDURE SP_INTERVAL (DAT TIMESTAMP, INTRVL VARCHAR2, VARCHAR2)

    2 AS

    3 TIMESTAMP V_OUT;

    4 BEGIN

    5

    6

    7 EXECUTE IMMEDIATELY "SELECT: 1 + INTERVAL"2"DOUBLE DAY ' IN V_OUT to the AID of DAT; "

    DBMS_OUTPUT. Put_line (' Hi ' |) (DAT);

    DBMS_OUTPUT. Put_line (' Hi ' |) (DAT);

    END;

    / 8 9 10 11 12 13

    Created procedure.

    SQL > EXECUTE SP_INTERVAL(SYSDATE,'1','DAY');

    Hi July 14, 14 01.15.21.000000 PM

    Hi July 16, 14 01.15.21.000000 PM

    PL/SQL procedure successfully completed.

    SQL > CREATE OR REPLACE PROCEDURE SP_INTERVAL (DAT TIMESTAMP, INTRVL VARCHAR2, VARCHAR2)

    AS

    V_OUT TIMESTAMP;

    BEGIN

    EXECUTE IMMEDIATELY "SELECT: 1 + INTERVAL": 2 "DOUBLE DAY ' IN V_OUT to the AID of DAT, INTRVL;"

    DBMS_OUTPUT. Put_line (' Hi ' |) (DAT);

    DBMS_OUTPUT. Put_line (' Hi ' |) V_OUT);

    END;

    / 2 3 4 5 6 7 8 9 10 11 12 13

    Created procedure.

    SQL > EXECUTE SP_INTERVAL(SYSDATE,'1','DAY');

    BEGIN SP_INTERVAL(SYSDATE,'1','DAY'); END;

    *

    ERROR on line 1:

    ORA-01867: the interval is invalid

    ORA-06512: at "SP_INTERVAL", line 7

    ORA-06512: at line 1

    SQL >

    Thank you

    Hello

    Maybe this can help you:

    CREATE OR REPLACE PROCEDURE SP_INTERVAL (TIMESTAMP, INTRVL VARCHAR2, TERM DAT VARCHAR2)

    AS

    V_OUT TIMESTAMP;

    BEGIN

    RUN IMMEDIATELY "SELECT: 1 + INTERVAL"'| " INTRVL | " ' || TERM | 'FROM DUAL' IN V_OUT WITH THE HELP OF DAT;

    DBMS_OUTPUT. Put_line ('Hi' |) (DAT);

    DBMS_OUTPUT. Put_line ('Hi' |) V_OUT);

    END;

    /

    concerning
    Kay

  • For the PID variable time interval

    Hello world

    I measure the ph and control the flow of co2, so I decided to use the useful PID screw like I do for my temperature control.

    the difference and so my question is, I have not want (/ power) to run the PID in a timed loop, in fact my intervals of measurement (eg. every 30 seconds ~ or ~ 60) may vary in the second range, because of the way I acquire data and how I put the valve in co2.

    so my question is: is this a without problem?

    I'm not sure weather the internal timer or providing the dt will explicitly be responsible for this?

    (and I can't test it on atm equipment)

    thx for your time

    Shouldn't be a problem. Don't wire dt, let the PID to use its internal clock. Could make it more difficult to tune the PID, since you will have to account for the worst cases (longer delays between updates).

  • How to multiply the channel by variable

    Hello

    I have a timestamp that is not real time, but the next number. I know that the interval (such as 1 or 10 seconds) of the measures. So I am this conversion to standard time. In this case, I need to multiply this channel by given interval. It's easy, because you can multiply the channel by a constant like below:

      Call ChnCalculate ("Ch(""[2]/Seconds1"") = Ch(""[1]/#"") * 1")
    Call ChnCalculate ("Ch(""[2]/Minutes1"") = Ch(""[2]/Seconds1"") / 60")
    Call ChnCalculate ("Ch(""[2]/Hours1"") = Ch(""[2]/Minutes1"") / 60")

    But how to do this using the variable? Let's say we have variable s_interval and we want to put this variable instead of multiplying it by constant.

    Ch(""[1]/#"") * 1 ")

    Do you know how to do this?

    Best regards

    Piotr

    Hi Piotr,

    You can set it like this:

    Dim dFactor
    Call ChnCalculate ("Ch(""[2]/Noise_1"") = Ch(""[2]/Noise_1"") /"& dFactor ")

    But I prefer a DIAdem function for this calculation, because it is faster using a well-defined function than the calculator.

    Dim dFactor, dOffset
    dFactor = 10
    dOffset = 0
    Call ChnLinScale ("[1] / Time", "[1] / Time", dFactor, dOffset)

    or if you use the channel object:

    Dim oChn, dFactor, dOffset
    Set oChn = Data.GetChannel("[1]/Time")
    dFactor = 10
    dOffset = 0
    Call ChnLinScale (oChn, oChn, dFactor, dOffset)

    Greetings

    Walter

  • NEITHER 3202 - SAMPLING INTERVAL ADJUSTMENTS

    Hello!

    I need clarification on the concept of sampling interval wrt nodes NI WSN (3202, 3212, 3226) training and even with my kit. I list the approaches that I have known,

    • Approach I: in Structure case 'Node target VI'--> 'Start '. Choose the mode "VI Driven" and together with a constant interval sampling.

    • Approach II: In the case 'Node target VI'--> 'Start' Structure. Choose mode "Host Driven" and the sampling of sets interval via "user Project dialog box" (*.lvproj), choose particular node, do a right click-> properties-> tab node-> change the number in the collection interval box. "»

    • Approach III: Using the API host WSN, something as pic shown sideways

    Question 1: I tried this III, with "VI Driven" approach, does this independent approach of mode affect you?

    • Approach IV: In 'Target node VI'--> placing 'ConfigNode VI' and set the sampling interval according to the logic of the user in "Sample" and other Structures of the case. [Interval sampling mode: VI led]

    Question 2: Considering III feasible approach in mode 'Led VI', did any priority is offered by node approach III against approach IV?
    [For example.] I set my Interval(say 45 <->60) of sampling to change in the order through certain events trigerred (BatteryLevels, LinkQ, SampledDataRange) and using VI host suite III approach I want to change the sampling interval (say 30) for a while. [So now sampling 30 sec interval remains static or it keeps changing (45/60) to 30 when the target node running sample structures & received Msgs.]

    Question 3: We have the chance to change the sampling for each channel (AI0... intervals AI3) or in groups of two channels and even with digital channels, if there is no restriction of internal hardware ADC/MUX invloved let me know.
    [For example.] If my sample data (range: 1-6 volts) to channel AI0 grave in particular area (say, 1 - 3V), work are perpendicular, but if it falls in the range (say 4-6 v) I want to change the sampling interval, while other channels (AI1... [A13) remain the same, regardless of either]

    Hi PP_BABU,

    This would work except that it might be difficult to corelate the sample # in the message to the user for the IO AI1 variable. A better approach may be to enter the data locally and combine multiple samples in a user-defined variable. You can change the AI1 data to a string, and then concatonate several in a larger string. Then send bursts of data. That should help with the battery life you could send each second instead of constantly backdata.

    Provided that the user has taken, there is no limitation. You just need to drop a basic I/O node and select digital i/o > User LED , then right click on the same I/O node, then select change write.

    See you soon,.

    Brian has

    R & D Product Support Engineer | WSN/network DAQ

    National Instruments

  • global variable functional to read and write data from and to the parallel loops

    Hello!

    Here is the following situation: I have 3 parallel while loops. I have the fire at the same time. The first loop reads the data from GPIB instruments. Second readers PID powered analog output card (software waveform static timed, cc. Update 3 seconds interval) with DAQmx features. The third argument stores the data in the case of certain conditions to the PDM file.

    I create a functional global variable (FGV) with write and read options containing the measured data (30 double CC in cluster). So when I get a new reading of the GPIB loop, I put the new values in the FGV.

    In parallel loops, I read the FGV when necessary. I know that, I just create a race condition, because when one of the loops reads or writes data in the FGV, no other loops can access, while they hold their race until the loop of winner completed his reading or writing on it.

    In my case, it is not a problem of losing data measured, and also a few short drapes in some loops are okey. (data measured, including the temperature values, used in the loop of PID and the loop to save file, the system also has constants for a significant period, is not a problem if the PID loop reads sometimes on values previous to the FGV in case if he won the race)

    What is a "barbarian way" to make such a code? (later, I want to give a good GUI to my code, so probably I would have to use some sort of event management,...)

    If you recommend something more elegant, please give me some links where I can learn more.

    I started to read and learn to try to expand my little knowledge in LabView, but to me, it seems I can find examples really pro and documents (http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/ , http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/m-p/... ) and really simple, but not in the "middle range". This forum and other sources of NEITHER are really good, but I want to swim in a huge "info-ocean", without guidance...

    I'm after course 1 Core and Core 2, do you know that some free educational material that is based on these? (to say something 'intermediary'...)

    Thank you very much!

    I would use queues instead of a FGV in this particular case.

    A driving force that would provide a signal saying that the data is ready, you can change your FGV readme...  And maybe have an array of clusters to hold values more waiting to be read, etc...  Things get complicated...

    A queue however will do nicely.  You may have an understanding of producer/consumer.  You will need to do maybe not this 3rd loop.  If install you a state machine, which has (among other States): wait for the data (that is where the queue is read), writing to a file, disk PID.

    Your state of inactivity would be the "waiting for data".

    The PID is dependent on the data?  Otherwise it must operate its own, and Yes, you may have a loop for it.  Should run at a different rate from the loop reading data, you may have a different queue or other means for transmitting data to this loop.

    Another tip would be to define the State of PID as the default state and check for new data at regular intervals, thus reducing to 2 loops (producer / consumer).  The new data would be shared on the wires using a shift register.

    There are many tricks.  However, I would not recommend using a basic FGV as your solution.  An Action Engine, would be okay if it includes a mechanism to flag what data has been read (ie index, etc) or once the data has been read, it is deleted from the AE. 

    There are many ways to implement a solution, you just have to pick the right one that will avoid loosing data.

  • How to make the variable data record (intermittent time), with a real-time display

    I'm a complete newbie to Labview. We are currently developing a piece of hardware in the lab to automatically take the readings of the concentration of a sample, through correlations with voltage readings. I have read and worked through the getting started with Labview .pdf, but other than that my knowledge is minimal. I have a flowsheet of work who is able to do it correctly and display and write the data in real time. However, I want to be able to write to a file only every 10 minutes or so, since experiments can run for several days and the amount of data it currently logs is unnecessary.

    Would be nice if he could write it in columns like this:

    [date time]  [voltage ave]  [levels]

    xx                     xx                        xxx

    xx                     xx                        xxx

    xx                     xx                        xxx

    .. .but only once every 10 minutes. Or at any interval of time, I put.

    I tried to connect different parallel loops, but I failed miserably. I don't know if it is a relatively simple problem for you guys to help me with.

    I have attatched file. Please note that the file variables.txt is there simply to hold the settings for the correlation of concentration, which took charge of him.

    In addition, advice or tips to improve this would be greatly appreciated.

    Hi mooray.

    I took a quick look at your code, but you should be able to do something like this:

    When you have an Express VI elapsed time set to 600 seconds (10 minutes). If every 600 seconds time out will pass a Boolean TRUE, which will allow to write the measurement file Express VI. Therefore, what iteration of the while loop, you would write some input comes in the signal input to write it into a file position.

    There are other ways to do this as well, but it's pretty simple. I hope this helps!

    Thanks for choosing National instruments.

    Aaron P

    National Instruments

    Technical sales engineer

    http://www.NI.com/support

  • change in value of the variable periodically

    Hi all

    I want to change the value of the variable periodically such as on the front panel, initial, final and incremental value must be defined by the user and the variable value changes automatically after every 5 seconds. and I want also the time interval should be set by the user on the front panel. How is that possible?

    Any help will be greatly appreciated

    Take a look at the attached simple project.  You can change all the values on the fly.  Change the initial value or the value of interval timer are asynchronous to the timer (the changes are made as soon as the user changes the value in the user interface).  The other values are updated only when the timer clicks.  The difference is that I have added reminders to the initial value and the interval timer value.  Given that these other values are used that when the timer clicks, they didn't need reminders.  Their values are used in the callback of the timer.

    I added a callback for the timer interval allow an operator to correct an error.  For example, if they wanted to wait for 10 seconds, but they came in 100, with the reminder, they do not need to wait 100 seconds before the timer is updated with correction.

  • Variable grouping in package specifications Initialiazing

    Hi Experts,

    I know this might be a basic question, here is my piece of code

    I have a variable declared as type data number and initialized to 10 g_number

    I have EMP_SAL_TAB which is a kind of data EMP_SAL that is defined on line 6.

    but am getting error when I try to initialize it in line 11.

    now, my query is why am getting error of initialization of the collection on line 11?  Sorry for a very basic question, but it is always good to clear a query.

    create or replace PACKAGE emp_sal AS
    g_salary_spec number;
       PROCEDURE find_sal(c_id emp.empno%type);
       FUNCTION CONCATE_NAMES (C_ID EMP.EMPNO%TYPE) RETURN VARCHAR2;
       
       type emp_sal is table of char(2) index by binary_integer;
       emp_sal_tab emp_sal;
       
       g_number number:=10;
       
       emp_sal_tab(1):= 100;
       
    END emp_sal;
    

    You can't write code in the package specification. An assignment statement is code.

    And associative arrays have NO constructors. See Oracle documentation on how the collections initialized.

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25519/composites.htm#LNPLS00506

    This example shows that you can initialize a VARRAY

    Why you use a package for this variable?

    If you need to initialize an associative array it during initialization block the package body.

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25519/packages.htm#LNPLS99926

  • Variable completion Calc aggregation times

    All,

    I am at my wits end and I hope someone can help me solve why there is more this variability in how long it takes to run anaggregation.  Sometimes, the aggregation take less than 5 minutes, but sometimes it takes 35 minutes.  I assumed because the 'SET UPDATECALC' is to 'OFF', it would not be serious if all or any of the records were changed, it should take the same time to perform the aggregation.  In addition, the dimensions listed in the AGG statement are all sparse dimensions by increasing order of number of members stored. I also tried using different number of threads 10-to-1, but I don't get results of consistent treatment.

    Any help is greatly appreciated.

    Thank you

    Here are the details

    CALC SCRIPT

    ***************************************** */

    UPDATECALC OFF SET;

    SET CACHE HIGH;

    SET CALCPARALLEL 4;

    SET AGGMISSG

    / * Start external fix

    ***************************************** */

    FIX (& CurYr, & NextYr, & CurFcst, 'UserEntry_Base', 'UserEntry_Adj', 'Only_Version', 'Local_Curr')

    AGG ('Bus_Unit', 'Company', 'Geography', 'Cost_Center', 'Employee');

    ENDFIX

    CUBE SCHEMA

    Account - Dense

    Period - Dense

    Version - Dense

    Source - sparse

    Year - sparse

    Scenario-sparse

    Currency - sparse

    Bus_Unit - sparse

    Company - sparse

    Geography - sparse

    Cost_Center - sparse

    Employee - sparse

    Position - attribute

    MAXL JOURNAL using 4
    Threads.  This particular race has taken
    107,797 seconds.

    OK/INFO - 1012675-
    Blocks of validation for the calculation interval is [0].

    OK/INFO - 1012670-
    Aggregation [Bus_Unit (All members) Company (All members) Geography (All members)
    Cost_Center(All Members) Employee (All members)] with fixed members
    [Version (Only_Version); Source (UserEntry_Base, UserEntry_Adj); Year (FY15
    FY16); Scenario (work schedule); Currency (Local_Curr)].

    OK/INFO - 1012678-
    Calculation of parallel threads with [4].

    OK/INFO - 1012679-
    The calculation [2404,7,1,1,1] job scheduling.

    OK/INFO - 1012680-
    Parallelization of aid lines of work [1]. .

    OK/INFO - 1012681-
    Tasks of empty [1064,0,0,0,0].

    OK/INFO - 1012579-
    Total time elapsed Calc [C_AggF.csc]: [107,797] seconds.

    OK/INFO - 1013274-
    The calculation is executed.

    Finished running
    C_AggF script on cube WF

    MAXL JOURNAL using 2
    Threads.  This particular race has taken 2146.8
    seconds and a caveat

    OK/INFO - 1012675 - Commit block interval for the
    the calculation is [0].

    WARNING - 1012587-
    Current number of dimensions of task [1] for the parallel calculation could have
    caused too many tasks [2414] must be generated. See if can of computing time
    be improved by reducing the number of dimensions of the task by one (see DEFINITION
    About CALCTASKDIMS of the technical reference). Also, consider using
    FIXPARALLEL to perform a selection of custom tasks that differ from
    CALCPARALLEL.

    OK/INFO - 1012670-
    Aggregation [Bus_Unit (All members) Company (All members) Geography (All members)
    Cost_Center(All Members) Employee (All members)] with fixed members
    [Version (Only_Version); Source (UserEntry_Base, UserEntry_Adj); Year (FY15
    FY16); Scenario (work schedule); Currency (Local_Curr)].

    OK/INFO - 1012678-
    Calculation of parallel threads with [2].

    OK/INFO - 1012679-
    The calculation [2404,7,1,1,1] job scheduling.

    OK/INFO - 1012680-
    Parallelization of aid lines of work [1]. .

    OK/INFO - 1012681-
    Tasks of empty [1064,0,0,0,0].

    OK/INFO - 1012579-
    Total time elapsed Calc [C_AggF.csc]: [2146,8] seconds.

    OK/INFO - 1013274-
    The calculation is executed.

    Finished running
    C_AggF script on cube WF

    Apparently, users began execution of business rules (they have not before) which increased fragmentation.  After completing a mid-week forced to restructure, computation time are returned to normal.

Maybe you are looking for