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 8417761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:08:32+00:00 2026-06-10T02:08:32+00:00

I have a schema, named BILL, and in this schema all the tables have

  • 0

I have a schema, named BILL, and in this schema all the tables have a column named ID. I need a way to delete the row from all the tables, where ID = ‘test’. There are a lot of schemas, so it is important that i only delete them from BILL. There are tables that don’t contain a test row too if it matters. This is an oracle database.

I couldn’t figure out how to do this with sql. Maybe pl/sql? Any thoughts?

  • 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-06-10T02:08:33+00:00Added an answer on June 10, 2026 at 2:08 am

    I’d go with execute immediate:

    begin
       for t in (select table_name from dba_tables where owner = 'BILL') loop
    
           execute immediate 'delete from ' || t.table_name || 
                             ' where id = ''test''';
    
       end loop;
    end;
    /
    

    This should work if all tables in that schema have a column name named id (as you indiciated is the case). Otherwise, you should join with dba_tab_columns to make sure to only select tables that have such a column.

    It will fail, too, if id is a primary key that other tables reference. In that case you could embed the execute immediate into a

    begin
      execute immediate '....';
    exception when others then
      dbms_output.put_line('failed to delete in ' || t.table_name);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a column named name which is present in all tables in mysql
I am trying to select all tables that do not have column named 'unique'.
Considering that I have a Schema named SBST I want to find all empty
I have two tables, both named as say, Employee in two different schema HR
I named a schema wrong, and all the tables are created with a schema
I have a table named Info of this schema: int objectId; int time; int
I have a table which have schema like this id name 1 jack 2
Schema: Users ID Name Password Address ID Street UserID Both tables have an ID
We have recently improved the schema of our production database, changing column names and
i have mongoose schema named administrator var administratorSchema = new mongoose.Schema({ username : String,

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.