Page 1 of 1

Problem in retrieving string data which have only spaces

Posted: Wed 17 Mar 2010 14:41
by Yurii
There is a problem in retrieving string data from DB which have only white spaces.
In DB Exist Field with value " " but on server after query execution i have got "". :(

I want to filter data by this field. But when i set filter, no query by this field is created. If i set enother value everything is fine.

Please, help

Posted: Thu 18 Mar 2010 14:38
by StanislavK
Could you please send us a test project or specify the scenario where the problem occurs in more details? Also, which versions of dotConnect for Oracle and the Oracle database are you using?

We cannot reproduce the problem at the moment.

Posted: Tue 23 Mar 2010 07:47
by Yurii
Oracle11g
Devart - dotConnect Version 5.35.79 (14-Jan-2010)

SQL code:


-- Create table
create table TESTEMPTYSTRNULL
(
STATUS CHAR(1) not null,
NAMESTATUS VARCHAR2(40) not null
)
-- Create/Recreate primary, unique and foreign key constraints
alter table TESTEMPTYSTRNULL
add constraint IDTEST primary key (STATUS)
;


Data:

insert into TESTEMPTYSTRNULL (STATUS, NAMESTATUS)
values (' ', 'Empty');
commit;

I think the problem in primary key.

If you need source code, please tell e-mail adress. I am simply created an ADO.NET Entity Data Model, Domain service, and loaded data from client.

Please, help me to solve this provlem.

Posted: Tue 23 Mar 2010 10:53
by StanislavK
Since Char is fixed-length string type, single space is processed as a trailing one and thus omitted. Please try using the Varchar data type instead of Char. For details, please refer to the Oracle documentation.

Posted: Sat 27 Mar 2010 11:56
by Yurii
StanislavK wrote:Since Char is fixed-length string type, single space is processed as a trailing one and thus omitted. Please try using the Varchar data type instead of Char. For details, please refer to the Oracle documentation.
Thanks :)))