How to write a delete with select sub statement?

Hello
Is it possible to change the bottom of construction to be more effective by writing a delete statement that uses a subselect with the statement inside the loop?
 my_current_date_time := TRUNC(in_start_date_time);
       
       DELETE FROM inclusion_table;
 
  LOOP
    
     EXIT WHEN my_current_date_time >= in_end_date_time;
       
     INSERT INTO inclusion_table (
                 date_time )
      VALUES (my_current_date_time);
      
            
      my_current_date_time := my_current_date_time + numtodsinterval(1, 'DAY');
               
  END LOOP
Thank you.

Just add the code to the Code of the Christian

SQL > declare
2 start_Date Date: = to_date ('2009-12-06', ' dd/mm/yyyy');
End_date Date 3: = trunc (sysdate);
4 Begin
{color: blue} 5 EXECUTE IMMEDIATE 'TRUNCATE TABLE inclusion_table; {color}
6 INSERT INTO inclusion_table
7 (SELECT start_date - 1 + level as Date_Time
8 DOUBLE
9 connect BY level<= 1="" +="" end_date="" -="">
10 commit;
11 end;
12.

SS

Tags: Database

Similar Questions

  • Hi I need to know how to write Arabic text with indesign cc 2015

    Hi I need to know how to write Arabic text with indesign cc 2015

    One thing has changed: since CS6 (Version cloud only) you can install the operating system in Arabic or Hebrew any other language without extra cost.

  • How to write a region with white text?

    I working on the following JavaScript code to write the left in the header of the PDF documents, but after you run the code, the redacted area is black, how can I write the area with white rectagles? Thank you very much!

    for(var pg = 0; pg < this.numPages; pg++)
    {
      var rCrop = this.getPageBox("Crop",pg);
      this.addAnnot({
      type:"Redact", page:pg,
      quads:[[0, rCrop[1], rCrop[2] - 345, rCrop[1], 0, rCrop[1] - 14, rCrop[2] - 345, rCrop[1] - 14]],
      overlayText: "",
      alignment: 1,
      repeat:true });
    }
    this.applyRedactions({bKeepMarks: false, bShowConfirmation: false, cProgText: "Processing..." });
    
    

    Well done!

    You can get the most recent versions of the API from here: JavaScript for Acrobat. Adobe Developer Connection

    The API XI lie buried in the Acrobat SDK kit.

    You will find new features in the section "new features and changes".

  • How to write the condition with the value of the parameter

    Hello
    I'm working on siebel BI publisher report. I am able to display the value of the parameter in the report.

    Now, I wanted to do something logical based on the value of the parameter.

    for example: If the user changes the value of the parameter then I have to call A submodel if user don't past not any value then it should not display A submodel

    can someone tell me how to write that above logic?

    If the parameter exists then MODEL of APPEAL one another do not call MODEL A

    Kind regards
    JAG


    Dial a submodel

  • How to write multiple entries with KHz sampling frequency in a file outside the loop?

    Hello

    I am able several entries of string tension using the wizard DAQ (1 sample on request) and it is placed inside a timed loop of frequency 1 KHz.

    This timed loop is placed inside an another while loop.

    Problem is with writing data to a file, although I can see 100 samples of 100 ms in the graphics cable to the out of the way, but the extent of writing to output file stores either only from 19 to 20 samples per second (when he wrote inside the timed loop) or does not store any (if placed outside the timed inner loop).

    I tried to set up producer consumer structure but in the loop of the consumer, I can't write the data in queue to a file saying data type mismatch. I placed the loop starting queue item and consumer out both loops and the element of queue inside the timed loop exit DAQ fed to the queue item.

    Can you please help me solve this problem file writing?

    I haven't looked so writing code from the top of the head, but access to the files is slow, and if you open and close the file, it is quite slow. What do you usually do it write to the file at a slower pace, for example once per second and write all the 1 k samples at a time. Try and also keep Ref file open during the test.

    /Y

  • How to write to .subckt with the function I - V

    Hi all

    Now, I am trying to build a Spice model for a type of diode high voltage for 13 Multisim. Because I do not have the LED electronic settings, and I only have the function of the I - V, I tried to write a file .subckt for him.

    Assuming that the anode is A1 and the cathode is A2, the current flowing through the diode can be expressed only by the function:

    I=((0.581*(V(A1)-V(A2))*(V(A1)-V(A2))/3/3-18.4*(V(A1)-V(A2))/3+144.66)/1000)*U((V(A1)-V(A2))-53)

    With her, I wrote a .subckt:

    . SUBCKT LED A1 A2
    B1 A2 A1 I=((0.581*(V(A1)-V(A2))*(V(A1)-V(A2))/3/3-18.4*(V(A1)-V(A2))/3+144.66)/1000)*U((V(A1)-V(A2))-53)
    . ENDS LED

    This model works well under the IV parser in Multisim 13, but when I connect 2 or 3 of them in series and make a simple circuit simulation, I always get the error report and not always not correct the error.

    Any body can help me to check if my .subckt is correct or not? Thank you.

    It seems that the convergence error is caused by a discontinuity the diode to connection 53V.  Run DC scan using the test circuit.

    To prevent the discontinuity, use the express following with the fi works instead. You can give it a small current when V (A1, A2) is less to 0V.

    B1 A1 A2 I=if(((V(A1)-V(A2))-51)>0,((0.581*(V(A1)-V(A2))*(V(A1)-V(A2))/3/3-18.4*(V(A1)-V(A2))/3+144.66)/1000),-230u)

    The attached circuit have a resistance using convergence.

    You can simplify your expression for readability:

    -(V, (A1), (A2) V) = V (A1, A2)

    -If you can do the expression in this form, it will simply be the calculation ax ^ 2 + bx + c

  • How to write the query with parameters below and is null


    Hi, I need to recover the data if the parameter is passed on the ground, else retrieve all records where the field is null

    Example of


    CREATE TABLE DEPT
    (DEPTNO NUMBER (2),)
    DNAME VARCHAR2 (14).
    LOC VARCHAR2 (13));

    INSERT INTO DEPT VALUES (10, 'ACCOUNTING', 'NEW YORK');
    INSERT INTO VALUES DEPT (20, 'SEARCH', 'DALLAS');
    insert into dept values (30, 'SALES', 'CHICAGO');
    INSERT INTO VALUES DEPT (40, 'OPERATIONS', 'BOSTON');

    ALTER table dept add (object_id number);
    insert into dept values (50, 'OPERATIONS', 'BOSTON', 1);
    insert into dept values (60, 'OPERATIONS', 'BOSTON', 1);
    INSERT INTO VALUES DEPT (70, 'OPERATIONS', 'BOSTON', 2);

    Select * from Department where object_id =: p_object_id

    If I pass the object_id 1, it shloud retrieve the values of dept with object_id 1, but if I don't pass the object_id, it must retrieve all records where object_id is null

    IF 1 is passed as the id of the object, he must recover, 50, 60, if 1 is not passed as object_id it should 10,20,30,40 retive

    It works fine for me separately as,.

    Select * from Department where object_id =: p_object_id - 1

    Select * from Department where the object_id is null;

    Is it possible to do in a single query.

    Thank you

    SELECT *
    FROM dept
    WHERE object_id = :p_object_id
    OR (object_id is null and :p_object_id is null)
    

    is an approach.  It's a little talkative, but the meaning is clear.  If you can identify a value that would never appear in the data (for example-1)

    WHERE nvl( object_id, -1 ) = nvl(p_object_id, -1 );
    

    Justin

  • How to test several issues with iTunes Sub...

    I have build a Milt Iusse with iTunes subscriptions and need evidence tiles of the subscription, but they don't show up when I load the app side. Is there a How To do this somewhere?

    Support called - SOLVED.

    It wasn't a RTFM issue.

  • How to reconcile users deleted with GTC

    Hi all

    I am wandering is the best way to reconcile users deleted using the connector of the GTC. (This isn't Council does by default?).

    I don't know if it's a bad idea to mark the deletion in line with the target (definition of a value in a column) table and revoke the user via an adapter of the entity. Wouldn't be better to create a custom on-demand for this task?

    Is considered to be any tip!

    Thanks in advance,

    Hello

    Yes, I run both schedule the task as "set time". I usually run task first, and then it is followed by delete recon task.

    I'm not entirely understand what do you mean by starting the auto-generated TAG task? Please give me some more before I comment on that.

    To remove recon you should do the following
    HashMap userValues [---]
    userValues = null;
    userValues = createDeleteHashMap (results);
    Set deletedAcc = reconUtil.provideDeletionDetectionData (resourceObject, userValues);
    missingUser = reconUtil.getMissingAccounts (resourceObject, deletedAcc);
    reconEvent long [] = reconUtil.deleteDetectedAccounts (missingUser);

    Here is table of Hashmap userValues that all users have not revoked.

    If your steps should be.

    1 question wich store table all active users and store them in an array of hashmap
    2. pass to the provideDeletionDetectionData method.
    3. pass 2 result set of the getMissingAccounts method step.
    4 col step 3 results in the value deleteDetectedAccounts.

    You can also get more. If in your query, you can know which user is deleted and you are oim9.1 then follow these steps.
    1 query the table and get revoked user or deleted, and then store them in a hash table.
    2. use createDeleteReconciliationEvent (java.lang.String psObjName, poAttributeList java.util.Map) to create the event of reconciliation delete.

    First approach is bit risky, because if somehow in your table or view all recording are delete or revoked or mistakenly connector GTC has not found any folder then it will be revoked for all users of IOM which can lead to disaster, as you the recon trust.

    Please let me know if you have any other questions.

    Concerning
    Nitesh

  • How to write a group with 2 parents in xml file?

    Hi all

    In my xml file, I use the following queries.

    Q1:
    Select q xxx;

    Q2:
    Select w to yyy;

    Q3:
    Select: q-: double w;

    Q3 is to get values of Q1 and Q2 and calculate some values.
    While writing a group is possible to write a group such as both parents?
    If so, what is the syntax for that?

    have you tried that?









  • How to return items deleted with the new update?

    My Windows Vista Home Premium to date last night with ony 'recommended' and 'important' updates... then when it restarted this morning, he had completely wiped out my Office Custom, newly added programs such as Google Chrome (and others), as well as all my photos, files and folders. I have no idea where they went and can't find them when using Windows search.

    What happened and can it be restored?

    ~ Dr. ANC

    Hello

    Please, try the following methods:

    Right-click on the desktop, click on see under view to display the desktop icons is checked, otherwise, check the Show Desktop icons.

  • How to write in French with accents with Word Starter IN UK PAVILION G computer LAPTOP

    HOW?

    Hello

    You need a keyboard (hardware or software). For more information, please use the following article:

    http://French.about.com/od/writing/SS/typeaccents.htm

    Kind regards.

  • How to write data files with dot-delimited values in the output interface

    Hello

    We are looking for the value below with. bounded by the

    JANUARY 12, 14; MTS;     12,3400

    14 JANUARY 14; MTS;    124,3442

    14 JANUARY 14; MTS;      4,3400

    14 FEBRUARY 14; HDB DKK;       3446

    14 FEBRUARY 14; HDB DKK STREET;    346,3446

    14 FEBRUARY 14; TEST;    346,3446

    February 16, 14; DKK Til CHF;       1406

    I used to_char utl file. but no luck.

    UTL_FILE.put_line (x_id, x1.dato |) ';' || x 1 .valuta_fra_og_til | ';' || To_char (x 1. Kurs, '999999D9999'));

    Can you please on it.

    Try:

    To_char (x 1. Kurs, '999999D9999','NLS_NUMERIC_CHARACTERS = ".,"')

  • How to write the JUnit with ATG

    as the topic, can someone help me, thanks!

    Take a look at DUST ATG (unit of Dynamo and System Tests) that facilitates the writing of JUnit tests for the ATG based applications.

    http://atgdust.sourceforge.NET/project-info.html

  • How to enter special characters with the Run statement (@).

    Hello

    Oracle10g (R1)

    NLS_CHARACTERSET = "AL32UTF8.

    When I insert record with special characters like "hastened" with the customer tool insert it works fine, but I run the same INSERT statement execution i.e. statement "SQL > @/ path/Script_File_Name.sql ' special characters has not inserted correctly and it become something like 'h¿ta'.»»

    How to enter special characters correctly race (@) statement?

    Thank you

    If you create a file in Notepad, select the ANSI or the encoding UTF-8 in the dialog box save as.  Copy the Linux file in binary mode. Set the variable NLS_LANG ".» WE8MSWIN1252 ", if the file was saved with the ANSI coding or to. AL32UTF8", if the file was saved with UTF-8 encoding. Be sure to export the variable.  Then, start SQL * more and run the script.  I guess that you are on a U.S. or Western Europe of Windows version.

    Thank you

    Sergiusz

Maybe you are looking for