Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread SELECT INTO & .IDX
Fri, Feb 19 2010 5:33 AMPermanent Link

Eeman Khan
sTableName := C:\Temp\Data\Transactions  

Q.SQL.Add('SELECT * INTO "'+sTableName+'"');
Q.SQL.Add('FROM "Transactions"');
Q.ExecSQL;

did not copy index into new table, before Encryption i copy *.idx files using

Win95Copy(Self.Handle, DatabasePath+'\*.idx', ePath.Text, False, False);

and after that i repair the database was worked fine,

but now Not valid table msg. appear.
how to export index too.
waiting for the reply,



regards,
Eeman Khan
Fri, Feb 19 2010 7:39 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Eeman


>but now Not valid table msg. appear.
>how to export index too.
>waiting for the reply,

Basically you can't. You need to create the indices one the table has been created.

The only other thought I have is to use a table rather than a query and use the CopyTable statement which I think does copy the indices.

Roy Lambert [Team Elevate]
Fri, Feb 19 2010 8:08 AMPermanent Link

"Robert"

"Eeman Khan" <e4eeman@hotmail.com> wrote in message
news:2D86CE00-7D68-4C91-843E-F4B64A141A3C@news.elevatesoft.com...
> sTableName := C:\Temp\Data\Transactions
>
> Q.SQL.Add('SELECT * INTO "'+sTableName+'"');
> Q.SQL.Add('FROM "Transactions"');
> Q.ExecSQL;
>
> did not copy index into new table, before Encryption i copy *.idx files
> using
>
> Win95Copy(Self.Handle, DatabasePath+'\*.idx', ePath.Text, False, False);
>
> and after that i repair the database was worked fine,
>
> but now Not valid table msg. appear.
> how to export index too.
> waiting for the reply,
>
>

Several ways to do this. The simplest would be to add CREATE INDEX
statements to your SQL. Or you could have a table already created, do an
empty table on sql, then insert the selects instead of using select into.
Depends on your situation. But select into builds a brand new table, which
is not necessarily a copy of the old table - in fact obviously a select can
bring in data from a combination of tables via joins, so the idea of
"copying the index" makes no sense.

Robert


Fri, Feb 19 2010 4:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Eeman,

Roy is correct - if you want a copy of the table, use the
TDBISAMTable.CopyTable method.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image