Hi,
I have a problem with a rule that is updating a oracle 10 database. The rule is expected to check if ther is a invoice number then take the highest of them, and if there isnt any, then choose the reference number instead. The problem is, sometimes the table shipordart doesnt contains any rows and then "nothing" should happen. But now i get a error message.
ORA-01407: cannot update ("E768"."SHIPOR D"."INVOICEN O") to NULL
I have tried to use EXISTS but i cant get the syntax right.
Any help is very appreciated.
Best regards
Anasi
I have a problem with a rule that is updating a oracle 10 database. The rule is expected to check if ther is a invoice number then take the highest of them, and if there isnt any, then choose the reference number instead. The problem is, sometimes the table shipordart doesnt contains any rows and then "nothing" should happen. But now i get a error message.
ORA-01407: cannot update ("E768"."SHIPOR D"."INVOICEN O") to NULL
I have tried to use EXISTS but i cant get the syntax right.
Code:
update shipord set invoiceno = (select CASE WHEN MAX(invoicenoart) > ' ' THEN MAX(invoicenoart) ELSE (SELECT MAX(REFNO) FROM SHIPMAIN WHERE TIMEIN = #TimeIn#) END from shipordart where timein = #TimeIn# GROUP BY 1) where timein = #TimeIn#
Best regards
Anasi
Comment