i want to know how to assign param value to null
can do as this:
SQLQuery2.Params.ParamByName('factory_name').AsString := '';
how to assign param value to null
The recommended way is the following:
Code: Select all
SQLQuery2.Params.ParamByName('factory_name').Value := Null;
hi Plash,Plash wrote:The recommended way is the following:Code: Select all
SQLQuery2.Params.ParamByName('factory_name').Value := Null;
I hvae try this way, use DevartOracle mode it's work fine,
but in DevartOracleDirect mode it's have problem
in DevartOracleDirect mode
SQLQuery2.Active := False;
SQLQuery2.Params.ParamByName('dname').Value := null;
SQLQuery2.Params.ParamByName('DEPTNO').AsInteger := 10;
SQLQuery2.ExecSQL();
showMessage(inttostr(SQLQuery2.RowsAffected));
the result RowsAffected = 0 and in database the data not changed,
SQLQuery.sql:
update dept
set dname = :dname
where DEPTNO = :DEPTNO
table dept oracle demo database scott/tiger