Unanswered: INSERT SQL to Server via Command with NULL
i hope so much you can help me.
The whole day i tried to resolve a Problem.
Via a ADODB.Command i tried to send a INSERT SQL to Oracle (9i).
The SQL-String ist prepared
"INSERT INTO [TBL] VALUES (:[FLD1],:[FLD2],:[FLD3])"
The values are parameters.
The Programm works fine. I get all Questions correct, i have tested with parameters, but the INSERT will not work.
The Problem is, that (i.E. FLD3) is a nullable foreign key.
I have tried it with DataTypeEnum adEmpty... this was a fatal error ^^
I tried it with the orginal datatyp (Number) und value NULL und so Oracle talk instead to me:
"ORA-02291 integrity constraint (string.string) violated - parent key not found"
In SQL-Plus i have no Problems to set up this SQLString with Value : NULL so it can't be possible the Problem is in Oracle.
Know everyone how i say it correct that this Field is NULL ?
(SYSMENU_T_NAME is correct writen, i dont know this shown here with spaces)
The parameters input to the array is correct, i have checked it with an extra text output.
Param's Input to the Command Object:
Set cmOraDCUP = New ADODB.Command
.ActiveConnection = cnOraDCUP
.CommandText = strSQL
.CommandType = adCmdText
For i = LBound(m_parArray) To UBound(m_parArray)
.Parameters.Append .CreateParameter(m_parArray(i).parName, _
Set rsOraDCUP = .Execute(m_lngRecordsAffected)
My Computer lives danger at this time.. pls help him.
thanks for interesting my problem.
This Constraintfield is a Number(38) and accept NULL.
I have tried it positive in SQL-Plus.
On my investigation of this problem i came more and more to the result it must be a locatet in VB (ADO).
The Programm didn't accept my parameternames und put the param's one by one into the serversyntax.
Is the SQL String (i.e.):
select col0 from tbl1 where col1=:param1 and col2 =:param2;
So VB do that so:
1st param get: name "param1" value.....
2nd param get: name "param2" value....
It works fine!
1st param get: name "param2" value...
2nd param get: name "param1" value...
So VB will but the param "param2" on the col1 clausel and "param1" to the col2 clausel.