Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
default for BYTE fields? |
Thu, Jan 19 2012 4:53 AM | Permanent Link |
Lucian | Hi,
How does one set a default value for a BYTE field? I thought this should work ALTER TABLE "table" ALTER COLUMN "ByteColumn" AS BYTE(1) DEFAULT X'01' NOT NULL however it gives with Error #700 An error was found in the default column expression at line 1 and column 1 (Expected NULL, Byte, GUID, or VarByte expression but instead found '01') none of this variations work ...AS BYTE(1) DEFAULT 1 NOT NULL ...AS BYTE DEFAULT 1 NOT NULL What I actually wabted was to set the default when I created the table but also nothing worked, so then I tried altering and now I'm stuck... Thanks Lucian |
Thu, Jan 19 2012 6:29 AM | Permanent Link |
John Hay | Lucian
> > How does one set a default value for a BYTE field? I thought this should work > > ALTER TABLE "table" ALTER COLUMN "ByteColumn" AS BYTE(1) DEFAULT X'01' NOT NULL > How about ALTER TABLE "table" ALTER COLUMN "ByteColumn" AS BYTE(1) DEFAULT cast(X'01' as byte) NOT NULL John |
Thu, Jan 19 2012 6:38 AM | Permanent Link |
Lucian | Thanks a lot, that works
Lucian |
Mon, Jan 23 2012 8:26 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Lucian,
<< How does one set a default value for a BYTE field? I thought this should work ALTER TABLE "table" ALTER COLUMN "ByteColumn" AS BYTE(1) DEFAULT X'01' NOT NULL however it gives with Error #700 An error was found in the default column expression at line 1 and column 1 (Expected NULL, Byte, GUID, or VarByte expression but instead found '01') >> This is a bug, and is fixed for the new build coming out this week. John's workaround is correct. -- Tim Young Elevate Software www.elevatesoft.com |
Wed, Jan 25 2012 7:22 AM | Permanent Link |
Lucian | >This is a bug, and is fixed for the new build coming out this week.
Cool! Lucian |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |