Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4598832
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:27:18+00:00 2026-05-21T23:27:18+00:00

My DB knowledge is quite limited and I am trying to delete a row

  • 0

My DB knowledge is quite limited and I am trying to delete a row with the following query:

DELETE FROM table
WHERE column in (select sequence.CURRVAL FROM DUAL);

This is used in a .sql to clean up the database after integration tests are run in Maven. I have Googled it but still haven’t found an answer for the delete statement to work. Any help is appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:27:19+00:00Added an answer on May 21, 2026 at 11:27 pm

    You can’t use a CURRVAL in a DELETE statement, as you can read here: http://www.orafaq.com/wiki/ORA-02287

    But since you are using SQL scripts, you can do it like this in SQL*Plus:

    SQL> create table t( id number);
    
    Table created.
    
    SQL> create sequence seq;
    
    Sequence created.
    
    SQL> insert into t (id) values (seq.nextval);
    
    1 row created.
    
    SQL> column i new_value curseqval
    SQL> select seq.currval i from dual;
    
             I
    ----------
             1
    
    1 row selected.
    
    SQL> delete from t where id = &curseqval;
    old   1: delete from t where id = &curseqval
    new   1: delete from t where id =          1
    
    1 row deleted.
    

    Regards,
    Rob.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am quite limited in my knowledge of JavaScript. What I would like to
Not quite sure how to tackle this one as my knowledge is limited. However
There seems to be quite a bit of folklore knowledge floating about in restricted
My SQL knowledge is very limited, specially about SQLite, although I believe this is
For general knowledge and entertainment purposes I am trying to add some behavoiur to
first of all: my Maven knowledge is limited so please bear with me. ;-)
My knowledge of MVC and Razor is quite basic so I'm hoping its something
My security knowledge is kind of limited but I might learn something. I´m planning
I've spent a couple of days trying to solve this with limited success, I'm
Just started learning C++ and my knowledge is quite basic on IT. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.