Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XQuery Null

267925Dec 28 2006 — edited Jan 12 2007
How does XQuery determine in a value is null? I have the following test on a VARCHAR2(6 BYTE) field and no matter what I do it doesn't seem to work. I want the code to do something if the field is null. I've tried all the combinations of else if($c_cat eq " ") that I can think of.

else if($c_cat eq null) then
else if($c_cat eq NULL) then
else if($c_cat eq "") then

also with /text(). NULL and null return an error and " " just skips over the record.

Thanks.


(if($c_cat eq "GAPTRM") then
(<use fZ="#bPol" x="{$v_seq_start * $v_scale}" y="0" oid="{$c_iid}" omin="{$c_min}" omax="{$c_max}" omsr="{$c_xms}">
<title>{$c_ann/text()}</title>
<desc>Mile:{$c_msr/text()}</desc>
</use>,
<text x="{($v_seq_start * $v_scale)+5}" y="125" class="annoBLK">{$c_ann/text()}</text>)
else if($c_cat eq "OVLTRM") then
(<use fZ="#aD" x="{$v_seq_start * $v_scale}" y="90" oid="{$c_iid}" omin="{$c_min}" omax="{$c_max}" omsr="{$c_xms}">
<title>{$c_ann/text()}</title>
<desc>Route Overlap @ Mile:{$c_xms/text()}</desc>
</use>,
<text x="{($v_seq_start * $v_scale)+5}" y="125" class="annoBLK">{$c_ann/text()}</text>)
else if($c_cat eq " ") then
(<g id="aRd" v="{$c_seq}" f="{$c_ovl}" m="{$c_msr}" min="{$c_min}" max="{$c_max}">
<use fZ="#xroad" oid="{$c_iid}" x="{$v_seq_start * $v_scale}" y="100" transform="rotate({$c_rot},{$v_seq_start * $v_scale},100)">
<title>{$c_ann/text()}</title>
<desc>Mile:{$c_msr/text()}</desc>
</use>
</g>,
<g id="aRdAno">
<text rteSign="{$c_seq}" rteName="{$c_ann/text()}" x="{$v_seq_start * $v_scale}" y="{if($c_sid eq "LT") then "80" else "120"}" class="{if($c_sid eq "LT") then "annoRDL" else "annoRDR"}">{$c_ann/text()}</text>
</g>)
else())
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2007
Added on Dec 28 2006
3 comments
672 views