Please Help

Connectivity
Enthusiast

Please Help

Please help!
Visual Studio VB.NET 2005 - DB: Teradata - .NET Data Provider for Teradata. (teradat.client.profile.dll)
I have given my dataAdapter this Select command.

SELECT * FROM DEV_DATA_T.MISRE_Threshold ORDER BY ID1

It has returned this for my 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" = ?))) -- 17 placeholder params.

I get Error 3939: There is a mismatch between the number of parameters specified and the number of parameters required.

The update, insert, delete, select & table mappings were created. My table has a primary key.

The update statement has 17 parameters & the parameters collection for the update command has 17 parameters too. One for each placeholder above and 3 extra for lines 5,7 & 8 where placeholders are used as the columnName = 1...

How can this be happening? It's almost as if the dataset software ignores the fact that the placeholders should be substituted for values as it gets the same error that you would get if you simply copied the update into queryman!
5 REPLIES
Enthusiast

Re: Please Help

It seems this is a bug in the Teradata Driver.
Has anyone had experience with this?
Enthusiast

Re: Please Help

This has been logged with Teradata.
Global Support Centre have identified it as a true bug and are dealing with it, no pressure guys, we only go live in 2 weeks.
Enthusiast

Re: Please Help

Workaround as follows:

Private Sub btnUpdateDataSet2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdateDataSet2.Click

If DataSet11.HasChanges Then
CursorOn()
Try
TdCommandBuilder = New Teradata.Client.Provider.TdCommandBuilder(TdDataAdapter1)
TdDataAdapter1.Update(DataSet11.MISRE_Threshold)
Catch ex As Exception
MessageBox.Show(ex.ToString)
MessageBox.Show("Update failed. Possible cause:Constraints.")
End Try

CursorOff()
sbThresholds.Text = "Threshold data updated."
Else
MessageBox.Show("No changes were made to the Dataset.")
End If

End Sub
Fan

Re: Please Help

I'm having this same problem. Any responses from support w/regards to fix?

Enthusiast

Re: Please Help

no but the workaround for the update is fine, td will apparently be packaging the fix with the next release. If you are inserting or deleting then the workaround needs quite a bit of modification.