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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:28:49+00:00 2026-06-18T01:28:49+00:00

I’m using Oracle 11g R2, I want to create some user tables. When i

  • 0

I’m using Oracle 11g R2, I want to create some user tables. When i run the query. It creates few tables and produces the java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an existing object Exception.

    Connection con=prepareConnection();
    Statement st=con.createStatement();
    StringBuilder sb=new StringBuilder(1024);
    sb.append("create table ").append(uname).append("(MESSAGES CLOB,LINKS VARCHAR2(150),FRIENDS VARCHAR2(50),COMMENTS CLOB,LIKES VARCHAR2(10),UNLIKES VARCHAR2(10),SHARES BLOB,QSTNS CLOB,ANS CLOB,UPDATES BLOB,THEMS VARCHAR2(100),WORDS CLOB,NOTIFICATION CLOB,REQUESTS VARCHAR2(100),TIPS CLOB,TAG VARCHAR2(50))");
    String Query=sb.toString();
    st.executeUpdate(Query);

    Statement st1=con.createStatement();
    StringBuilder sb1=new StringBuilder(1024);
    sb1.append("create table ").append(uname).append("VIALBUM(ALBUMID NUMBER NOT NULL, ALBUMNAME VARCHAR2(225) NOT NULL, CONSTRAINT ").append(uname).append("VIALBUM_PK PRIMARY KEY(ALBUMID)ENABLE)");
    String Query1=sb1.toString();
    st1.executeUpdate(Query1);

    Statement st12=con.createStatement();
    StringBuilder sb12=new StringBuilder(1024);
    sb12.append("CREATE INDEX ").append(uname).append("VIALBUM_INDEX ON ").append(uname).append("VIALBUM(ALBUMNAME)");
    String Query12=sb12.toString();
    st12.executeUpdate(Query12);

    Statement st11=con.createStatement();
    StringBuilder sb11=new StringBuilder(1024);
    sb11.append("create table ").append(uname).append("VIDEO(VIDEOID NUMBER NOT NULL, VIDEONAME VARCHAR2(225) NOT NULL, VIDEOFULL BLOB NOT NULL, VIDEODISC VARCHAR2(225), ALBUMID NUMBER NOT NULL, CONSTRAINT ").append(uname).append("VIDEO_PK PRIMARY KEY(VIDEOID)ENABLE)");
    String Query11=sb11.toString();
    st11.executeUpdate(Query11);

    Statement st13=con.createStatement();
    StringBuilder sb13=new StringBuilder(1024);
    sb13.append("ALTER TABLE ").append(uname).append("VIDEO ADD CONSTRAINT ").append(uname).append("VIDEO_").append(uname).append("VIALBUM_FK1 FOREIGN KEY(ALBUMID)REFERENCES ").append(uname).append("VIALBUM(ALBUMID)ENABLE");
    String Query13=sb13.toString();
    st13.executeUpdate(Query13);

    Statement st14=con.createStatement();
    StringBuilder sb14=new StringBuilder(1024);
    sb14.append("CREATE INDEX ").append(uname).append("VIDEO_INDEX ON ").append(uname).append("VIDEO (VIDEONAME)");
    String Query14=sb14.toString();
    st14.executeUpdate(Query14);

    Statement st2=con.createStatement();
    StringBuilder sb2=new StringBuilder(1024);
    sb2.append("create table ").append(uname).append("ALBUM(ALBUMID NUMBER NOT NULL, ALBUMNAME VARCHAR2(225) NOT NULL, CONSTRAINT ").append(uname).append("ALBUM_PK PRIMARY KEY(ALBUMID)ENABLE)");
    String Query2=sb2.toString();
    st2.executeUpdate(Query2);

    Statement st22=con.createStatement();
    StringBuilder sb22=new StringBuilder(1024);
    sb22.append("CREATE INDEX ").append(uname).append("ALBUM_INDEX ON ").append(uname).append("ALBUM(ALBUMNAME)");
    String Query22=sb22.toString();
    st22.executeUpdate(Query22);

Till above statements it executes correctly. And remaining statements are not executed.It throws the exception.

    Statement st21=con.createStatement();
    StringBuilder sb21=new StringBuilder(1024);
    sb21.append("create table ").append(uname).append("IMAGE(IMAGEID NUMBER NOT NULL, IMAGENAME VARCHAR2(225) NOT NULL, IMAGEFULL BLOB NOT NULL, IMAGEDISC VARCHAR2(225), ALBUMID NUMBER NOT NULL, CONSTRAINT ").append(uname).append("IMAGE_PK PRIMARY KEY(IMAGEID)ENABLE)");
    String Query21=sb11.toString();
    st21.executeUpdate(Query21);

    Statement st23=con.createStatement();
    StringBuilder sb23=new StringBuilder(1024);
    sb23.append("ALTER TABLE ").append(uname).append("IMAGE ADD CONSTRAINT ").append(uname).append("IMAGE_").append(uname).append("ALBUM_FK1 FOREIGN KEY(ALBUMID)REFERENCES ").append(uname).append("ALBUM(ALBUMID)ENABLE");
    String Query23=sb23.toString();
    st23.executeUpdate(Query23);

    Statement st24=con.createStatement();
    StringBuilder sb24=new StringBuilder(1024);
    sb24.append("CREATE INDEX ").append(uname).append("IMAGE_INDEX ON ").append(uname).append("IMAGE (IMAGENAME)");
    String Query24=sb24.toString();
    st24.executeUpdate(Query24);

    Statement st3=con.createStatement();
    StringBuilder sb3=new StringBuilder(1024);
    sb3.append("create table ").append(uname).append("MUALBUM(ALBUMID NUMBER NOT NULL, ALBUMNAME VARCHAR2(225) NOT NULL, CONSTRAINT ").append(uname).append("MUALBUM_PK PRIMARY KEY(ALBUMID)ENABLE)");
    String Query3=sb3.toString();
    st3.executeUpdate(Query3);

    Statement st32=con.createStatement();
    StringBuilder sb32=new StringBuilder(1024);
    sb32.append("CREATE INDEX ").append(uname).append("MUALBUM_INDEX ON ").append(uname).append("MUALBUM(ALBUMNAME)");
    String Query32=sb12.toString();
    st32.executeUpdate(Query32);

    Statement st31=con.createStatement();
    StringBuilder sb31=new StringBuilder(1024);
    sb31.append("create table ").append(uname).append("SONG(SONGID NUMBER NOT NULL, SONGNAME VARCHAR2(225) NOT NULL, SONGFULL BLOB NOT NULL, SONGDISC VARCHAR2(225), ALBUMID NUMBER NOT NULL, CONSTRAINT ").append(uname).append("SONG_PK PRIMARY KEY(SONGID)ENABLE)");
    String Query31=sb31.toString();
    st31.executeUpdate(Query31);

    Statement st33=con.createStatement();
    StringBuilder sb33=new StringBuilder(1024);
    sb33.append("ALTER TABLE ").append(uname).append("SONG ADD CONSTRAINT ").append(uname).append("SONG_").append(uname).append("ALBUM_FK1 FOREIGN KEY(ALBUMID)REFERENCES ").append(uname).append("ALBUM(ALBUMID)ENABLE");
    String Query33=sb33.toString();
    st33.executeUpdate(Query33);

    Statement st34=con.createStatement();
    StringBuilder sb34=new StringBuilder(1024);
    sb34.append("CREATE INDEX ").append(uname).append("SONG_INDEX ON ").append(uname).append("SONG (SONGNAME)");
    String Query34=sb34.toString();
    st34.executeUpdate(Query34);

Please any one tell me what this error tells.

  • 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-18T01:28:50+00:00Added an answer on June 18, 2026 at 1:28 am

    Sounds like you are trying to create an object of some kind with the same name as another – e.g. a table or a constraint, field etc.

    It looks like you have tried to create the same table twice here:

    String Query21=sb11.toString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am using JSon response to parse title,date content and thumbnail images and place
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only

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.