on 2014 Sep 10 7:56 AM
Sybase SQL Anywhere 12.0.1.4127
This script to reproduce the problem:
CREATE TABLE "DBA"."TEST" ( "ID" INTEGER NOT NULL, "FIELD1" CHAR(10) NULL, "FIELD2" CHAR(10) NULL, PRIMARY KEY ( "ID" ) ) go CREATE FUNCTION "DBA"."MYFUNC1"(in cVar char(10)) RETURNS char(10) DETERMINISTIC BEGIN DECLARE cRetOut char(10); SET cRetOut = cVar; RETURN cRetOut; END go
Execute SQL-query
select distinct ID, FIELD1, FIELD2 from dba.TEST order by dba.MYFUNC1(FIELD2)
why the error occurs:
Could not execute statement. Function or column reference to 'dba' in the ORDER BY clause is invalid SQLCODE=-854, ODBC 3 State="42000"
although if you run the same query, but in the section "order by", specify the UDF without owner, there is no error:
select distinct ID, FIELD1, FIELD2 from dba.TEST order by MYFUNC1(FIELD2)
At the same time in Sybase SA 8.0.3.5594 both SQL-query executed without error.
Thank you for the bug report. I have opened this as CR #771044 with our development group.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The fact that the problem is that I do not support - very much it is expensive.
Maybe then You (developers ASA) can issue an updated release SQLA1201_Developer.exe which will include the latest fixes ?
P.S. The current release includes SQLA1201_Developer.exe only EBF 12.0.1.4134
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can You give a link to this fix (EBF) or a link to SQLA1201_Developer.ehe which includes this fix ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It turned out there has an update that fixes this bug ? What is his number (build) ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
================(Build #4165 - Engineering Case #771044)================ The server may have incorrectly returned the error: 'Function or column reference to '<user-name>' in the ORDER BY clause is invalid', if a select statement used a user-defined function with an owner name in the ORDER BY clause; e.g. ORDER BY <user-name>.<function-name(...). this="" has="" been="" fixed.="" <="" pre="">
User | Count |
---|---|
71 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.