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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:45:58+00:00 2026-06-08T20:45:58+00:00

I am relatively new to SQL and only dabble with it when it is

  • 0

I am relatively new to SQL and only dabble with it when it is required. I have done some research on this but have limited success. I need to remove the tablespace references from the code. The settings already exist in the database for a default tablespace. By the way it is an Oracle database.

If I have these lines of code:

EXECUTE IMMEDIATE 'CREATE TABLE RAND_CATEGORY(
-------- insert random vars ---------------
CONSTRAINT RAND_CATEGORY PRIMARY KEY(cat_id,ver_num)
USING INDEX TABLESPACE VG_NDX ENABLE
)TABLESPACE VG_DATA';

Here’s what I have so far:

EXECUTE IMMEDIATE 'CREATE TABLE RAND_CATEGORY(
-------- insert random vars ---------------
CONSTRAINT RAND_CATEGORY PRIMARY KEY(cat_id,ver_num)
USING INDEX TABLESPACE VG_NDX ENABLE
)';

My question is, should I remove the entire line:

USING INDEX TABLESPACE VG_NDX ENABLE

Or should I just remove the “TABLESPACE VG_NDX” and leave it as:

USING INDEX ENABLE

Keep in mind that I am new to this and I just need help with this. I have been learning SQL for the past 2 weeks and tablespaces are a bit funky to me. Thanks in advance! 😀

  • 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-08T20:46:00+00:00Added an answer on June 8, 2026 at 8:46 pm

    The USING INDEX clause allow to have more control over the constraint associated index creation, see http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm.
    In your case the TABLESPACE storage clause.

    If you want to let Oracle use the default tablespace you can remove the USING INDEX clause entirely leaving ENABLE.

    Although in a CREATE TABLE a primary key constraint associated index is automatically enabled (unless I missed something) so I can’t see any point of keeping the ENABLE.

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

Sidebar

Related Questions

I'm relatively new to Android but I just cant google this. I have following
Im relatively new to the Android world but I have a quick question. I
I'm relatively new to sql so this may probably come off as a simple
I'm relatively new to C# and SQL work and I currently have an application
I am relatively new to using SQLite on Android. I have some experience with
Forgive me as I'm relatively new to SQL. But I'm trying to take modified
I am relatively new to sql and asp. My problem is that i need
I'm relatively new to SQL, so please forgive me if this is a dumb
I'm relatively new to SQL so forgive my ignorance... I have three tables, SRS_CAP,
I'm relatively new SQL queries, and I'm trying to join two tables in order

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.