Hi. I am trying to insert an item to a datawindow linked to a table. One of the fields comes from the selection of a dropdownlistbox, that I save in a string variable and insert it to the datawindow.
Once the user have completed to fill all the fields of the datawindow, I do an update, that should reflect in my table. The problem is that powerbuilder says that the field that comes from the dropdownlistbox is null, but that is no true when I debug my program
This is the code Im using:
///////////////////////////////////////////////////////////////
integer i
for i=1 to dw_2.rowcount()
ls_proc_codigo=dw_2.getitemstring(i, 'seg_proc_codigo')
sle_1.text=ls_proc_codigo
dw_1.setitem(dw_1.insertrow(0), 'seg_ane_codigo', ls_ane_codigo)
dw_1.setitem(dw_1.insertrow(0), 'seg_proc_codigo', string(ls_proc_codigo))
dw_1.setitem(dw_1.insertrow(0), 'seg_ane_nombre', ls_ane_nombre)
dw_1.setitem(dw_1.insertrow(0), 'seg_usr_crea', gs_usuario)
dw_1.setitem(dw_1.insertrow(0), 'seg_fech_crea', gd_sysdate)
//messagebox("ls_proc_codigo", ls_proc_codigo)
if dw_1.update()=1 then
COMMIT using SQLCA;
messagebox("Aviso", "registro actualizado")
ELSE
ROLLBACK using SQLCA;
MessageBox("Error","Save failed" + Char(10) + SQLCA.SQLErrText, information!)
END IF
next
///////////////////////////////////////////////////////////////
When I debug this code, I confirm that ls_proc_codigo is not null, but when I do the datawindow update, the database returns me an error saying that Im trying to insert null in a field where goes ls_proc_codigo (seg_proc_codigo).
I have to say that seg_proc_codigo and seg_ane_codigo are the primary key in the table, and ls_proc_codigo is string, and seg_proc_codigo is varchar
Why powerbuilder is saying ls_proc_codigo is null, and when I debug it, I see thats no true?
Once the user have completed to fill all the fields of the datawindow, I do an update, that should reflect in my table. The problem is that powerbuilder says that the field that comes from the dropdownlistbox is null, but that is no true when I debug my program
This is the code Im using:
///////////////////////////////////////////////////////////////
integer i
for i=1 to dw_2.rowcount()
ls_proc_codigo=dw_2.getitemstring(i, 'seg_proc_codigo')
sle_1.text=ls_proc_codigo
dw_1.setitem(dw_1.insertrow(0), 'seg_ane_codigo', ls_ane_codigo)
dw_1.setitem(dw_1.insertrow(0), 'seg_proc_codigo', string(ls_proc_codigo))
dw_1.setitem(dw_1.insertrow(0), 'seg_ane_nombre', ls_ane_nombre)
dw_1.setitem(dw_1.insertrow(0), 'seg_usr_crea', gs_usuario)
dw_1.setitem(dw_1.insertrow(0), 'seg_fech_crea', gd_sysdate)
//messagebox("ls_proc_codigo", ls_proc_codigo)
if dw_1.update()=1 then
COMMIT using SQLCA;
messagebox("Aviso", "registro actualizado")
ELSE
ROLLBACK using SQLCA;
MessageBox("Error","Save failed" + Char(10) + SQLCA.SQLErrText, information!)
END IF
next
///////////////////////////////////////////////////////////////
When I debug this code, I confirm that ls_proc_codigo is not null, but when I do the datawindow update, the database returns me an error saying that Im trying to insert null in a field where goes ls_proc_codigo (seg_proc_codigo).
I have to say that seg_proc_codigo and seg_ane_codigo are the primary key in the table, and ls_proc_codigo is string, and seg_proc_codigo is varchar
Why powerbuilder is saying ls_proc_codigo is null, and when I debug it, I see thats no true?