All Forums UDA
marcmc 112 posts Joined 12/05
18 Jan 2007
parameterized update

Hey, I am running the explain(F6) on the below update command and am getting error 3939: There is a mismatch between the number of parameters specified and the number of parameters required.I cannot see the error but I am new to teradata and have not seen this error in other db architectures.I just want to p****(explain) this correctly for the moment. Please advise. UPDATE "DEV_DATA_T"."MISRE_Threshold" SET "ThresholdType" = ?, "ThresholdValue" = ?, "Threshold_Flag" = ?, "Actual" = ?, "Fail" = ?, "Category" = ?, "ID1" = ? WHERE (("ThresholdType" = ?) AND ("ThresholdValue" = ?) AND ((? = 1 AND "Threshold_Flag" IS NULL) OR ("Threshold_Flag" = ?)) AND ("Actual" = ?) AND ("Fail" = ?)AND ((? = 1 AND "Category" IS NULL) OR ("Category" = ?)) AND ((? = 1 AND "ID1" IS NULL) OR ("ID1" = ?)))

Barry-1604 176 posts Joined 07/05
18 Jan 2007

Use this syntax for your Update in SQL Assistant:EXPLAINUSING ThrType (CHAR(2)), ThrValue (DECIMAL(3)), <<< finish defining a variable with the correct data type for each "?" in the update statement >>>UPDATE "DEV_DATA_T"."MISRE_Threshold" SET "ThresholdType" = ?, "ThresholdValue" = ?, "Threshold_Flag" = ?, "Actual" = ?, "Fail" = ?, "Category" = ?, "ID1" = ? WHERE (("ThresholdType" = ?) AND ("ThresholdValue" = ?) AND ((? = 1 AND "Threshold_Flag" IS NULL) OR ("Threshold_Flag" = ?)) AND ("Actual" = ?) AND ("Fail" = ?)AND ((? = 1 AND "Category" IS NULL) OR ("Category" = ?)) AND ((? = 1 AND "ID1" IS NULL) OR ("ID1" = ?)))You have to define a variable in the USING clause for each "?" that you use. Then, you will be able to do the explain.

You must sign in to leave a comment.