null

MySQL MAX() and NULLs

Hi, I have a query that looks a bit like this: SELECT weekEnd, MAX(timeMonday) FROM timesheet GROUP BY weekEnd The valid values for timeMonday are: null, -1, 0, 1-24. At the moment, MAX() places the preference of those values in the order null, -1, 0, 1-24, however what I actually want is -1, null, 0, 1-24, so that null is considered...

how to set a null value to a field in a table using oracle sql developer tool ?

Hi, Oracle SQL Developer allows you to update field values directly to the table without needing to write a sql script. However it doesnt allow you to set a null value for a field? the update script that gets generated is below : UPDATE "TABLE" SET field_required = 'null' WHERE ROWID = 'AAAnnZAAFAAAGMfAAC' AND ORA_ROWSCN = '14465324' An...

Lamp / Cakephp: Streaming an image : Binary 0x00 replaced by 0x20

I'm trying to create a script that pulls an image out of the database and displays it to the user, called by <img src="viewImage/someImageName"> But the problem I'm having is when the image is displayed all of the Nulls (0x00) are replaced by 0x20 and I have no idea why. The data in the database shows it being nulls but somewhere along ...

expected behavior of posix extended regex: (()|abc)xyz

On my OS X 10.5.8 machine, using the regcomp and regexec C functions to match the extended regex "(()|abc)xyz", I find a match for the string "abcxyz" but only from offset 3 to offset 6. My expectation was that the entire string would be matched and that I would see a submatch for the initial "abc" part of the string. When I try the sa...

Implications of not including NULL in a language?

I know that NULL isn't necessary in a programming language, and I recently made the decision not to include NULL in my programming language. Declaration is done by initialization, so it is impossible to have an uninitialized variable. My hope is that this will eliminate the NullPointerException in favor of more meaningful exceptions or...

SSIS - Date Coloumn to Variable Null and non-Null Values

Within an SSIS package I have a dataflow that extracts two coloumns from an access database a TaskID and a date I store this in a ADO recordset and pass this to a For Each Loop Container I am them attempting to assign each value pair to two variables "taskID" and "taskDate" I then want to use thse two variables within a SQL Insert task...

MS SQL 2008 cast null to string

Hello! I got a few stored procedures that uses a TRY/CATCH statement, so i execute the main program and if it generates any errors i catch them. Now my problem is in the catch statement, i have this piece of code: BEGIN TRY INSERT INTO ContentTypes (ContentName, ContentPath) VALUES (@ContentName, @ContentPath) SET @QRe...

How to check if it's null?

I retrieve data from database like below. How do I check whether the value retrieved from database is null? Private Function GetBatch() As DataSet Dim dataset As New DataSet Dim adapter As Data.SqlClient.SqlDataAdapter Dim cn As New System.Data.SqlClient.SqlConnection(connectionstring()) GetBatchCommand.C...

MySQL Default Value Issue

Hello All, In MySQL, the default value for a Integer Field is 0. During insertion the value for that field is NULL and the NULL gets inserted. I do some arithmetic manipulation like addition, multipilcation, division using that field's value. This results in error as NULL got inserted. How to resolve this problem? Don't the DB support d...

How to select an empty result set?

I'm using a stored procedure in MySQL, with a CASE statement. In the ELSE clause of the CASE ( equivalent to default: ) I want to select and return an empty result set, thus avoiding to throw an SQL error by not handling the ELSE case, and instead return an empty result set as if a regular query would have returned no rows. So far I've...

jax-ws client and axis server - passing a null date value

when passing a null value for a XMLGregorianCalendar parameter jax-ws does so by ommiting the corresponding xml element. this causes the following excpetion from the server: SOAPFaultException: date string can not be less than 19 charactors when handcoding the request and representing the null value by using an empty element: <web:gue...

SQL max and null

I am trying to get the null value in the USAGE_START_DATE column. So far, what is i got is the unique max records of those with value in the USAGE START DATE column, and could not find any the records with nulls in the USAGE START DATE. I already tried ISNULL, COALESCE, NVL, NZ. I got 2 tables: linked by Reservation_id. Reservation...

Array of char* should end at '\0' or "\0" ?

Lets say we have an array of char pointers char* array[] = { "abc", "def" }; Now what should be put in the end ? char* array[] = { "abc", "def", '\0' }; or char* array[] = { "abc", "def", "\0" }; Though, both works. We only have to put the condition to check the end accordingly like array[ index ] != '\0'; or array[ index ]...

ActiveRecord - Self Referencing Associations

I'm a total Ruby/Rails/AR noob. I have a very basic sort of database schema that I can't seem to figure out the best way to represent in the Rails Way. Table Post String title, author Text content Timestamp posted Post parent The idea here is that top level posts will have parent that is NULL. Every response will hav...

Default values for COUNT in MySQL

I have a table looking something like this: +-------+-----+ |country|prop1| +-------+-----+ |RO | 1 | |RO | 2 | |UK | 1 | |IT | 2 | +-------+-----+ I want to count the rows for which the prop1 is not null and I use the following select: SELECT `country`, COUNT(*) as number FROM table GROUP BY `country`; this...

Is it possible to iterate through method's parameters in C#?

I've been thinking that it would be useful to be able to do such a thing, for example, to check the parameters for null references and eventually throw an exception. This would save some typing and also would make it impossible to forget to add a check if a new parameter is added. ...

wpf custom control xaml null error

Yet another strange WPF error: I have a custom control in a simple XAML page. The project builds and runs perfectly, with no errors. Here's the XAML: <Window x:Class="Grapher2.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:graph="clr-namespace:Gr...

BST insert in c++

I'm learning c++ and writing a binary search tree. The following is the code I wrote for my insert method. BSTNode * BST::Insert(const std::string & v) { BSTNode *n = !root ? root = new BSTNode(v) : Insert_Helper(v,root); if(n) size++; return n; } BSTNode * BST::Insert_Helper(const std::string & v, BSTNode *n) { if(!n->value.compar...

Why can I select something out of left join on a NULL column?(with contrived example to reproduce it locally,probably a bug!)

VERSION I'm using Server version: 5.1.36-community-log MySQL Community Server (GPL) I've finally contrived a easy example to reproduce it easily! setup: create table t1(id integer unsigned,link integer unsigned); create table t2(id integer unsigned auto_increment,primary key(id)); create table t3(id integer unsigned,content varchar(30...

AS3 -TypeError #1009 - any easy way to find out *which* object reference is null?

We all get "TypeError #1009 Cannot access a property or method of a null object reference" now and then - no big deal, but sometimes frustrating to debug. Flash gives you the call stack (which is a start), but leaves it up to you to figure out where the null object is - is it possible to find out exactly which reference is throwing the...