If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > null indicators?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-13-03, 19:37
bzuborski bzuborski is offline
Registered User
 
Join Date: Jun 2002
Posts: 10
Question null indicators?

hi,

I have a stored procedure which selects from the database
table into local variables. Is there a way to set some indicator
local variables during select to mark if particular field fetched
from database is NULL, without having to do it by
IF-THEN-ELSE logic? (like in Oracle)

thx,
bran
Reply With Quote
  #2 (permalink)  
Old 02-13-03, 22:14
bzuborski bzuborski is offline
Registered User
 
Join Date: Jun 2002
Posts: 10
Also, if indicator variables can be used, can the local variable be
set automatically to some default value when the indicator variable is < 0?
Reply With Quote
  #3 (permalink)  
Old 02-14-03, 03:16
eherber eherber is offline
Registered User
 
Join Date: Aug 2002
Location: Bonn/Germany
Posts: 152
No, indicator variables are not supported in stored
procedures, only in esql/c.

But you might use the nvl() function like this:

select nvl(<colname>, '<substitute_value'>)
from <table_name>

This allows you to substitute null values directly in
the select statement.
__________________

Best regards

Eric
--
IT-Consulting Herber
WWW: http://www.herber-consulting.de
Email: eric@herber-consulting.de

***********************************************
Download the IFMX Database-Monitor for free at:
http://www.herber-consulting.de/BusyBee
***********************************************
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On