-
Versteh auch nicht, warum eine HostVariable mit SQL geändert werden soll. Da kann man im RPG doch auch die BiF %REPLACE() benutzen?!
-
Da es da einen kleinen Unterschied gibt:
%REPLACE(replacement string: source string{:start position {:source
length to replace}}
%REPLACE returns the character string produced by inserting a replacement string into the source string,
starting at the start position and replacing the specified number of characters.
Du meinst da wohl eher diese Funktion:
%SCANRPL(scan string : replacement : source { : scan start { : scan length } )
%SCANRPL returns the string produced by replacing all occurrences of the scan string in the source
string with the replacement string. The search for the scan string starts at the scan start position and
continues for the scan length. The parts of the source string that are outside the range specified by the
scan start position and the scan length are included in the result.
Die aber erst ab irgend einem Release kam.
Des weiteren kommt es immer auf den Einsatz an. Wenn ichmit SQL mischen muss, nehme ich doch gleich SQL, da das Ergebnis einer Bif erst in eine Variable muss.
-
Ja ich meinte natürlich %SCANRPL verwechselte ich auch immer in der Implementierung 
Welche übringens mit V7R1 Einzug hielt...
Ich gebe dir Recht Fuerchau, wenn es im SQL geht dann mach es auch da, aber da hier in dem Bsp eine Hostvariable geändert werden soll, kann ich das auch gleich im RPG machen und dann anschließend die in dem SQL Statements weiter zu nutzen.
-
Wich ich schon sagte: Betrachte das Gesamtkonstrukt.
In diesem Fall braucht man weder eine zusätzliche Variable noch dynamisches SQL:
exec sql update myfile set myfield = replace(: MyField, 'P', 'L')
where myfield = upper(: MyField);
was den (relativ hohen) Aufwand des vorherigen Konstrukts vereinfachte.
Similar Threads
-
By tarkusch in forum NEWSboard Programmierung
Antworten: 1
Letzter Beitrag: 29-07-17, 11:24
-
By dibe in forum IBM i Hauptforum
Antworten: 11
Letzter Beitrag: 11-11-16, 09:59
-
By Joe in forum NEWSboard Programmierung
Antworten: 5
Letzter Beitrag: 18-05-15, 07:20
-
By oulbrich in forum NEWSboard Programmierung
Antworten: 10
Letzter Beitrag: 02-04-14, 11:05
-
By gue_br in forum IBM i Hauptforum
Antworten: 7
Letzter Beitrag: 26-02-14, 15:40
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