Hi Abu!
I have a SQL database that I can’t change the configurations(DML), beacause the DBA do not permit.
We Have a Collumn Date called C7_YEMBARQ in this Database, the data can be empty, but not NULL.
I can’t register EMPTY DATA in PHP GRID, beacause the data ALWAYS GO NULL to the database.
My collumn configuration is like that:
$col = array();
$col[“title”] = “DT. EMBARQUE”; // caption of column
$col[“name”] = “C7_YEMBARQ”;
$col[“editable”] = true;
$col[“width”] = “110”;
$col[“formatter”] = “datetime”; // format as date
$col[“editrules”] = array(“required”=>false);
$col[“formatoptions”] = array(“srcformat”=>’Ymd’,”newformat”=>’d/m/Y’,”dateformat”=>’d/m/Y’);
$myfieldval .= ‘,’. $col[“name”];
$myfieldnam .= ‘,’. $col[“title”];
$cols[] = $col;
Can you help me?
Couldn’t execute query. SQLState: 23000 Error Code: 515 Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Cannot insert the value NULL into column ‘C7_YEMBARQ’, table ‘PRODUCAO.dbo.SC7010’; column does not allow nulls. UPDATE fails. SQLState: 01000 Error Code: 3621 Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]The statement has been terminated. – UPDATE SC7010 SET C7_YEMBARQ=NULL,C7_YPREFAT=N’20200214′,C7_YPREMBA=N’20191111′,C7_YFUPDT1=N’20191111′,C7_YFUPHR1=N’ ‘,C7_YFUPOB1=N’ ‘,C7_YFUPDT2=N’20191111′,C7_YFUPHR2=N’ ‘,C7_YFUPOB2=N’ ‘,C7_YFUPDT3=N’20191111′,C7_YFUPHR3=N’ ‘,C7_YFUPOB3=N’ ‘,C7_YFUPDT4=N’20191111′,C7_YFUPHR4=N’ ‘,C7_YFUPOB4=N’ ‘,C7_YFUPDT5=N’20191111′,C7_YFUPHR5=N’ ‘,C7_YFUPOB5=N’ ‘,C7_YFUPDT6=N’20191111′,C7_YFUPHR6=N’ ‘,C7_YFUPOB6=N’ ‘ WHERE R_E_C_N_O_ IN (‘179482’)
I’m emailing you updated build. After update, If you set following with date column setting, it will insert empty string instead of NULL.
$col[“isnull”] = false;