sqlsyntax-errorbdeparadox

"NOT NULL" column in Paradox DB?


Is there any way to prevent a null-fields in Paradox? When I try i exec.

CREATE TABLE  "users" (
user_id INTEGER NOT NULL
)

I get Capability not supported. (BDE error 12289). When there is no "NOT NULL" args - it's OK.
P.S. I work in SQL explorer (borland one), and I can't change it, cause it's part of the task.


Solution

  • The way to prevent a null-fields in Paradox is to just create the table.

    There is in fact no way to create null-fields in Paradox. Unlike most modern databases, the BDE does not allow or recognize NULLs.

    Paradox local SQL does not allow a NOT NULL constraint because it would not make any sense. Every table field is always NOT NULL.

    Paradox table structure does include a constraint to disallow BLANKs, but you cannot set it from a SQL statement. And a BLANK is a very different thing from a NULL.

    See also this question How does Paradox manage null and empty values?