Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 7 of 7 total |
How to copy table using SQL? |
Fri, Mar 2 2007 11:50 AM | Permanent Link |
Sam Davis | Some databases can copy a table using sql like:
create table newtable select * from oldtable; or create table newtable like oldtable; Is it possible to do this in DBISAM? TIA Sam |
Fri, Mar 2 2007 12:33 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Sam
SELECT INTO I can never remember the formant so check it out in the manual Roy Lambert |
Fri, Mar 2 2007 1:22 PM | Permanent Link |
"Robert" | "Sam Davis" <sammyd432@yahoo.com> wrote in message news:F92F49DF-43BC-47E0-AA1F-366FBD081137@news.elevatesoft.com... > Some databases can copy a table using sql like: > > create table newtable select * from oldtable; > > or > > create table newtable like oldtable; > > Is it possible to do this in DBISAM? > AFAIK, you can not copy the indexes you will have to create them. Otherwise, for the table structure and the data, is is simply SELECT * FROM OLDTABLE INTO NEWTABLE; If you want an empty table, add an impossible WHERE clause, such as WHERE FALSE = TRUE Robert |
Sat, Mar 3 2007 2:52 AM | Permanent Link |
Sam Davis | Roy Lambert wrote:
> Sam > > SELECT INTO > > I can never remember the formant so check it out in the manual > > > Roy Lambert > Roy, I found it. select * into tablenew from tableold; which has the phrases in the opposite order from what I'm used to. At least it works. Sam |
Sat, Mar 3 2007 11:55 AM | Permanent Link |
"Johnnie Norsworthy" | "Sam Davis" <sammyd432@yahoo.com> wrote in message
news:55589CB1-C05F-4490-A772-3D80A04C718B@news.elevatesoft.com... > select * into tablenew from tableold; Don't forget to create indexes if they are needed. |
Sat, Mar 3 2007 11:59 AM | Permanent Link |
Sam Davis | Johnnie Norsworthy wrote:
> "Sam Davis" <sammyd432@yahoo.com> wrote in message > news:55589CB1-C05F-4490-A772-3D80A04C718B@news.elevatesoft.com... > >>select * into tablenew from tableold; > > > Don't forget to create indexes if they are needed. > > Correct and I guess I'll have to do that manually. In MySQL they have a: create table newtable like oldtable; which is create the table structure including the indexes which is nice. As for now, I'm just using this SQL to create a backup of the data so I can eliminate the indexes for now. Thanks for the help. Sam |
Mon, Mar 5 2007 9:42 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Sam,
<< Some databases can copy a table using sql like: create table newtable select * from oldtable; or create table newtable like oldtable; Is it possible to do this in DBISAM? >> As mentioned already, use SELECT..INTO for this in DBISAM. ElevateDB offers CREATE TABLE AS and CREATE TABLE LIKE operations. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, September 17, 2024 at 04:19 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |