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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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. |
| ||||
| 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. |