I am receiving an error when transferring fields from a Notes database to ISeries table. I successfuly transfer to the first table but it stops transfrerring to the 2nd table with the error:
Agent Manager: Agent message: Error 12325: Error: [IBM][CLI Driver][AS] SQL0407N Assignment of a NULL value to a NOT NULL column “*N” is not allowed. SQLSTATE=23502, Co
I shortened up the field list in the code to narrow it down where it failed. It inserted a record up to field8. The 3 fields that it failed in are data type CHAR in the ISeries table. They are not null as I indicate below. This just does not make sense. Does anyone know what could be stopping fields of type text from inserting into table columns of type CHAR. Any help would be appreciated. Thanks. Code follows below with additional comments.
By the way I could not Remote Debug as it crashes the server
'Successful transfer disconnect
Call destcon.Disconnect
'Beginning of failing code
Dim destCon2 As New LCConnection (“db2”)
destCon2.Database = “databasename”
destCon2.Userid = “username”
destCon2.Password = “password”
destCon2.Metadata = “library.filename”
destCon2.nojournal = True
destCon2.Connect
Print "connected to backend ISeries files. "
Set field1 = fields2.Append(“TRANS0STAT”, LCTYPE_TEXT)
Set field2 = fields2.Append(“ID02”, LCTYPE_TEXT)
Set field3 = fields2.Append(“SYMBOL”, LCTYPE_TEXT)
Set field4 = fields2.Append(“POLICY0NUM”, LCTYPE_TEXT)
Set field5 = fields2.Append(“MODULE”, LCTYPE_TEXT)
Set field6 = fields2.Append(“MASTER0CO”, LCTYPE_TEXT)
Set field7 = fields2.Append(“LOCATION”, LCTYPE_TEXT)
Set field8 = fields2.Append(“AMEND0NUM”, LCTYPE_TEXT) ’ Worked to this point
Set field9 = fields2.Append(“EFF0YR”, LCTYPE_TEXT)
Set field10 = fields2.Append(“EFF0MO”, LCTYPE_TEXT)
Set field11 = fields2.Append(“EFF0DA”, LCTYPE_TEXT) 'Failed
field1.Value = curdoc.Status(0)
field2.Value = curdoc.ID02(0)
field3.Value = curdoc.Symbol(0)
field4.Value = curdoc.Policy0Num(0)
field5.Value = curdoc.Module(0)
field6.Value = curdoc.MasterCo(0)
field7.Value = curdoc.LocCo(0)
field8.Value = curdoc.Amend0Num(0) Good to here. Failed in the next 3 fields
field9.Value = curdoc.EFF0YR(0) Data in Notes Text “108”
field10.Value = curdoc.EFF0MO(0) “08”
field11Value = curdoc.EFF0DA(0) “25”
'field12.Value = curdoc.EXP0YR(0) I imagine it would fail with the same error for the next 3 fields
'field13.Value = curdoc.EXP0MO(0)
'field14.Value = curdoc.EXP0DA(0)
'field15.Value = curdoc.INSTAL0TRM(0)
'field16.Value = " " 'BLANK FOR NMB0INSTAL
'field17.Value = curdoc.RISK0STATE(0)
'field18.Value = curdoc.COMPANY0NO(0)
'field19.Value = curdoc.BRANCH(0)
'field20.Value = curdoc.PROFIT0CTR(0)
'field21.Value = curdoc.AgentL(0)
'field22.Value = curdoc.AgentM(0)
'field23.Value = curdoc.AgentR(0)
'field24.Value = curdoc.ENTER0DATE(0)
Call destcon2.Insert (fields2)