View Full Version : Open Option des API QSQPRCED
Hallo, ich bekomme es einfach nicht hin.
kann mir jemand die Hex Codes dafür geben?
das habe ich bisher zusammen gesucht und ich hoffe die Stimmen.
Read = X'80'
Write = X'F0'
Update = X'A0'
nur wie ist der Delete?
Delete = ????
Gruß
Xanas
Die API-Beschreibung findest du hier:
Process Extended Dynamic SQL (QSQPRCED) API (http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/qsqprced.htm?resultof=%22%51%53%51%50%52%43%45%44% 22%20%22%71%73%71%70%72%63%65%64%22%20)
Danke schon mal für die schnelle Antwort, aber genau aus dieser werde ich nicht wirklich schlau.
Open options. The open options used on an SQL cursor. These are specified using the following bits:
<table width="100%"> <tbody><tr> <td valign="top" width="15%">Bit(0)</td> <td valign="top" width="85%">Read</td> </tr> <tr> <td valign="top">Bit(1)</td> <td valign="top">Write</td> </tr> <tr> <td valign="top">Bit(2)</td> <td valign="top">Update</td> </tr> <tr> <td valign="top">Bit(3)</td> <td valign="top">Delete</td> </tr> </tbody></table>
For example, if a cursor is only for FETCH statements, the bit pattern should be '10000000'B or hex 80. If update capability is needed, the bit pattern should be '10100000'B. The syntax in the SQL statement takes precedence over the open options. This means that the FOR UPDATE OF and FOR FETCH ONLY clauses will be honored, even if they do not coincide with the requested open options. The open options are required for functions 2 and 4. They are ignored for other functions.
Ein Einbytefeld wird von links nach rechts mit den Bit's gezählt, daher kann man mit RPG auch den BITON-Befehl verwenden:
BITON 0 FELD
In ILE gibts dafür %bitor(...);
Also
Feld = %bitor(b'1000000':Feld)
Wenn du die Kombination direkt kennst, kannst du auch so zweisen:
Feld = B'11110000';
Damit entfällt die Hexrechnerei.