cancel
Showing results for 
Search instead for 
Did you mean: 

not null or null in LOCAL TEMPORARY TABLE

Former Member
2,486

Hi, i have a question, how come the code I type and the code the sybase debugger shows are different. The code I typed

 DECLARE LOCAL TEMPORARY TABLE cr_temp ( Name varchar(60),
                                            PartTypeNo varchar(30),
                                            Description varchar(60),
                                            JdnObjectNo varchar(100),  
                                            Brand varchar(40),
                                            ArticleReference varchar(100),
                                            State varchar(100),
                                            StatusCode varchar(15),
                                            ActualQTY numeric(16,2),
                                            QuantityInStock numeric(16,2),  
                                            QuantityReserved numeric(16,2),
                                            QuantityRequested numeric(16,2),
                                            QuantityAvailable numeric(16,2),
                                            StockItemID numeric(16,0),
                                            InventorylistID numeric(16,0),
                                            StockItemAllocatedToID numeric(16,0),
                                            Kardex varchar(8),
                                            Length numeric(5,2),
                                            Width numeric(5,2),
                                            Heigth numeric(5,2),
                                            Weigth numeric(16,2),
                                            Depreciationcode varchar(3),
                                            Value numeric(16,2),
                                            Value_Date date,
                                            ContainerListID numeric(16,0),
                                            ExtSerialNo varchar(40),
                                            MobilisationListID numeric(16,0),
                                            ATSValue numeric(16,2),
                                            ATSWeight numeric(16,2),
                                            CalibrationInfo varchar(30),
                                            Remarks varchar(2000)
                                          );

The code the debugger shows

declare local temporary table cr_temp(
    Name varchar(60) not null,
    PartTypeNo varchar(30) not null,
    Description varchar(60) not null,
    JdnObjectNo varchar(100) not null,
    Brand varchar(40) not null,
    ArticleReference varchar(100) not null,
    State varchar(100) not null,
    StatusCode varchar(15) not null,
    ActualQTY numeric(16,2) not null,
    QuantityInStock numeric(16,2) not null,
    QuantityReserved numeric(16,2) not null,
    QuantityRequested numeric(16,2) not null,
    QuantityAvailable numeric(16,2) not null,
    StockItemID numeric(16) not null,
    InventorylistID numeric(16) not null,
    StockItemAllocatedToID numeric(16) not null,
    Kardex varchar(8) not null,
    Length numeric(5,2) not null,
    Width numeric(5,2) not null,
    Heigth numeric(5,2) not null,
    Weigth numeric(16,2) not null,
    Depreciationcode varchar(3) not null,
    Value numeric(16,2) not null,
    Value_Date date not null,
    ContainerListID numeric(16) not null,
    ExtSerialNo varchar(40) not null,
    MobilisationListID numeric(16) not null,
    ATSValue numeric(16,2) not null,
    ATSWeight numeric(16,2) not null,
    CalibrationInfo varchar(30) not null,
    Remarks varchar(2000) not null,) on commit delete rows;

declare local temporary table QrySIATActualState(
    inventorylistid numeric(16) not null,
    statuscode varchar(5) not null,
    colorcodeid numeric(16) not null,
    code varchar(10) not null,
    quantity numeric(16,2) not null,) on commit delete rows;

As you can see the 'not null' is added for every field. To make matters even stranger, the allows_null_by_default is on. Any idea's on how to solve this.

Thx

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor

FWIW, the docs on the allows_null_by_default option tell that this option (usually ON) is

Off for Sybase Open Client and jConnect connections

May this be an issue here?