× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: R: Compile SQLRPGLE with ALWNULL
  • From: "Marco Facchinetti" <facchinetti@xxxxxxxxx>
  • Date: Mon, 30 Apr 2001 17:16:58 +0200

Title: Compile SQLRPGLE with ALWNULL
There are two ways to handle null fields via sql:
 
1: Search in the list: "Null fields in SQLRPGLE" in October 2000 I'v got a complete answer (and a tool too) from David Morris
 
2: If you use Select * into ds name you have to add an array defined as:
DIND_ARRAY        DS                                 
D INDS                           4B 0 DIM(50) 
I set 50 because I've got less than 50 fields in the ds
The SQL code looks like:
C/EXEC SQL                        
C+ FETCH CUR INTO :DBANA0 :INDS   
C/END-EXEC                        
When you "read" the record via sql you have to test the value of the correspondig (by position) element in INDS (Eg if ArrivalDt is the 5th field you have to test INDS(5)) against   0 ( a minus 0 value indicate a null field (Nice, really nice....)).
Be carefull: if you add a field somewhere in you format (Eg. in 3rd position) ArrivalDt may become the 6th field....
 
Coming back to the problem, you cannot pass back the %nullind to your java program since there is no support for null fields in rpg, the only support actually available is over database fields (defining external files, not external DS) and is compiler handled only. If you define ALWNULL and your database files have null capable fields you can use %nullind otherwise...
I think you can set up a second ds sql and send it back to your java program
You can find more information in:

DB2 UDB for AS/400 SQL Programming (Code: RBAF-Y000-00)

Chapter 16. Coding SQL Statements in ILE RPG for AS/400 Applications . 309
 
Hope it helps
Marco
----- Original Message -----
Sent: Friday, April 27, 2001 7:47 PM
Subject: Compile SQLRPGLE with ALWNULL

Hi All,

I have to pass a null value to my java program through my SQLRPGLE program.  I am using CRTRPGSQLI to compile the source and cannot find ALWNULL in the command.  My program does not compile at all.  (I have to use RPGLE since I am passing back result set through my stored procedure.)  I am now stuck.  Could someone kindly help me with this problem?

Thanks,
Sudha



----------------------------------------------------------------------------------------
Sudha Ramanujan
System Team Leader
SunGard Futures Systems


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.