SQL LEFT OUTER JOIN – Null handling: Indicator Variables

10 pts.
Tags:
Development
RPG
SQL
I am using SQL Left Outer Join in an SQLRPGLEI Declare Cursor statement. I need indicator variables of SMALLINT type to handle my null returns in FETCH statements. How and where do these have to be defined? There are no SMALLINT fields in the tables I am joining. Thank you in advance for your consideration.
ASKED: May 16, 2005  12:35 PM
UPDATED: May 16, 2005  5:42 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I have this working now. Needed to define the indicator variables in RPG thus:| D ISET# ~ S ~ 3I 0 Inz |
and then pair them with the potential nulls in the FETCH statement: FETCH INTO :SET#:ISET#, etc. Values of the indicator variables are -1 when the fetched value is null.

Thanks again to Ludith for putting me on track.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following