-
Leider lässt sich dies tatsächlich nicht per externer DS definieren.
Für den NULL-Indikator gibt es nur die Funktion %NULLIND(Feldname). Da der Feldname nicht in einer Variablen stehen kann, ist das also zur Compilezeit aufzulösen.
%NULLIND (Query or Set Null Indicator)
%NULLIND(fieldname)
The %NULLIND built-in function can be used to query or set the null indicator for null-capable fields.
This built-in function can only be used if the ALWNULL(*USRCTL) keyword is specified on a control
specification or as a command parameter. The fieldname can be a null-capable array element, data
structure, stand-alone field, subfield, or multiple occurrence data structure.
%NULLIND can only be used in expressions in extended factor 2.
When used on the right-hand side of an expression, this function returns the setting of the null indicator
for the null-capable field. The setting can be *ON or *OFF.
When used on the left-hand side of an expression, this function can be used to set the null indicator for
null-capable fields to *ON or *OFF. The content of a null-capable field remains unchanged.
Daher ist ein NULL-Indicator nicht in einer DS definierbar.
Anders ist es mit SQL.
Passend zu einer DS kann man per DIM(n) ein Array von INT(5)-Feldern passend zur Anzahl der DS-felder definieren (mehr ist unschädlich).
Somit geht dann "fetch MyCursor into : MyDS : MyIndArray". Leider ist dann hier abzählen gefragt (Index = Position des Feldes in der DS, beginnend bei 1).
OK, du nimmst ja bereits SQL.
Dann ergänze die DS mit einem "NullInd int(5) dim(n) pos(1)" und gib das Array an.
Das Problem dabei ist, dass SQL nicht abfragt ob ein Feld NULL kann. Für jedes Feld der DS brauchst du den Null-Indicator (*null definiert dir zu wenig Felder).
Similar Threads
-
By kolbusoergel in forum IBM i Hauptforum
Antworten: 7
Letzter Beitrag: 13-02-19, 18:08
-
By Curious in forum IBM i Hauptforum
Antworten: 4
Letzter Beitrag: 12-06-18, 16:32
-
By LordCinimod in forum NEWSboard Programmierung
Antworten: 2
Letzter Beitrag: 08-08-16, 09:34
-
By JonnyRico in forum IBM i Hauptforum
Antworten: 3
Letzter Beitrag: 08-11-02, 12:19
-
By Sven Keiselt in forum IBM i Hauptforum
Antworten: 2
Letzter Beitrag: 30-01-01, 12:33
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- You may not post attachments
- You may not edit your posts
-
Foren-Regeln
|
Erweiterte Foren Suche
Google Foren Suche
Forum & Artikel Update eMail
AS/400 / IBM i
Server Expert Gruppen
Unternehmens IT
|
Kategorien online Artikel
- Big Data, Analytics, BI, MIS
- Cloud, Social Media, Devices
- DMS, Archivierung, Druck
- ERP + Add-ons, Business Software
- Hochverfügbarkeit
- Human Resources, Personal
- IBM Announcements
- IT-Karikaturen
- Leitartikel
- Load`n`go
- Messen, Veranstaltungen
- NEWSolutions Dossiers
- Programmierung
- Security
- Software Development + Change Mgmt.
- Solutions & Provider
- Speicher – Storage
- Strategische Berichte
- Systemmanagement
- Tools, Hot-Tips
Auf dem Laufenden bleiben
|
Bookmarks