|
Home > Archive > SQL Anywhere database > October 2005 > Changing default value of datatype
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Changing default value of datatype
|
|
| Oliver Schulze L. 2005-10-27, 7:40 am |
| Hi,
it is posible to alter the default value
of a datatype?
Or should I drop/create the datatype?
Thanks
Oliver
| |
| Breck Carter [TeamSybase] 2005-10-27, 7:40 am |
| There is no ALTER DATATYPE, and you cannot DROP DATATYPE if there are
any columns using that datatype.
IMO datatypes aren't much use, and they can confuse developers who
need to know what the underlying data type really is. That's why
Foxhound shows the datatype/domain as a comment; e.g...
-- DBA.t (table_id 438) in ddd - Oct 18 2005 4:01:57PM - Foxhound ©
2005 RisingRoad
CREATE TABLE DBA.t ( -- empty
pkey /* PK */ INTEGER NOT NULL DEFAULT 0, -- domain x
CONSTRAINT ASA75 PRIMARY KEY (
pkey ) );
Breck
On 18 Oct 2005 12:44:27 -0700, "Oliver Schulze L."
<news.oliver@samera.com.py> wrote:
>Hi,
>it is posible to alter the default value
>of a datatype?
>Or should I drop/create the datatype?
>
>Thanks
>Oliver
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
| |
| Oliver Schulze L. 2005-10-27, 7:40 am |
| Hi Breck,
thanks for the comment.
I will do an audit of which table uses the datatype and then:
- create a similar temporal datatype
- modify all columns to use the temporal datatype
- drop, create the datatype
- modify all columns again to use the "modified" datatype
Regards,
Oliver
Breck Carter [TeamSybase] wrote:
> There is no ALTER DATATYPE, and you cannot DROP DATATYPE if there are
> any columns using that datatype.
>
> IMO datatypes aren't much use, and they can confuse developers who
> need to know what the underlying data type really is. That's why
> Foxhound shows the datatype/domain as a comment; e.g...
>
> -- DBA.t (table_id 438) in ddd - Oct 18 2005 4:01:57PM - Foxhound ©
> 2005 RisingRoad
>
> CREATE TABLE DBA.t ( -- empty
> pkey /* PK */ INTEGER NOT NULL DEFAULT 0, -- domain x
> CONSTRAINT ASA75 PRIMARY KEY (
> pkey ) );
>
> Breck
>
| |
| Breck Carter [TeamSybase] 2005-10-27, 7:40 am |
| Good idea, let us know if it works.
On 19 Oct 2005 14:44:51 -0700, "Oliver Schulze L."
<news.oliver@samera.com.py> wrote:
[color=darkred]
>Hi Breck,
>thanks for the comment.
>
>I will do an audit of which table uses the datatype and then:
>- create a similar temporal datatype
>- modify all columns to use the temporal datatype
>- drop, create the datatype
>- modify all columns again to use the "modified" datatype
>
>Regards,
>Oliver
>
>Breck Carter [TeamSybase] wrote:
--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/A...7/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
|
|
|
|
|