I have a record set from a DB query that I want to use for display in a RTable. Some values can be NULL and the result is that the RTable shows them like java.lang.Object@1234 which is not very useful information for the end user.

How can I make this cell empty for the display?

asked 28.04.2009 at 09:48

Benedict%20Groppe's gravatar image

Benedict Groppe
accept rate: 50%

Two reasons can cause this behavior. Either those NULL values are values that are not set in the DB (some DB's return NULL, some return an empty string or 0 depending on the column type) or you were using the ivyScript auto initialization feature of Xpert.ivy.

You can use this expression to overcome the problem:

(record.getField("name") is initialized) ? record.getField("name") : "N.A."


answered 28.04.2009 at 10:02

Tamas%20KIS's gravatar image

Tamas KIS
accept rate: 60%

> Hallo Herr Groppe
> Es könnte 2 Gründe für diese Verhalten in Frage kommen. Entweder werden die Objekte als "nicht inizialisierte DB Objekte" ankommen (manche DB Systeme liefern solche Objekte anstatt "null"
> oder wird ivy das Objekt über einen Komfort Feature (Kapitel IvyScript: "Null handling / Automatic object creation" in Designer Help) initialisiert.
> Auf jedem Fall: ich würde folgenden Kode empfehlen:
> (record.getField("name") is initialized) ? record.getField("name") : "N.A."
> Freundliche Grüsse
> T.Kis
> P.S. Sie finden weitere Informationen über das Konstrukt "is initialized" in dem Kapitel "IvyScript".

Hallo Herr Kis,

danke für den Hinweis, mit dem vorgeschlagenen Code funktioniert es einwandfrei !

Schöne Grüße
B. Groppe

P.S. Wir verwenden MS SQL 2000

answered 28.04.2009 at 10:06

Tamas%20KIS's gravatar image

Tamas KIS
accept rate: 60%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 28.04.2009 at 09:48

Seen: 1,641 times

Last updated: 28.04.2009 at 09:48