Results 1 to 4 of 4

Thread: SYSCOLUMNS: Nullable vs Is_Nullable

  1. #1
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,188

    SYSCOLUMNS: Nullable vs Is_Nullable

    The SYSCOLUMNS doc https://www.lianja.com/doc/index.php/SYSCOLUMNS has the following 2 definitions listed:



    and



    What's the difference?

    I can imagine a difference: in VFP there is no such thing as a NULL value of a table field. It can be empty, with a system-supplied default value, but it will never be NULL. So one of these might be that, and the other might be "this field cannot be set to NULL, and the record will not SAVE if it is."

    I understand the NULL and NOT NULL SQL Constraints: On and Off flags. I don't understand these two.

    Additionally, Nullable is list as N (2). I am puzzled.

    thanks,

    Hank
    Last edited by HankFay; 2018-10-13 at 17:17.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,359
    Blog Entries
    22
    Hi Hank,

    Lianja maintains a bit array for each row that denotes NULLs for the columns. This bit array is part of the row.

    I will check the code and let you know the difference if any. It may just be a legacy thing that was left in.
    Last edited by barrymavin; 2018-10-13 at 20:00.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,188
    Thanks.

    It gets even more interesting: SYSCOLUMNCONSTRAINTS also has two different NULL-related attributes:


    • NOT NULL
    • NULL SUPPORT


    The NULL SUPPORT does support the perspective of whether a Field can ever be a NULL, whether or not it's allowed to be NULL when a SAVE occurs.

    Hank

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,359
    Blog Entries
    22
    Hi Hank,

    Please see this doc.
    https://www.lianja.com/doc/index.php/SET_NULL

    With SET NULL OFF the table cannot contain NULL values.

    Then the column constraint NOT NULL can override.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us