• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Save a table with another name?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'd like to do a copy of a table in my DB.mdb with another name
but my problem is to do it with java's code.
Ex: I have the CUSTOMERS table in my personal.mdb and I want create a copy of CUSTOMERS with name CUSTOMERS_2005.
Is it possible?
 
author & internet detective
Posts: 40211
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Franco,
Welcome to JavaRanch!

Yes, you can do this through JDBC. You need to create a new table with the same schema. If you have the schema, you can use it. If not, you can use the metadata to get it. Then you insert all the records into the new table and delete the old table.

If you want more details about any of these steps, post here.
 
Franco Lucci
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but I have to create the classic
CREATE TABLE Person
(
LastName varchar(30),
FirstName varchar,
Address varchar,
Age int(3)
)
and then to put inside all recorsd of my old table ...
Is there a more simple way to do this? for example COPY Person IN Person_2005.
Yes ... if can you explain me better how i can to do take a schema table and create another table?
thank you very much ....
 
Franco Lucci
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks ... I resolved it with
"SELECT * INTO Customers_2005 FROM Customers"

thank you very much for your interest.

 
Jeanne Boyarsky
author & internet detective
Posts: 40211
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Franco,
Thanks for posting the final query.
 
What? What, what, what? What what tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic