Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Alter Table
Wed, Jan 28 2009 12:04 PMPermanent Link

"Malcolm"
D2009 unicode

I can't work out how to alter a temporary table.  Frown

I have a series of queries in which I create a temporary table, load
some records, then use navigation to edit the data in one column.

Next I try to alter the temp table to add an index .. but I get an
error '.. table "STemp1" does not exist.

But subsequent queries on that temp table run just fine.

So what's the trick to, or why the ban on, altering a temporary table?

The query at 'fault' is just:
 ALTER TABLE "STemp1"
 ADD CONSTRAINT "PrimaryKey" PRIMARY KEY ("SO");

--
Wed, Jan 28 2009 12:20 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Malcolm,

ALTER TABLE is not allowed for temporary tables.
If you need to have constraints for a temporary table you must define
them at the moment you create it. After that you can only DROP the table
or CREATE/DROP indexes on it.

--
Fernando Dias
[Team Elevate]
Wed, Jan 28 2009 12:37 PMPermanent Link

"Malcolm"
Fernando Dias wrote:

> ALTER TABLE is not allowed for temporary tables.
> If you need to have constraints for a temporary table you must
> define them at the moment you create it. After that you can only
> DROP the table or CREATE/DROP indexes on it.

Thanks Fernando, I was beginning to suspect this because it did work
if I added the index/constraint at the time of creation.

Oh, well, I guess I need a new strategy ...
.... and I suppose Tim can't have a better error message if the Cat
does not know about temp tables.

Malcolm

--
Wed, Jan 28 2009 1:11 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Malcolm


What about using memory tables? Those you can do everything to.

Roy Lambert [Team Elevate]
Wed, Jan 28 2009 1:34 PMPermanent Link

"Malcolm"
Roy Lambert wrote:

> What about using memory tables? Those you can do everything to.
>
> Roy Lambert [Team Elevate]

Hi Roy

Yup, I am still mulling things over .. and experimenting.
I was caught by surprise over the Alter Table.  
But CREATE INDEX works .. but I then get a metadata error later.
It's a learning curve .. if you can call a cliff a curve. Surprised

--
Wed, Jan 28 2009 1:45 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Malcolm

>Yup, I am still mulling things over .. and experimenting.
>I was caught by surprise over the Alter Table.
>But CREATE INDEX works .. but I then get a metadata error later.
>It's a learning curve .. if you can call a cliff a curve. Surprised

I remember that well Smiley There are still a few precipices that I find from time to time.

Roy Lambert
Sun, Feb 8 2009 9:54 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Malcolm,

<< But CREATE INDEX works .. but I then get a metadata error later. >>

What metadata error are you referring to ?  CREATE INDEX should work fine on
temporary tables.

--
Tim Young
Elevate Software
www.elevatesoft.com

Sun, Feb 8 2009 6:44 PMPermanent Link

"Malcolm"
Tim Young [Elevate Software] wrote:

> Malcolm,
>
> << But CREATE INDEX works .. but I then get a metadata error later.
> >>
>
> What metadata error are you referring to ?  CREATE INDEX should
> work fine on temporary tables.

Hi Tim

Sorry been out of town.  Actually I can't remember exactly what the
error was and I am now doing it another way so .. <shrug>.  My error
most likely - still a newbie on EDB.

Malcolm

--
Image