Problem in retrieving string data which have only spaces

Problem in retrieving string data which have only spaces

Postby Yurii » Wed 17 Mar 2010 14:41

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
Yurii
 
Posts: 7
Joined: Wed 17 Mar 2010 14:22

Postby StanislavK » Thu 18 Mar 2010 14:38

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.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby Yurii » Tue 23 Mar 2010 07:47

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.
Yurii
 
Posts: 7
Joined: Wed 17 Mar 2010 14:22

Postby StanislavK » Tue 23 Mar 2010 10:53

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.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby Yurii » Sat 27 Mar 2010 11:56

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 :)))
Yurii
 
Posts: 7
Joined: Wed 17 Mar 2010 14:22


Return to dotConnect for Oracle