how to assign param value to null

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
lk
Posts: 11
Joined: Thu 07 May 2009 01:52

how to assign param value to null

Post by lk » Mon 25 May 2009 01:08

i want to know how to assign param value to null

can do as this:
SQLQuery2.Params.ParamByName('factory_name').AsString := '';

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 25 May 2009 06:57

The recommended way is the following:

Code: Select all

SQLQuery2.Params.ParamByName('factory_name').Value := Null;

lk
Posts: 11
Joined: Thu 07 May 2009 01:52

Post by lk » Thu 04 Jun 2009 05:20

Plash wrote:The recommended way is the following:

Code: Select all

SQLQuery2.Params.ParamByName('factory_name').Value := Null;
hi Plash,
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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 05 Jun 2009 09:14

We could not reproduce the problem. Please send to dbxoda*devart*com a complete small sample that demonstrates the problem.

Post Reply