In meiner aufgelösten SQL-Quelle habe ich was seltsames festgestellt:
Man beachte: Wenn der Nullanzeiger vom WARENEINGANGSDATUM >= 0 ist, nur dann wird das WARENEINGANGSDATUM gesetzt.Code://* exec sql select max(PLDAT), sum(PLMENG) //* into :Wareneingangsdatum :Null1 //* ,:Wareneingangsmenge :Null2 //* from D060 //* where PLBBNR = :D242.BBNR //* and PLABNR = :D242.BBABNR //* and PLPONR = :D242.BBPONR //* ; SQL_00128 = D242.BBNR; SQL_00129 = D242.BBABNR; SQL_00130 = D242.BBPONR; SQLER6 = -4; SQLROUTE_CALL( SQLCA : SQL_00123 ); IF SQL_00126 = '1'; IF SQL_00132 >= 0; EVAL WARENEINGANGSDATUM = SQL_00131; ENDIF; EVAL NULL1 = SQL_00132; EVAL WARENEINGANGSMENGE = SQL_00133; EVAL NULL2 = SQL_00134; ENDIF;
Warum wird dann das Feld WARENEINGANGSMENGE immer gesetzt?
SQL_00131 enthält nämlich dann den 01.01.0001.
Durch die NULL-Abfrage des Precompilers enthält aber WARENEINGANGSDATUM den vorherigen Wert, während WARENEINGANGSMENGE auf 0 gesetzt wird.
Seltsam....
![[NEWSboard IBMi Forum]](images/duke/nblogo.gif)



Mit Zitat antworten
Bookmarks