Convert 0 to NULL

Posts   
 
   
 
Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 03-Oct-2006 16:16:44   

Hi Guys,

I have a self-referencing table called Page where each row represents a Page and has a ParentId relating it to its Parent.

Now, in the database if a Page is a Root Node then it has a parentId of 0. Unfortunately, for RadMenu to render correctly each rootNode must have a parentId of NULL.

So my question is this. Is there a way to create a typed list whereby 0 is converted to NULL when the SELECT is performed?

Cheers,

Peter

Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 03-Oct-2006 16:25:20   

NullIf ... flushed

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 03-Oct-2006 16:28:20   

Hi,

you can either use a custom projector (easier) or a type converter (more generic) For both, I'd suggest you have a look in the manual.

If you go for a projector, you can project to a custom type or to the typedlist itself. I the latter case or if you want to use a custom type convertor, you should make sure your integer field is generated as a Nullable type by using the corresponding plugin (see the ref manual for plugins)

cheers