Results 1 to 3 of 3

Thread: creating a column in DF Table Editor vs. SQL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2014
    Location
    Dallas, TX
    Posts
    79

    Default creating a column in DF Table Editor vs. SQL

    In the time since we migrated our Dataflex DB to Postgresql, I've always wondered why DF creates ASCII (and numeric) columns with NOT NULL and ''::bpchar as the default value (or "0" as default for numeric). In all of the SQL manager programs I've used, when creating a new column it defaults to allowing NULL values. Isn't this the same result?

    What's the reasoning behind using a default value? NOT NULL has no effect if there's always a default value used when creating a new record.

  2. #2
    Join Date
    Feb 2009
    Location
    Stuart, FL
    Posts
    5,321

    Default Re: creating a column in DF Table Editor vs. SQL

    DataFlex has no concept of nulls in the language sadly
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    IT Director at Balloons Everywhere

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  3. #3
    Join Date
    Feb 2009
    Posts
    1,175

    Default Re: creating a column in DF Table Editor vs. SQL

    DataFlex does not really know about nulls. It cannot (easily) distinguish between an empty string and a NULL value for example.

    In SQL world NULLs are very common and have impact on the way SQL works. Declaring columns as nullable has for example impact on performance. SQL engines treat nullable columns different when creating an execution plan. The DataFlex SQL drivers rely on indexes and sorting to get good performance. Allowing NULLS in columns has negative impact on performance.

    You can by the way configure if you want to create columns as nullable by specifying (DEFAULT_NULLABLE_* ) keywords in the driver configuration file (Mssqldrv.Int, Odbc_drv.int,DB2_drv.int). But this is considered advanced usage and not recommended unless you have very good reasons to do so.
    Best regards,
    Data Access Worldwide

    Martin Moleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •