cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
55
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Janine Graves on 23-10-2007 10:27:12 PM
Is there any way to tell whether the DB value is NULL vs. whether that column has no value (empty) when using a Database element?

Also, in a decision element, if I want to know if a variable is empty (suppose I know it exists), what would I compare it to in the string decision?

Thanks, Janine

Subject: RE: db null vs. empty value
Replied by: null on 25-10-2007 03:08:53 PM
Hi Janine, had to do a few tests to confirm how to do this. Here is what I found:

  • If you in code try to set element data with a null value, it actually attempts to delete it if it already exists and if not, essentially does not create the element data variable. Since the database element saves the return of the query into element data, if the query returns a NULL, the element data would not be created and one can in a decision element check if the variable exists to determine whether it is null or not.

  • In terms of empty string, I determined that using Decision Editor, you cannot actually check for empty string because it requires that you enter something for a constant value. The workaround is to enter some temporary value, then select the decision element and choose XML as the option in the dropdown list and hit "Edit XML". You will then see the XML that the decision editor generated. You can then find the line with the temporary content in it and delete it so that the line looks something like this:

[code:1:47f3da1eb9]
<constant_string>
[/code:1:47f3da1eb9]

Studio will not have any problems with this and Call Services will check whether whatever you are checking is explicitly equal to "". So Decision Editor doesn't support it directly but it is possible.

Hope this helps!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links