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

  • Home
  • SEARCH
  • 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 8960765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:43:57+00:00 2026-06-15T15:43:57+00:00

I am quite stuck here, need some guidance if it is possible! I have

  • 0

I am quite stuck here, need some guidance if it is possible!

I have this table:

doctor_details (doctor_id, name, surname, date_of_birth)

and I just want to create a procedure that adds to it 30 doctors in the following form:

doctor_id  name    surname    date_of_birth
-------------------------------------------
01         John-01 Surname-01 2001-01-01
02         John-02 Surname-02 2002-01-01
03         John-03 Surname-03 2003-01-01

I know how to do it one by one obviously, but i need some iteration here to put it into a procedure somehow, so when I call it to instantly increase these rows!

  • 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-15T15:43:58+00:00Added an answer on June 15, 2026 at 3:43 pm

    Here is the tested code::

     drop table doctor_details;
        create table doctor_details 
        (doctor_id varchar2(20),
         name varchar2(100), 
         surname varchar2(100), 
         date_of_birth date);
    
        drop sequence doctor_id_seq;
        create sequence doctor_id_seq 
        start with 1 
        maxvalue 99999999
        cache 100;
    
    
    
        alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
    
    
    
            create procedure doctors_details_add as
        begin
                  for x in 1..30 loop
                  insert into doctor_details (doctor_id, name, surname, date_of_birth)
                  values
                  (lpad(doctor_id_seq.nextval,2,'0'),
                   'John'||'-'||lpad(doctor_id_seq.currval,2,'0'),
                   'Surname'||'-'||lpad(doctor_id_seq.currval,2,'0'),
                    add_months(to_date('2001-01-01','YYYY-MM-DD'),12*doctor_id_seq.currval)
                   );
                  end loop;
        end doctors_details_add;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am stuck with something quite simple but really annoying: I have an xml
I know this question might sound quite silly, but I somehow found myself stuck
Quite some time i`ve learnt MVC. I have seen various techniques to post data
I am a bit stuck on how I should model this out. Here is
This has been bothering me for quite some time. I'm simply trying to change
I've stuck with one quite tricky problem. I have list of products from different
I have a Canvas that i draw text on. (this is quite advanced i
I have been working on XNA for quite some time, but was asked to
I have found similar problems to this here: Count the number of words in
I have a MySql table containing stock quotes (stock_symbol, quote_date, open_price, high_price, low_price, close_price)

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.