How to truncate 1000 rows from a table of 7000 lines?

Hello

Please give me a quick answer to truncate the 1000 rows from a table of 7000 lines... I don't want to truncate the entire table

Thank you all for the valuable support,

My activity is still ongoing... Somehow my client was not specific about what lines are deleted. It has no date column in the table to delete records by date...

The table contains information about the error logs, so he wanted to keep a few lines and remove the rest... and then copy the table to another database.

So right now using this query:

SQL > delete (select * from ) where rownum<>;

Once again thank you to all...

Tags: Database

Similar Questions

  • How to remove a column from a table in a dell identtiymananger 7.0

    How to remove a column from a table in a dell identtiymananger 7.0

    Hello

    In Version 7 of the removal of a single custom column can be accomplished by a stored procedure, available in the database called: QBM_PColumnDrop

    Hope that helps.

    Cordially Fatih

  • How NOT to restrict no rows from two tables

    I have two identical paintings invoice and payment. The only difference is Invoice_id Payment_id, Invoice_Amt and Payment_Amt columns displaying the amounts and different IDS. Bank_ids, names, account_types are the same. Table Invoice has 3 rows and payment 2. Just, which means that there are 3 generated invoices, but the Bank has received 2 payments. I want to show Invoice_Amt and Payment_Amt using the sql query. But its gives me total 6 rows. Whereas, I want 3 of the invoice and 2 rows of table of payment to show by-side.

    CREATE TABLE Bill
    (invoice_id NUMBER
    bank_id NUMBER,
    bank_name VARCHAR2 (256),
    invoice_amount NUMBER);
    /
    -Invoice table has 3 lines showing 3 invoice AMT

    Payment of CREATE TABLE
    (payment_id NUMBER
    bank_id NUMBER,
    bank_name VARCHAR2 (256),
    Payment_amount NUMBER);
    /
    -Payment table has 2 lines showing 2 payments

    After executing this statement sql below, I get 6 rows:
    Select inv.invoice_amount, pymt.payment_amount in the invoice inv, dated payment where inv.bank_id = pymt.bank_id;
    How can I show 3 rows for the invoice and 2 payment... ?
    Thank you.
    select  inv.invoice_amount,
            pymt.payment_amount
      from  (
             select  invoice_amount,
                     bank_id,
                     row_number() over(partition by bank_id order by invoice_id) rn
               from  invoice
            ) inv FULL OUTER JOIN
            (
             select  payment_amount,
                     bank_id,
                     row_number() over(partition by bank_id order by payment_id) rn
               from  payment
            ) pymt
            ON (inv.bank_id = pymt.bank_id and inv.rn = pymt.rn)
    /
    

    SY.

  • LOV in richeTableau resets the value after the deletion of rows from the table

    Hello. I'm on 11g R2

    I have a table with columns in the box and a button in the toolbar that removes the lines checked

    I have build it based on the following article in her string code

    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/index-101235.html


    When I run the "delete" button I execute the following code (taken as is article)


    public void deleteSelectedRows() {}

    create a second line, the value do not affect all lines

    used in ADF

    Set of rows duplicateRowSet = this.createRowSet ("duplicateRowSet");

    first row to avoid "the attempt to access the value of lines."

    exception line was dead.

    duplicateRowSet.first ();

    retrieve the current row of the table for after

    re-running the VO

    Line currentRow = this.getCurrentRow ();

    Boolean currentRowDeleted = false;

    get all rows that have the transoent attribute

    "MarkForDelete' set to true

    Row [] rowsToDelete =

    duplicateRowSet.getFilteredRows ("MarkedForDelete", true);

    If (rowsToDelete.length > 0) {}

    run only throizgh this code, if there is something to

    delete

    for (line rw: rowsToDelete) {}

    If the row is marked as the current in VO, ts value

    Boolean flag

    If (rw.getKey () .equals (currentRow.getKey ())) {}

    currentRowDeleted = true;

    }

    remove the line - do not yet commit

    RW. Remove();

    }

    rerun VO

    this.executeQuery ();

    reset the current line if it has not been removed

    If (! currentRowDeleted) {}

    this.setCurrentRow (currentRow);

    }

    duplicateRowSet.closeRowSet ();

    }

    }

    "MarkedForDelete" is a transient attribute used to mark the line delete

    The lines are removed very well.

    The problem is with lines that I do not delete.

    For example I LOV column. I chose the value LOV in a few lines, and after that choose to delete several lines (not the same lines where I modified the LOV) but some other lines.

    After I click "delete", the lines that I marked to remove deleted indeed, but the value of the LOV in other rows (I have not scored for delete) are disabled.

    How to preserve value LOV so it will remain also after I deleted some lines?

    P.S. I've tried autosubmit = "true" - it did not help

    It is expected because I see that you rerun the query.

    Once you re - run, it retrieves from the database again. Thus, your values are lost because they are not posted.

    I don't think that run query is necessary, try to have a programmatic part trigger on the table after you remove all of the lines.

    Thank you

    Alisson.

  • How to update one column from another table

    Hello

    We have some sellers who are defined as employees but without employee_id for some reason any.  So I would like to update the correct number of a view of HR records.  Here is what I tried:

    update of po.po_vendors x

    Define employee_id = (select apps.per_people_v7 person_id y)

    where y.first_name |' '|| y.last_name = x.vendor_name)

    Error received: a row subquery returns more than one line.

    If I use this instruction to check, I'm correct employee_id or person_id home:

    Select apps.per_people_v7 person_id y, po.po_vendors x

    where y.first_name |' '|| y.last_name = x.vendor_name

    When I checked/compared with some old posts here, I could not just see where I did mistake.  Please notify.

    Thank you

    Ning

    Because for the same vendor id, you have a (employee id) id of the person twice in the target table. As Boneist said "fix data, difficulty of the request, fix the requirement...". »

    How many sellers are there in your target table?

  • How to adapt the rows in the table spans several pages in proportion to an image?

    Hi all

    I have a fairly large excel file (more than 2000 lines) imported, and the resulting table spans more than 150 pages.

    The problem is that the lines don't always fill the height of the text block (height of 9.5 ") on every page.

    I don't like that the lines are of different sizes. I want just the lower edges of tables on each page to be in the same place.

    By dragging the line down with the SHIFT key does not work if the table spans several pages/text blocks.

    Is it possible to force the selected lines (or stored in a block of text) proportionally fill their block of text?

    It is really not any function automatic adjustment that apply at the height of the row in the table directly, then I suspect that you're not going to find a way to do this is automatic.

    If it was my document, I would consider (something like) do this:

    Find the highest line in the table. (Or, perhaps that if there is some exceptionally high lines; unobtrusively manipulate them and use the 2nd or 3rd highest line as a reference.) Calculate the number of lines (max number of) of this size will fit in each text block. Divide the height of the block of text by this number to get a line height that adapts the same number of lines in each image. Then, select the entire table and all rows from this height. Follow up with the typographic settings that help uniform line height look resolutely.

  • How to set current row in the table after use the button tab on inputText

    Hi all
    My first post.., I am beginner in ADF and I'll try to explain my problem.

    For now we use ADF 11 g (11.1.1.4), in a jsff page I have a table with a column of inputText.
    On the the inputText valueChangeListener, I invoke a method in a bean viewScope that call an EJB method, make some services to the EJB on the modified line. After that, I update the VO and the table (because other values in the row have been changed) and reset the focus on the inputText even modified by the user with javaScript, because the focus was lost after updating.
    So far, everything works fine.

    When I use the arrow keys to change the selected line in the table, this is excellent work (focus is always in the inputText next or previous), but if the user tries the key tab allows you to change the current line, the inputText on the line that has the focus, but the current row in the table is not changed (I think that is normal).

    My question: How can I change the current line after the tab key in this case?

    I don't know if it is really clear, not easy to explain, do not hesitate to ask for more details.
    Thanks in advance.

    Hello

    My question: How can I change the current line after the tab key in this case?

    Use a client event to listen to the keyboard entry and intercept the tab. Use af:serverListener to call the server to set the rowKey on the table and deliver a PPR for the table to repaint

    See example 11 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples

    to learn more on how to use the client listener and the receiving server

    Frank

  • How to insert multiple rows in a table by the user (pl/sql)

    Hello
    I was trying to insert several rows in a table by a user by some pl/sql, but not every time entry. :/
    What is happening is that the program requires each time ask the user for the new value but the loop
    1 values inserts actually four times (the loop is run four times). can any point on what I am
    doing wrong or solutions will be fun ;)

    what I wrote here

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

    Set serveroutput on
    set verify off

    declare

    EmpNo number;
    EmpName varchar2 (20);

    Start

    because loop me in 1.4
    EmpNo: = & empno;
    EmpName: = '& empname';

    insert into values(empno,empname) of the employee;

    end loop;

    end;

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

    do not laugh at my code, I'm new to this oracle :D

    Thank you, prospects for the future for a response

    user13371438 wrote:
    Thanks for the info, looks like a nice tool will ;) try
    but I really want (my problem) in pl/sql

    Take a quick re-read my post above.

    PL/SQL is a process running on the database server. This process cannot interact with the client computer. He can't ask for user input, and it cannot display the output to the client. Client interface tools can only do. You are eager to get feedback from a user, if you need an interface tool to do. SQL * Plus can interface and application of entry, but only as variable substition, and it does not really provide a programming construct that allows you to run a program in a loop to do. Do this using SQL * Plus you must pair it with shell/dos scripting languages, but more ideally you should use an interface appropriate as Apex.

    I was wondering if it all works in pl/sql to release cached data (as fflush (stdin) in c ++)

    PL/SQL does not a customer entry, so there is no sense to have something to release the cached data. You pass the values of PL/SQL code using procedures or functions with parameters.

  • How can I insert data from another table into a table containing a timestamp column

    How you insert data from another table in a table if the target table contains a timestamp column. I tried to set the default value of GETDATE() column in the target table, but it does not work.


    I use MS SQL

    Sorry, I managed to get around this by inserting null as the value

  • A block in Oracle may contain data rows from multiple tables?

    Hi in my discussion with one of the DBA, a point came that is a block shouldn't have several tables lines...

    Is this true? I read in one of the OTN thread (I don't exactly remember the name of the thread) that a block can have data from several tables. If it does not, what is the table block directory mean?

    Please let know us your opinion.

    Thank you

    CSM

    Hi all

    See the last 12 c here (http://docs.oracle.com/cd/E16655_01/server.121/e17633/logical.htm#CNCPT004). They have explicitly mentioned the term 'CLUSTER' here.

    This confusion was caused by the incorrect documentation and they corrected it

    Thanks for everyone to share their points of view.

    CSM

  • How to insert a row into the table from an entity class

    I use JDeveloper 11.1.2.3.0 using ADF.  I would like to insert a row in Table B, when A table is inserted into the database based on a value selected by the end user.  I could do in a database trigger, but I would try in the ADF. I think that the best place to do it would be in the entity based on the table A class. I could override the doDML method and search for DML_INSERT

    and make the table insert B here, but I don't know the best way to achieve this.  I guess I want to avoid using a SQL "insert". I'm new to ADF and it can be difficult to get

    a question using the appropriate terminology. I hope this makes sense.

    Hello

    Check out this blog: http://andrejusb.blogspot.com/2008/02/complex-insert-in-easy-way.html

    Arun-

  • How to find how the number of rows in the table of all the

    Hi all,

    Is it all tables $ v of information on how many rows the table holds?


    Thank you and best regards,
    Delphine K

    Vijay

    It does not reflect the exact number of lines because they don't are filled whenever there is a record inserted instead they are updated when tables are analysed

    If you insert a record and compare the two ALL_tables and count (*) you can find the difference

      1* select num_rows,owner from dba_tables where table_name='LOGONTRIGGER'
    SQL> /
    
      NUM_ROWS
    ----------
    OWNER
    --------------------------------------------------------------------------------
    
    SYS
    
     analyze table LOGONTRIGGER compute statistics;
    
    SQL> select num_rows,owner from dba_tables where table_name='LOGONTRIGGER';
    
      NUM_ROWS
    ----------
    OWNER
    --------------------------------------------------------------------------------
          2961
    SYS
    

    There is always difference

  • delete rows from two tables

    Hello

    My main table is:

    create table CvProperties(
    cv_id number(14) primary key,
    user_id number(14) constraint Cv_fk1 references users(user_id),
    cat_id number(14) constraint Cv_fk2 references CvCategories(cat_id),
    employerOrAgent_id number(14) constraint Cv_fk3 references employerOrAgent(employerOrAgent_id),
    staff_id number(14) constraint Cv_fk4 references staff(staff_id),
    cvDate timestamp(0) default sysdate,
    cvName varchar2(230),
    status number(3),
    prev_cvId number(14),
    isEdited number(2),
    cvSource number(2) /**website, employer, agent, staff**/
    );
    

    Detail table is:

    create table cvDetails(
    cd_id number(14) primary key,
    cv_id number(14) constraint education_fk references CvProperties(cv_id),
    nationality varchar2(230),
    objectives varchar2(3900),
    name varchar2(230),
    fatherName varchar2(230),
    motherName varchar2(230),
    dob varchar2(230).
    gender varchar2(230),
    mStatus varchar2(230),
    passportNo varchar2(110),
    email varchar2(230),
    phone varchar2(45),
    mobile varchar2(25),
    address varchar2(2500),
    state varchar2(230),
    zipCode varchar2(230),
    city varchar2(230),
    education clob,
    experience clob,
    skills clob,
    languages varchar2(1400),
    hobbies varchar2(3200),
    achievements varchar2(3900),
    references varchar2(3900));
    

    I'm trying to delete the cvs that have no email + mobile + phone:

    select COUNT(*) from cvDetails where email is NULL AND mobile IS NULL AND phone IS NULL;
    

    This query shows 4814 CVs.

    How can I run that check if the e-mail, phone mobile, is null then remove cv of the two tables in query?

    Please notify

    https://www.Google.com/webhp?hl=en&tab=WW#hl=en&q=Oracle+on+delete+cascade

  • Delete rows from a table in expansion

    Hello

    I have a table in expansion that allows users to click on a button '+' of the line to add as many lines.  The table contains mandatory fields.  There is an option button in another part of the form if the value 'No', the whole of the section containing the table is hidden.  I need to remove extra lines, that the user may have added to the table before selecting that 'No' answers, leaving only the first three ranks (title 2 rows and the first line of data).  If the table had six names (total 8 rows) so I want to remove 7 rows. I have remove the value from the first row separately.  I tried something like that, but I couldn't make it work; I'm not a very experienced scripter.  Thank you.


    for (var oLen = Table1.nodes.length; oLen > 3; t ++) {}

    Table1.parent.parent.instanceManager.removeInstance (oLen);

    }



    Hello

    There is a mistake in your statement.

    You start the last instance of the line and you want to remove all the lines from the last to the 3rd row...

    You must change your value when you remove 1 row, but instead to change the value of oLen you change the variable "t".

    Also if you are a beginner as a last resort, and down to the third row, you can decrease the index you use rather than increase it.

    So you're code need some minor changes, and it should look like this:

    for (var Table1.parent.parent.instanceManager.count - 1; oLen = oLen > 3; oLen-) {}

    Table1.parent.parent.instanceManager.removeInstance (oLen);

    }

    I hope this helps!

  • need to remove duplicate rows from a table

    Hi gurus,

    I'm using oracle 11.2.0.3.

    SQL > desc osstage. S_EVT_ACT_X;

    Name                                      Null?    Type

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

    ROW_ID NOT NULL VARCHAR2 (15 CHAR)

    LAST_UPD NOT NULL DATE

    PAR_ROW_ID NOT NULL VARCHAR2 (15 CHAR)

    ATTRIB_17 NUMBER (22.7)

    DATE OF ATTRIB_26

    ATTRIB_02 VARCHAR2 (100 CHAR)

    PROCESS_TIMESTAMP TIMESTAMP (6);

    now, when I give the command below, it gives error as someone has disabled the constraint accidentally.

    change the table s_evt_act_x S_EVT_ACT_X_P1 enable constraint;

    Error from line 3 in order:

    change the constraint of table s_evt_act_x activate S_EVT_ACT_X_P1

    Error report:

    SQL error: ORA-02437: impossible to validate (OSSTAGE. S_EVT_ACT_X_P1) - primary key violated

    02437 00000 - "can't validate (s.%s) - primary key violated."

    * Cause: attempted to validate a primary key with duplicate values or null

    values.

    * Action: remove duplicates and nulls before enabling a primary

    key.

    You can guide me please with this question.

    Please see

    Script: Remove the duplicate of a Table (Doc ID 31413.1) lines

    How to find or remove the duplicate in a Table (Doc ID 1004425.6) lines

Maybe you are looking for