Oracle Client input string not in correct format.

  • Thread starter Thread starter Bob Clegg
  • Start date Start date
B

Bob Clegg

Hi,
Trying to update Oracle Table by passing params to stored proc.
Throws 'input string not in correct format'
It is my first attempt at writing with the client.
Abbreviated code and oracle procedure header follow .
Thanks
Bob
Dim conn As New OracleClient.OracleConnection(mstrConn)

Dim cmdConn As New OracleClient.OracleCommand

Try

strSQL = "proc_WriteUnitDetails"


cmdConn = New OracleClient.OracleCommand(strSQL, New
OracleClient.OracleConnection(mstrConn))

cmdConn.Parameters.Add(New OracleParameter("id", OracleType.Number, 0,
ParameterDirection.Input, _

True, 0, 0, "", DataRowVersion.Default, mydbNull))

cmdConn.Parameters.Add(New OracleParameter("model_id", OracleType.Number, 0,
ParameterDirection.Input, _

True, 0, 0, "", DataRowVersion.Default, mydbNull))

cmdConn.Parameters.Add(New OracleParameter("installation_id",
OracleType.Number, 0, ParameterDirection.Input, _

True, 0, 0, "", DataRowVersion.Default, mydbNull))

cmdConn.Parameters.Add(New OracleParameter("profile_id", OracleType.Number,
0, ParameterDirection.Input, _

True, 0, 0, "", DataRowVersion.Default, mydbNull))

cmdConn.Parameters.Add(New OracleParameter("description",
OracleType.VarChar, 0, ParameterDirection.Input, _

True, 0, 0, "", DataRowVersion.Default, mydbNull))

cmdConn.Parameters.Add(New OracleParameter("C1_Open_Status_Name",
OracleType.VarChar, 0, ParameterDirection.Input, _

True, 0, 0, "", DataRowVersion.Default, mydbNull))




cmdConn.CommandType = CommandType.StoredProcedure

cmdConn.CommandText = strSQL



cmdConn.Parameters("id").Value = opq.ID

cmdConn.Parameters("model_id").Value = opq.ModelID

cmdConn.Parameters("installation_id").Value = opq.InstallationID

cmdConn.Parameters("profile_id").Value = opq.ProfileID

cmdConn.Parameters("description").Value = opq.Description

cmdConn.Parameters("C1_Open_Status_Name").Value = DBNull.Value

cmdConn.Connection.Open()

j = cmdConn.ExecuteNonQuery()

******************Oracle Header**************

PROCEDURE PROC_WRITEUNITDETAILS(

id IN NUMBER DEFAULT NULL,

model_id IN NUMBER DEFAULT NULL,

installation_id IN NUMBER DEFAULT NULL,

profile_id IN NUMBER DEFAULT NULL,

description IN VARCHAR2 DEFAULT NULL,

C1_Open_Status_Name IN VARCHAR2 DEFAULT NULL
 
Usually this is the .NET framework exception that is thrown when it fails to
convert a string in the suitabble target format. Double check the value of
the string you are are using for numeric parameters...

Patrice
 
Hi Patrice,
Thank you.
regards
Bob
Patrice said:
Usually this is the .NET framework exception that is thrown when it fails to
convert a string in the suitabble target format. Double check the value of
the string you are are using for numeric parameters...

Patrice

OracleType.Number,
 
Back
Top