vanroybel
asked on
"You tried to assign the null value to a variable that is not a variant data type" - AS400
I'm trying to add records in a table in AS400. I do an insert query and I get the error message : "You tried to assign the null value to a variable that is not a variant data type".
Here is my query :
INSERT INTO PRDORBIDTA_ORAALG ( BEDRAA, ARNRAA, AAKTAA, KAMCAA, AKTGAA, ALVNAA, VARTAA, OARTAA, ARVLAA, EVVBAA, BSEHAA, GWEHAA, EENHAA, VPEHAA, VERPAA, LKNRAA, ARGRAA, ARFMAA, BWRKAA, FCTRAA, USLWAA, EWLWAA, DTLWAA, TDLWAA )
SELECT 1 AS BEDRAA, qry_artikels_toadd_VERPAA. [Ref roy], "0" AS AAKTAA, 0 AS KAMCAA, "" AS AKTGAA, "" AS ALVNAA, "" AS VARTAA, "" AS OARTAA, qry_artikels_toadd_VERPAA. Descriptio n, "" AS EVVBAA, qry_artikels_toadd_VERPAA. Unité AS BSEHAA, 0 AS GWEHAA, qry_artikels_toadd_VERPAA. EENHAA, qry_artikels_toadd_VERPAA. Unité, Int([qry_artikels_toadd_VE RPAA].[Qua ntité]) AS VERPAA, "" AS LKNRAA, qry_artikels_toadd_VERPAA. ARGRAA, qry_artikels_toadd_VERPAA. Famille, "*" AS BWRKAA, 1 AS FCTRAA, "FT" AS USLWAA, 1 AS EWLWAA, 110331 AS Expr1, 0 AS Expr2
FROM qry_artikels_toadd_VERPAA;
It seems this is not an AS400 message, but I don't know where it is coming from. I even tried casting the text value in integer before sending those to the number fields in the AS400. But nothing seems to make this error message go away.
I tried using this query in view, and it works fine. It only gives an error when trying to add into AS400.
Here is my query :
INSERT INTO PRDORBIDTA_ORAALG ( BEDRAA, ARNRAA, AAKTAA, KAMCAA, AKTGAA, ALVNAA, VARTAA, OARTAA, ARVLAA, EVVBAA, BSEHAA, GWEHAA, EENHAA, VPEHAA, VERPAA, LKNRAA, ARGRAA, ARFMAA, BWRKAA, FCTRAA, USLWAA, EWLWAA, DTLWAA, TDLWAA )
SELECT 1 AS BEDRAA, qry_artikels_toadd_VERPAA.
FROM qry_artikels_toadd_VERPAA;
It seems this is not an AS400 message, but I don't know where it is coming from. I even tried casting the text value in integer before sending those to the number fields in the AS400. But nothing seems to make this error message go away.
I tried using this query in view, and it works fine. It only gives an error when trying to add into AS400.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Great!
Thanks for the feedback.
/gustav
Thanks for the feedback.
/gustav
ASKER