Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2002
    Posts
    5

    Unanswered: How do I Check for null fields?

    Hello,

    Im working on an administrator utility for a database, and I need to know a way for a just-created database to detect first-time run. If that is true, then my program will ask that the administrator enter their new password. But what I need to know is how to detect a blank field in SQL.


    ~~ Tc

  2. #2
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    189
    Hello,

    normally you can use IS NULL - means

    SELECT * FROM table WHERE field IS NULL

    or in procedures

    IF(var IS NULL) THEN

    But this depends on the database and the language that you use. Please give me hint which database you ar using.

    You are developing an adminstration software for relational databases. Can I see your work ? I am very interested in such programs

    Regards
    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  3. #3
    Join Date
    Apr 2002
    Posts
    5

    Smile Oh, oops...

    Hello,

    Im using SQL, that explenation will be adequate. And yes, I'll post my code when I have most of the kinks worked out.

    ~~ Tc

  4. #4
    Join Date
    Apr 2002
    Posts
    6
    Hi,
    Using IS operator u can check for balnk values in any type of column.
    eg:-
    select sal from emp where ename is null;

  5. #5
    Join Date
    Apr 2002
    Posts
    5

    Bam! 'er somethin'

    It would be better if everyone could stick to VB code please, Im having trouble understanding the relationship between the VB code and the SQL statements.


    ~~Tc


    Ps. Thanks robert.

  6. #6
    Join Date
    Feb 2002
    Posts
    2,232
    Blank and NULL are 2 different creatures. In VB to test for null - use the ISNULL function. If you are looking for an empty string then use: "".

    Good luck.

Posting Permissions

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