troubleshooting Question

Oracle Stored Procedure to Delete records from the tables

Avatar of khajah
khajah asked on
Oracle Database
7 Comments2 Solutions961 ViewsLast Modified:
Hi everybody,

I am new user to this community and new to database PLSQL coding also. I have requirement to write a stored procedure to truncate/delete the records from the existing tables.  we have 9 tables which loaded on daily basis  using oracle package(ETL) and every time it loads ,Load id will be inserted in the all the tables. This is the existing setup now.

My requirement now is:

1. I need to write stored procedure which ask user to select input parameter to truncate all the records or to delete sepecific load ID records .( Based on the user choice)

           a. If User select option one (full) i need to truncate all tables - so i can write truncate  
              block of code for this.
           b.If user select option 2 which is partial then it should ask again which load id you want  
              to delete. Based on the load id i will delete the records in all the tables.

I need syntax to derive this code. we need to promote this code to production in another 2 weeks. Friends, could you please help me to write this code. Please let me know if i need to explain more on this.

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros