<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://kb.pocnet.net/index.php?action=history&amp;feed=atom&amp;title=AS%2F400-SQL-Schleife</id>
	<title>AS/400-SQL-Schleife - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://kb.pocnet.net/index.php?action=history&amp;feed=atom&amp;title=AS%2F400-SQL-Schleife"/>
	<link rel="alternate" type="text/html" href="https://kb.pocnet.net/index.php?title=AS/400-SQL-Schleife&amp;action=history"/>
	<updated>2026-05-19T12:14:28Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Knowledgebase</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://kb.pocnet.net/index.php?title=AS/400-SQL-Schleife&amp;diff=2215&amp;oldid=prev</id>
		<title>PoC: +Link</title>
		<link rel="alternate" type="text/html" href="https://kb.pocnet.net/index.php?title=AS/400-SQL-Schleife&amp;diff=2215&amp;oldid=prev"/>
		<updated>2019-03-11T13:31:01Z</updated>

		<summary type="html">&lt;p&gt;+Link&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 11. März 2019, 15:31 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot;&gt;Zeile 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  C+ CLOSE SLT&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  C+ CLOSE SLT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  C/END-EXEC&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  C/END-EXEC&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Siehe auch ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [https://try-as400.pocnet.net/wiki/Embedding_SQL_in_RPG Embedding SQL in RPG], try-as400.pocnet.net&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie: AS/400]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Kategorie: AS/400]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key kbwiki:diff:1.41:old-2080:rev-2215:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>PoC</name></author>
	</entry>
	<entry>
		<id>https://kb.pocnet.net/index.php?title=AS/400-SQL-Schleife&amp;diff=2080&amp;oldid=prev</id>
		<title>PoC: Neu</title>
		<link rel="alternate" type="text/html" href="https://kb.pocnet.net/index.php?title=AS/400-SQL-Schleife&amp;diff=2080&amp;oldid=prev"/>
		<updated>2017-10-24T09:43:06Z</updated>

		<summary type="html">&lt;p&gt;Neu&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Die Selektion von Datensätzen anhand eines (exakten) Vergleichswertes ist in RPG nicht auf DB-Ebene möglich. Lediglich das Anspringen des ersten Datensatzes in einer Tabelle ist machbar (SETLL). Zum Glück gibt es SQL, auch wenn dies leider nicht komplett integriert ist, sondern sehr &amp;#039;&amp;#039;angeflanscht&amp;#039;&amp;#039; aussieht! Beispiel einer SQLRPGLE-Schleife mit Vor- und Nachbereitung…&lt;br /&gt;
&lt;br /&gt;
== Vorarbeiten ==&lt;br /&gt;
&amp;#039;&amp;#039;Rpgvarname&amp;#039;&amp;#039; ist hierbei eine Variable innerhalb RPG.&lt;br /&gt;
 C/EXEC SQL&lt;br /&gt;
 C+ DECLARE SLT CURSOR FOR SELECT BLAH FROM LIB/BLUBBTBL&lt;br /&gt;
 C+ WHERE FOO = :RPGVARNAME FOR READ ONLY&lt;br /&gt;
 C/END-EXEC&lt;br /&gt;
 &lt;br /&gt;
 C/EXEC SQL&lt;br /&gt;
 C+ OPEN SLT&lt;br /&gt;
 C/END-EXEC&lt;br /&gt;
 &lt;br /&gt;
 C/EXEC SQL&lt;br /&gt;
 C+ WHENEVER NOT FOUND GOTO ENDOFLOOP&lt;br /&gt;
 C/END-EXEC&lt;br /&gt;
&lt;br /&gt;
== Schleife ==&lt;br /&gt;
* Die Schleife wird implizit durch das oben gezeigte &amp;#039;&amp;#039;WHENEVER&amp;#039;&amp;#039;-Statement beendet.&lt;br /&gt;
* &amp;#039;&amp;#039;RCDEXP&amp;#039;&amp;#039; ist eine vorher zu deklarierende Datenstruktur, welche die gleiche Feldart und -Folge der DB-Datei haben muss.&lt;br /&gt;
 &amp;#039;&amp;#039;DO&amp;#039;&amp;#039;&lt;br /&gt;
 C/EXEC SQL&lt;br /&gt;
 C+ FETCH NEXT FROM SLT INTO :RCDEXP&lt;br /&gt;
 C/END-EXEC&lt;br /&gt;
 &amp;#039;&amp;#039;ENDDO&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;ENDOFLOOP TAG&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Nachbereitung ==&lt;br /&gt;
 C/EXEC SQL&lt;br /&gt;
 C+ CLOSE SLT&lt;br /&gt;
 C/END-EXEC&lt;br /&gt;
&lt;br /&gt;
[[Kategorie: AS/400]]&lt;/div&gt;</summary>
		<author><name>PoC</name></author>
	</entry>
</feed>