Oracle join (+) notation

December 12, 2013

Oracle join (+) notation

select author_last_name, book_key
from author left outer join book_author using (author_key)
order by author_last_name;   

In the example above, the AUTHOR table is on the left, and we are using a left outer join, so we get all the rows in the AUTHOR table and the matching rows in the book_author table.  Notice that both authors clark and mee now are listed, and the book_key column is NULL.  In the standard Oracle format, outer joins can be confusing.  Below is the same query in the standard Oracle format.

  author.author_key = book_author.author_key(+)
order by author_last_name;

Notice the (+) in the WHERE clause.  This indicates a left outer join.  If we were using a right outer join, the WHERE clause would be:

author.author_key(+) = book_author.author_key

Advantages of JOIN notation

–The AND clause blocks the outer join
SELECT A.ml_street, L.ml_name, L.f_tr_status
WHERE l.f_tr_comp_adress = a.row_id(+)
AND L.f_tr_status IS NULL

–The AND clause blocks the outer join (JOIN equivalant)
SELECT A.ml_street, L.ml_name, L.f_tr_status
ON l.f_tr_comp_adress = a.row_id
WHERE L.f_tr_status IS NULL

–The AND clause does not block the outer join (this notation is only possible with JOIN)
SELECT A.ml_street, L.ml_name, L.f_tr_status
ON l.f_tr_comp_adress = a.row_id AND L.f_tr_status IS NULL

ASP.NET AJAX MaskedEditExtender

September 25, 2013
  • MaskType – Type of validation to perform:
    None – No validation
    Number – Number validation
    Date – Date validation
    Time – Time validation
    DateTime – Date and time validation
  • Mask Characters and Delimiters
    9 – Only a numeric character
    L – Only a letter
    $ – Only a letter or a space
    C – Only a custom character (case sensitive)
    A – Only a letter or a custom character
    N – Only a numeric or custom character
    ? – Any character

Linq operators on null Linq collection

September 25, 2013

You cannot apply the Linq operators (First, Single, Any, …) when the query returns null.

We have to add an extension method:

public static IEnumerable<TSource> NullToEmpty<TSource>(
    this IEnumerable<TSource> source)
    if (source == null)
        return Enumerable.Empty<TSource>();

    return source;

And now you can write:

public void Should_handle_nulls()
    List<int> ints = null;


LINQ parameter == null with SQL CE

August 6, 2013

SQL CE cannot handle parameters so, the so standard construction

.Where(p => p.Category == category || category == null)

fails because LINQ needs to use a parameter to do that value comparison in-query.  But it is perfectly valid SQL to pass something like this:

.Where(p => p.Category == category || true)

because ‘true’ is always…well…true.  So if you parse your variable to a bool before the LINQ statement and then pass that variable to SQL CE, you’re in good shape:

bool bCategory = (string.IsNullOrEmpty(category)) ? true : false;
Products = repository.Products.Where(p => p.Category == category || bCategory);

This allows you do to all the filtering in the query before returning data, and you can use this trick on as many conditions as you want without it getting messy.

Office Development

July 4, 2013

Office development libraries:

Interesting are the articles about the Open XML format SDKs


CSS3 Overview + Navigation menus

January 18, 2013

All info about css3:

A cool navigation menu generator

Images for GUI design

December 19, 2012

Visual Studio Images

for MSVC 2005 in C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary

Windows Images



Stock Photo Companies

Stock photos are a great way to get more generic photos for use on your Web pages. They provide photos of people, products, places, and animals and are well lit and shot. And while most stock photo companies are not free, there are a few free ones and there are also some that provide high quality photos for a low price. And remember, since you’re buying photos for a Web page, you don’t need to pay for resolutions that would print well. This usually lowers the price. Some stock photo companies include:

Public Images

Finally, you can use public images on your website. Most photos taken by the government can be freely used. Be sure to check the copyright before you use them. Some public domain image sites include:

IOC Container

October 19, 2012

Server Tags

September 24, 2012

Server Tags:

<% %> An embedded code block is server code that executes during the page’s render phase. The code in the block can execute programming statements and call functions in the current page class.

<%= %> most useful for displaying single pieces of information.

<%# %> Data Binding Expression Syntax.

<%$ %> ASP.NET Expression.

<%@ %> Directive Syntax.

<%– –%> Server-Side Comments.

<%: %> Like <%= %> But HtmlEncodes the output (new with Asp.Net 4).

Visual Studio Editor Reformat code

August 24, 2012

Realign code:

Ctrl K+D will format the entire document.
Ctrl K+F will format the selection.