[teiid-issues] [JBoss JIRA] (TEIID-3474) Inconsistent results of RIGHT function for different datasources

Juraj Duráni (JIRA) issues at jboss.org
Wed May 13 09:03:19 EDT 2015


    [ https://issues.jboss.org/browse/TEIID-3474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13067671#comment-13067671 ] 

Juraj Duráni commented on TEIID-3474:
-------------------------------------

DB2 - If you use "char(integerValue)" the result will have fixed length. That is expected behavior according to DB2 documentation [1]. But function "varchar(integerValue)" returns "usable" result [2]. 

[1] - http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000777.html?cp=SSEPGG_9.7.0%2F2-10-3-2-18
[2] - http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000869.html?cp=SSEPGG_9.7.0%2F2-10-3-2-177

> Inconsistent results of RIGHT function for different datasources
> ----------------------------------------------------------------
>
>                 Key: TEIID-3474
>                 URL: https://issues.jboss.org/browse/TEIID-3474
>             Project: Teiid
>          Issue Type: Bug
>    Affects Versions: 8.7.1.6_2
>         Environment: OS: Fedora 20
> arch: x86_64
> java: oracle 1.8
>            Reporter: Juraj Duráni
>            Assignee: Steven Hawkins
>
> The RIGHT function returns different results for different datasources. Some of those results are inconsistent with definition of the RIGHT(x,y) function.
> =======
> +*Query: SELECT intkey, RIGHT(intkey, 1) FROM table ORDER BY intkey*+
> *Teradata, SQLServer, Sybase, Ingres, MySQL, Oracle (this result is OK):*
> 0	0
> 1	1
> 2	2
> ...
> 10	0
> 11	1
> ...
> 100	0
> 101	1
> *Postgres:*
> 0	0
> 1	1
> 2	2
> ...
> 10	10
> 11	11
> ...
> 100	100
> 101	101
> *DB2:*
> 0	" "
> 1	" "
> 2	" "
> ...
> 10	" "
> 11	" "
> ...
> 100	" "
> 101	" "
> =====
> +*Query:SELECT intkey, RIGHT(intkey, 2) FROM table ORDER BY intkey*+ 
> *SQLServer, Sybase, Ingress, MySQL, Teradata (this result is OK):*
> 0	0
> 1	1
> ...
> 10	10
> 11	11
> ...
> 100	00
> 101	01
> *Oracle:*
> 0	<null>
> 1	<null>
> 2	<null>
> ...
> 10	10
> 11	11
> ...
> 100	00
> 101	01
> *Postgres:*
> 0	0
> 1	1
> 2	2
> ...
> 10	10
> 11	11
> ...
> 100	100
> 101	101
> *DB2:*
> 0	"  "
> 1	"  "
> 2	"  "
> ...
> 10	"  "
> 11	"  "
> ...
> 100	"  "
> 101	"  "



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)



More information about the teiid-issues mailing list