-
Variable als Parameter für SUBSTR in SQL-Anweisung (UDF)
Hallo, zusammen
Die folgende Anweisung wird nicht akzeptiert (Variable COUNTER ist DECIMAL(3,0) definiert).
IF SUBSTR(FELD15, COUNTER, 1) < '0' OR
SUBSTR(FELD15, COUNTER, 1) > '9'
Bei SET-Anw. dürfen Variable aber offenbar vorkommen.
Ich weiß jetzt jeenfalls nicht, wie ich im gegenständlichen Fall abfragen soll, ob nur numerischer Wert enthalten.
Eine MONITOR-Überwachung wie in RPG gibt es ja in SQL-UDFs nicht, soweit ich weiß. Wäre hier praktisch. Denn jede einzelen Stelle abzufragen, ist ohnehin wenig elegant.
Danke im Voraus für Unterstützung.
-
Der Monitor in SQL heißt hier WHENEVER:
Syntax
WHENEVER NOT FOUND
SQLERROR
SQLWARNING
CONTINUE
GOTO
host-Label
GO TO :
Description
The NOT FOUND, SQLERROR, or SQLWARNING clause is used to identify the
type of exception condition.
NOT FOUND
Identifies any condition that results in an SQLSTATE of '02000' or an
SQLCODE of +100.
SQLERROR
Identifies any condition that results in an SQLSTATE value where the first two
characters are not '00', '01', or '02'.
SQLWARNING
Identifies any condition that results in an SQLSTATE value where the first two
characters are '01', or a warning condition (SQLWARN0 is 'W').
The CONTINUE or GO TO clause are used to specify the next statement to be
executed when the identified type of exception condition exists.
CONTINUE
Specifies the next sequential instruction of the source program.
GOTO or GO TO
host-Label
Specifies the statement identified by
host-label. For host-label, substitute a single
token, optionally preceded by a colon.
Du kannst also per "SET VAR = DEC(FLD15, n, m)" und anschließender Abfrage des SQLCOD den Fehlerfall abfangen.
-
Da hatte ich offensichtlich eine markante Bildungslücke. Vielen Dank für die Info
Similar Threads
-
By tarkusch in forum NEWSboard Programmierung
Antworten: 3
Letzter Beitrag: 05-05-14, 16:42
-
By XMan in forum NEWSboard Programmierung
Antworten: 3
Letzter Beitrag: 20-12-13, 08:50
-
By HoScHiE in forum IBM i Hauptforum
Antworten: 28
Letzter Beitrag: 17-01-08, 10:35
-
By JonnyRico in forum IBM i Hauptforum
Antworten: 1
Letzter Beitrag: 02-04-03, 15:53
-
By Hans Zuther in forum IBM i Hauptforum
Antworten: 3
Letzter Beitrag: 21-10-02, 15:29
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