Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread ALTER table problem
Fri, Feb 23 2007 4:58 AMPermanent Link

Ricardo Oliveira
Hi,

When I try to execute this query

select Field1, Field2, Field3 into "\memory\MemTable" from Table1
group by Field1, Field2
order by Field3, Field1
;
alter table "\memory\MemTable" drop Field2

DBISAM returns an error "Invalid GroupBy field '10' ....".

Is this a bug?

Using DBISAM C/S 4.25 Build 3.

Ricardo Oliveira
Fri, Feb 23 2007 7:48 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ricardo,

<< When I try to execute this query

select Field1, Field2, Field3 into "\memory\MemTable" from Table1
group by Field1, Field2
order by Field3, Field1
;
alter table "\memory\MemTable" drop Field2

DBISAM returns an error "Invalid GroupBy field '10' ....".

Is this a bug? >>

If you are using a table created using the INTO clause, then any alterations
that you make to it have to take into account some additional indexes that
DBISAM creates for ordering and grouping in the result set.  In this case,
you'll have to drop the special grouping index 'GroupBy' before you can
alter the table and drop any columns that are part of the index.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Feb 23 2007 10:44 AMPermanent Link

Ricardo Oliveira
Hi Tim,

Thank you for your help.
The behavior is the same of physical tables.

Ricardo Oliveira


Tim Young [Elevate Software] wrote:
> Ricardo,
>
> << When I try to execute this query
>
>  select Field1, Field2, Field3 into "\memory\MemTable" from Table1
>  group by Field1, Field2
>  order by Field3, Field1
>  ;
>  alter table "\memory\MemTable" drop Field2
>
>  DBISAM returns an error "Invalid GroupBy field '10' ....".
>
>  Is this a bug? >>
>
> If you are using a table created using the INTO clause, then any alterations
> that you make to it have to take into account some additional indexes that
> DBISAM creates for ordering and grouping in the result set.  In this case,
> you'll have to drop the special grouping index 'GroupBy' before you can
> alter the table and drop any columns that are part of the index.
>
Image