Veröffentlicht 22. Juni 20205 j Hallo Zusammen! Ich brauche bitte eure Hilfe. Ich habe die folgende Funktion create or replace function mafct(error out varchar2, mois_cmpt in varchar2, cercle in varchar2, typ in varchar2) RETURN BOOLEAN IS ptr number; BEGIN if typ != 'M' or typ != 'E' then Dbms_Output.Put_Line(typ ); ptr:=ptr+1; insert into protocol values(' typ falsch '||typ ||' Bitte M ou E eingeben',null,null,null,ptr); error:='typ falsch '||typ ||' bitte MBitte eingeben'; commit; Dbms_Output.Put_Line(typ); return (FALSE); end if; return true END; Wenn ich die Funktion zum Testen aufrufe declare X boolean; error varchar2(255); begin X:= mafct (error , '01.2025', 'AZ', 'E'); end; Ich habe in meine Protokoll Tabelle einen Fehler, dass der Typ falsch wäre. Warum funktioniert den einfachen Vergleich nicht? Danke
22. Juni 20205 j Du hast einen Logikfehler in deiner if-Bedingung. vor 6 Stunden schrieb Tedi: if typ != 'M' or typ != 'E' Das trifft immer zu, außer wenn typ sowohl M als auch E wäre (schwer möglich). Was du vermutlich willst ist typ != 'M' AND typ != 'E'.
Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.