Unix Technical Forum

rank(), denseRank() etc...

This is a discussion on rank(), denseRank() etc... within the DB2 forums, part of the Database Server Software category; --> Hi all, I am trying to learn DB2 on os390 and this is my version is : Database server ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 05:40 PM
TP
 
Posts: n/a
Default rank(), denseRank() etc...

Hi all,

I am trying to learn DB2 on os390 and this is my version is :
Database server = DB2 OS/390 7.1.1

I was trying to run this query
=====================
SELECT EMPNO, RANK() OVER(ORDER BY EMPNO) AS RANK# ,DENSE_RANK()
OVER(ORDER BY EMPNO) AS DENSE# FROM DSN8710.EMP ORDER BY EMPNO
=====================
and i get this error
====================
DBA2191E SQL execution error.

com.ibm.db.DataException: A database manager error occurred. :
[IBM][CLI Driver][DB2] SQL0104N An unexpected token "(" was found
following "". Expected tokens may include: ", FROM INTO ".
SQLSTATE=42601
==================

Any ideas why I am getting this error? I think 7.1.1 should support
these functions? I tried these on 3270 but I got the same errors.

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 05:40 PM
PM \(pm3iinc-nospam\)
 
Posts: n/a
Default Re: rank(), denseRank() etc...

I don't think the olap functions are available on mvs/os390/zos db2.

For portable sql, you can look at the
The SQL Reference for Cross-Platform Development

http://www-106.ibm.com/developerwork...206sqlref.html

The doc for your version is here
http://www-306.ibm.com/software/data...0/library.html

PM

"TP" <tpass001@hotmail.com> a écrit dans le message de
news:5947ff63.0401200643.ddbb88a@posting.google.co m...
> Hi all,
>
> I am trying to learn DB2 on os390 and this is my version is :
> Database server = DB2 OS/390 7.1.1
>
> I was trying to run this query
> =====================
> SELECT EMPNO, RANK() OVER(ORDER BY EMPNO) AS RANK# ,DENSE_RANK()
> OVER(ORDER BY EMPNO) AS DENSE# FROM DSN8710.EMP ORDER BY EMPNO
> =====================
> and i get this error
> ====================
> DBA2191E SQL execution error.
>
> com.ibm.db.DataException: A database manager error occurred. :
> [IBM][CLI Driver][DB2] SQL0104N An unexpected token "(" was found
> following "". Expected tokens may include: ", FROM INTO ".
> SQLSTATE=42601
> ==================
>
> Any ideas why I am getting this error? I think 7.1.1 should support
> these functions? I tried these on 3270 but I got the same errors.
>
> Thanks.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com