Tina N M&#246&#59;rnstam


Hello!

I try to use "Execute SQL Task" to insert a numeric value into AS400.

The following command works:

INSERT INTO "MSSPRDDAT"."MSSDATE"
VALUES 1070528

But I need to use a parameter insteed. I have tried several Data Types, but non seems to work.

When I use NUMERIC, LARGE_INTEGER, ULARGE_INTEGER or NVARCHAR I get the following error message:

[Execute SQL Task] Error: Executing the query "INSERT INTO "MSSPRDDAT"."MSSDATE" VALUES " failed with the following error: "SQL0301: Input host variable DATESTR or argument 7 not valid. Cause . . . . . : The value in relative position 7 in the statement is a type that is not compatible with the requested operation. The value is host variable DATESTR , entry 7 in an SQLDA, or argument DATESTR in a CALL statement. A name *N indicates that a user's SQLDA was used or that a constant or special register was specified on the CALL statement. Recovery . . . : Do one of the following and try the request again: -- Use a host variable that is the correct type. -- Specify an argument in the CALL that is the correct type. -- Change the type specified for parameter 7 in the DECLARE PROCEDURE statement.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

When I use DECIMAL I get the following error message:

[Execute SQL Task] Error: Executing the query "INSERT INTO "MSSPRDDAT"."MSSDATE" VALUES " failed with the following error: "The type is not supported.DBTYPE_DECIMAL". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

Can anyone help me

Best regards,

Tina





Re: INSERT INTO AS400 - NUMERIC value

Tina N Mörnstam


Hello!

I found a way to get past this issue. I created a new "field" in DB2 that is a string. Then it is possible to do insert. When I select this variable i convert it to integer:

....

WHERE
"ARAADT" >= (SELECT INT("MSSDATEX") FROM "MSSPRDDAT"."MSSDATEX")

...

Best regards,

Tina