OK, the workaround would be: rename table to a temporary name, create new
table with the long column, copy temp table over to new table.
In the end, I want to have an empty string as the value for the LONG column
in all rows (i.e. not null values).
The problem is: I created the new table with "not null default ''" for the
LONG column, so that the empty string will be taken as default value for the
LONG column. Now when I try to copy the contents into the newly created
table using "insert into <new_table> (<col>,...) select <col>,... from
<temp_table>", the whole database crashes completely with error 800, both
using JDBC and SQL Studio. It has to be restarted manually afterwards.
On the other hand, when I omit the default value on creating the table and
try "insert into <new_table> (<col>,..,<long_col>) select <col>,..,'' from
<temp_table>", I get an "SQL statement not allowed for column of data type
LONG".
The same happens when I allow null values for the LONG column, copy the rows
over and then try "update <table> set <long_col>=''".
When I did a test with a dummy table containing a LONG column, I wasn't able
to update the LONG value for a certain row _at_all_. The third of the
following statements fails with "SQL statement not allowed for column of
data type LONG":
create table test (eins varchar(255), zwei long)
insert into test values ('einsvalue', 'zweivalue')
update test set zwei='hallozwei' where eins='einsvalue'
I assume there must be a way of updating a LONG value, so what's my mistake?
-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]Im Auftrag von Anhaus,
Thomas
Gesendet: Donnerstag, 7. M�rz 2002 10:20
An: [EMAIL PROTECTED]
Cc: '[EMAIL PROTECTED]'
Betreff: RE:Adding a LONG column with ALTER TABLE
Joerg von Frantzius wrote :
>Hi all,
>as it would mean a show-stopper with SAPDB for us, I'd like to ask whether
>there is any way of adding a column of type LONG to an existing table. When
>I try to do it with ALTER TABLE, I get an "[-7032] (at 32768) SQL statement
>not allowed for column of data type LONG:Langtext" error.
>Is it definitely not possible to add a column of type LONG to an existing
>table?
Sorry, at present you have no chance to add a column of dataype LONG to a
table via
the <alter table statement>.
Thomas
---
Thomas Anhaus
SAPDB, SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general