[SOLVED] HOW TO CHECK A FIREBIRD VARCHAR() FIELD IS EMPTY ? lazarus / 16-Databases ---------------------------------------------------------------------- finalist · 2016-01-07 14:20 FOR FIREBIRD TRIGGER IS THIS CORRECT: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IF FIELDofVARCHAR = ´´ THENBEGIN/* .......*/ENDOR THIS IS CORRECT: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IF FIELDofVARCHAR is NULL THENBEGIN/* .......*/END ---------------------------------------------------------------------- taazz · 2016-01-07 14:48 Quote from: finalist on January 07, 2016, 03:20:53 pmFOR FIREBIRD TRIGGER IS THIS CORRECT: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IF FIELDofVARCHAR = ´´ THENBEGIN/* .......*/ENSOR THIS IS CORRECT: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IF FIELDofVARCHAR is NULL THENBEGIN/* .......*/ENSBoth are correct and possible. In a new record with the field set to allow nulls and no value inserted yet the value will always be null. nothing is stopping you from passing and empty string to the varchar to empty it and not being null at the same time though. So which trigger are you talking about and how is this field defined/created? ---------------------------------------------------------------------- Zoran · 2016-01-07 14:48 Depending on what you actually want, they are both correct in PSQL (when you put the condition in parenthesis and change the last line from ENS to END). It is important that in Firebird (and, as far as I know, in all other RDBMS-s except Oracle), empty string ('') and null value are two different things. So... it really depends on what you actually want... To better understand null, read Firebird Null Guide If you want to catch both nulls and empty strings, then do this: Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IF (FieldOfVarchar IS NULL OR FieldOfVarchar = '') THEN