#1  
Old 19th December 2006, 08:20 PM
Ole Willy Tuv
 
Posts: n/a
Default Incorrect fixed-length character string values

drop table if exists test;
create table test (col1 char(5));
insert into test values ('abc');

declare v char(5);
set v = 'abc';

select
col1,
char_length(col1) length_1,
char_length(v) length_2,
char_length(cast('abc' as char(5))) length_3
from test;

The values derived from the variable v and the expression cast('abc' as
char(5)) are obviously wrong (length 3 instead of 5). The value derived from
the test.col1 column is correct (length 5).

Ole


  #2  
Old 19th December 2006, 08:54 PM
Eivind Bakkestuen [NDD]
 
Posts: n/a
Default Re: Incorrect fixed-length character string values

> The values derived from the variable v and the expression cast('abc'
> as char(5)) are obviously wrong (length 3 instead of 5). The value
> derived from the test.col1 column is correct (length 5).


collected in #2301 (ditto for the cast... concatenation in the where
clause).

--

Eivind Bakkestuen
Nexus Database Systems Pty Ltd


  #3  
Old 22nd December 2006, 07:16 AM
Hannes Danzl[NDD]
 
Posts: n/a
Default Re: Incorrect fixed-length character string values

Eivind Bakkestuen [NDD] wrote:

> > The values derived from the variable v and the expression cast('abc'
> > as char(5)) are obviously wrong (length 3 instead of 5). The value
> > derived from the test.col1 column is correct (length 5).

>
> collected in #2301 (ditto for the cast... concatenation in the where clause).


fixed

--

Hannes Danzl [NexusDB Developer]
Newsgroup archive at http://www.tamaracka.com/search.htm


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ann: Embedded Free 3.05.01 downloads fixed Eivind Bakkestuen [NDD] nexusdb.public.announcements 0 16th September 2010 12:11 PM
modifying a column length Matthew Balraj nexusdb.public.support.adoprovider 2 18th February 2010 06:50 PM
2.0591 - issue #2113 not properly fixed Ole Willy Tuv nexusdb.public.support.sql 2 18th July 2006 02:31 AM
Updating string fields with wider values Lachlan Gemmell nexusdb.public.support.sql 3 29th January 2004 11:04 AM
Access 97 - character scrambling Kris nexusdb.public.support.odbc 3 26th December 2003 12:42 PM


All times are GMT +11. The time now is 01:00 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.