null

MySQL - NULL value check and Dynamic SQL inside stored procedure

DROP PROCEDURE IF EXISTS HaveSomeFun; CREATE PROCEDURE HaveSomeFun(user_id CHAR(50),house_id CHAR(50),room_id CHAR(50),fun_text TEXT,video_url CHAR(100)) BEGIN DECLARE query_full TEXT; SET @fields_part = 'INSERT INTO fun(FunKey,UserKey,FunBody,LastModified'; SET @values_part = CONCAT(') VALUES( NewBinKey(), KeyToBin(\"', user_id, '\")...

Difference between MySQL IS NOT NULL and != ''

Is there any difference between MySQL IF (myText IS NOT NULL) THEN and IF (myText != '') THEN ...

DB4o Linq query - How to check for null strings

Hey there - simple query: var q = (from SomeObject o in container where o.SomeInt > 8 && o.SomeString != null //Null Ref here select o; I always get a null reference exception. If I use String.IsNullOrEmpty(o.SomeString) the query takes about 100 times as long, as if I use && o.SomeString != "" (which is way faster, but o...

Session is null in IRouteHandler.GetHttpHandler with Asp.net routing

Hi, I'm trying to get Session enabled in the GettHttpHandler method of my IRouteHandler classes but session is always null. Could someone tell me what I'm doing wrong? In global.asax I have RouteTable.Routes.Add("All", new Route("{*page}", new MyRouteHandler())); The MyRouteHandler class where Session is null looks like this: publi...

How to index a date column with null values?

How should I index a date column when some rows has null values? We have to select rows between a date range and rows with null dates. We use Oracle 9.2 and higher. Options I found Using a bitmap index on the date column Using an index on date column and an index on a state field which value is 1 when the date is null Using an index...

How to remove all the Null elements inside a generic List in one go?

Hi, Is there a default method defined in .Net for C# to remove all the elements within a list which are NULL? List<EmailParameterClass> parameterList = new List<EmailParameterClass>{param1, param2, param3...}; Lets say some of the paramters are NULL; I cannot know in advance and I want to remove them from my list so that it only cont...

iPhone SDK: Please explain why "nil ==" is different than "== nil"

I have been programming iPhone SDK for around 6 months but am a bit confused about a couple of things...one of which I am asking here: Why are the following considered different? if (varOrObject == nil) { } vs if (nil == varOrObject) { } Coming from a perl background this is confusing to me... Can someone please explain why on...

Load Image from Jar: Always null

Looked at other posts on SO and they did not solve this issue. I'm trying to load an image from my jar file. It is continuously coming up as null. The image is located under: .Jar file > images > BLOCK.png To load the image I am doing: BufferedImage bImg; URL url = getClass().getResource("/images/BLOCK.png"); try { bImg = ImageI...

Options for eliminating NULLable columns from a DB model (in order to avoid SQL's three-valued logic)?

Some while ago, I've been reading through the book SQL and Relational Theory by C. J. Date. The author is well-known for criticising SQL's three-valued logic (3VL).1) The author makes some strong points about why 3VL should be avoided in SQL, however he doesn't outline how a database model would look like if nullable columns weren't all...

MySql compound keys and null values

Hi, I have noticed that if I have a unique compound keys for two columns, column_a and column_b, then my sql ignores this constraint if one column is null. E.g. if column_a=1 and column_b = null I can insert column_a=1 and column_b=null as much as I like if column_a=1 and column_b = 2 I can only insert this value once. Is there a...

Stored procedure to handle null parameter

I'm sure this has a very simple answer I am not finding... I have a simple hierarchy in a database where each row has a ParentId. If ParentId IS NULL, then it's a root element. I have the stored procedure: CREATE PROCEDURE GetByParent @parentId int AS BEGIN SELECT * FROM TABLE1 WHERE ParentId = @parentId END It works fine if I send...

Why does C# require you to write a null check every time you fire an event?

This seems odd to me -- VB.NET handles the null check implicitly via its RaiseEvent keyword. It seems to raise the amount of boilerplate around events considerably and I don't see what benefit it provides. I'm sure the language designers had a good reason to do this.. but I'm curious if anyone knows why. ...

C++ allocator<X>::deallocate(NULL,1) allowed?

Both free(NULL) and ::operator delete(NULL) are allowed. Does the allocator concept (e.g. std::allocator also allow deallocate(NULL,1), or is it required to put your own guard around it? ...

C# PropertyGrid: Create Expandable item when value is null

I have class (ClassA) with some public properties. One of the properties (ClassBValue) is of a class type (ClassB) which has some public properties, too. Now I want to show ClassA objects in a PropertyGrid. I use the [TypeConverter(typeof(ExpandableObjectConverter))] Attribute for the ClassB property of ClassA. The problem is, that...

Efficient way to compare for a NULL or value for a column in SQL

What's the efficient way to check for a null or value for a column in SQL query. Consider a sql table table with integer column column which has an index. @value can be some integer or null ex: 16 or null. Query 1: Note sure, but it seems one should not rely on the short-circuit in SQL. However, below query always works correctly when ...

VB.net: What is the difference between foo=Nothing and foo is Nothing?

In VB.net, what is the difference between if foo is Nothing Then doStuff() End If and if foo=Nothing Then doStuff() End If Update I received the following answer: foo is Nothing simply checks if foo is not assigned to any reference. foo=Nothing checks if the reference held by foo is equal to nothing ...

Groovy/Grails: How do I make my datePicker blank or null by default instead of showing today's date?

That is basically my question. It is showing me today's date and not a blank or null or '' date, even if I put null or '' it runs perfectly but keeps showing me today's date, not a blank dropdown box. So I want to change the default to being blank when the gsp loads, not with today's date. Thanks -Fernando ...

SSIS Import from Excel - dates in 21-Jun-10 format get inserted as NULL?

I have an SSIS import package that is bringing data into a SQL 2005 database. One of the columns has the date in the following format (dd-mmm-yy) and always gets inserted into the database as NULL. I've tried the destination column as smalldatetime, NVARCHAR, VARCHAR, and always comes in as NULL. I know if edit the column on the sheet...

document.getElemenyById is returning null

Here's the HTML of my page. Skip the CSS its irrelevant I believe. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html> <head> <script type="text/javascript" src="vertical.js"></script> <style type="text/css"> #navlist li { display: inline; /* for IE5 and IE6 */ } #navlist { width: 7em; ...

Why does String.valueOf(null) throw a NullPointerException?

Hi, according to the documentation, the method String.valueOf(Object obj) returns: if the argument is null, then a string equal to "null"; otherwise, the value of obj.toString() is returned. But how come when I try do this: System.out.println("String.valueOf(null) = " + String.valueOf(null)); it throws NPE instead? (try it your...