Hello Milen,

this is indeed a bug and will be fixed in one of the next releases (*not* in the 
release that is due in the next couple of days).

However there is a simple workaround: Do not add long columns and columns with 
defaults in the same Alter Table statement but use two separate statements instead.

You should also note that it is not possible to add a long column and assign it a 
default value within an Alter Table Add statement. To achieve this, first add the long 
column (without any default) and then set the default value using Alter Table Modify.
However, the Null value is treated specially, so it is possible to specify the Null 
value as a default for Long columns (as you did in your example). On the other hand, 
this is quite superfluous as the Null value is implicitly set as the default value as 
long as no other default has been specified.

Best wishes,

Martin.
SAP Labs, Berlin

> -----Original Message-----
> From: Milen Manev [mailto:[EMAIL PROTECTED]
> Sent: Mittwoch, 5. M�rz 2003 09:07
> Subject: Add column with default and LONG column to a table
> 
> 
> Hi,
> 
> I have problem to add column with default value and LONG 
> column to a table.
> My table is:
> create table bug_add_columns (ch char (20))
> I try to add two columns - one varchar column with default 
> value and one
> LONG column.
> alter table bug_add_columns add ( ch1 VARCHAR (80) DEFAULT 
> 'def_val'  null ,
> cl LONG null )
> when executing this statement with SQL Studio error occured:
> 
> ---------------------------
> error
> ---------------------------
> Database error occured:
> Native error: -807
> Text:         [SAP AG][SQLOD32 DLL][SAP DB]Communication link 
> failure;-807
> Connection down, session released.
> ---------------------------
> OK   
> ---------------------------
> 
> and SAP DB service stops.
> 
> if I change type of column with default value or change 
> default value error
> occured again.
> 
> if I remove default value - all is OK.
> if I add only first column with default value - all is OK
> 
> 
> I am using:
> Kernel 7.4.3 Build 010-120-035-462
> Runtime environment W32/INTEL Build 010-120-035-462
> SQL Studio 7.4
> SQLSTUDIOODBC 7.04.03.00
> 
> Milen Manev
> 
> -- 
> +++ GMX - Mail, Messaging & more  http://www.gmx.net +++
> Bitte l�cheln! Fotogalerie online mit GMX ohne eigene Homepage!
> 
> _______________________________________________
> 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

Reply via email to