Subject Re: Problem with SKIP keyword
Author neczusia
> > I have a problem with keyword 'SKIP'. I installed newer version
of
> > Firebird - 1.0. I have column in one of the tables named 'SKIP'.
I
> > cannot do anything with that column, because 'SKIP' is now new
> > keyword! I want to 'move' data from that column to another and
then
> > drop it, but none of approaches works:
>
> What exacly doesn't work? Do you get some errors or the server
crashes
> or what?

The main probrem is with 'SKIP' word - the error message is:
----
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 38
SKIP
Statement: update TABLE_1 set NEW_SKIP = SKIP;
----

It deesn't matter if I use skip in quotes, or without, with table
name before it - or without. It doesn't work at all!

I tried to execute queries using IBExpert, InteractiveSQL, InterBase
Interactive SQL - the error always is the same.

> > 1.
> > update TABLE_1 set NEW_SKIP = SKIP;
>
> You need to commit here, since the data in skip column is
still "used"
> until you commit the transaction.

It's not a problem with commiting - see above.

> > 2.
> > update TABLE_1 set NEW_SKIP = TABLE_1.SKIP;
> > alter table TABLE_1 drop TABLE_1.SKIP;
>
> Now, this makes me wonder: Have you created a new column named
NEW_SKIP.

Yes, of course I did!

> Also, does the first statement fail or the second?

Both - as I already mentioned: it's 'SKIP' word, which makes a
problem: I have column named SKIP, and SKIP is also new keyword in
Firebird.

> > 3.
> > update TABLE_1 set NEW_SKIP = "SKIP";
> > alter table TABLE_1 drop "SKIP";
>
> If all fails, you can still create temporary table to copy the
data,
> drop the original table, recreate it with new_skip column, and then
copy
> the data from temporary table with (inserto into ... select
from ...).
> And drop the temporary table at the end.

I don't think it would work - see error message at the top of my
post. I can't do anything with the column which name is 'SKIP',
because its name is taken as a keyword and whole SQL is rejected.


Neczka