RhythmAddict112
Programmer
Hi all,
Working on a new project here at work that is DB2 based...I'm a bit more accustomed to Oracle - at least for now. Anyway, firstly...what tool do most of you use to run ad-hoc queries against db2? Using the "command center" is making me want to pull my hair out. I can't even put queries on mutliple lines...Is this a setting I'm not seeing or something? I tried using the freeware version of TOAD but it won't work - requires me to have version 8.1.6 installed or later - I have v7 I believe.
Secondly, I'm tryin to figure out why my subselect won't work...
here is the SQL
It gives me the following error: SQL0104N An unexpected token ";" was found following "order by department".
Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601
Thanks for your help
All hail the INTERWEB!
Working on a new project here at work that is DB2 based...I'm a bit more accustomed to Oracle - at least for now. Anyway, firstly...what tool do most of you use to run ad-hoc queries against db2? Using the "command center" is making me want to pull my hair out. I can't even put queries on mutliple lines...Is this a setting I'm not seeing or something? I tried using the freeware version of TOAD but it won't work - requires me to have version 8.1.6 installed or later - I have v7 I believe.
Secondly, I'm tryin to figure out why my subselect won't work...
here is the SQL
Code:
select department from
(select dept.description department, papp.appestimate, papp.applicationCd, stat.description, appLoe.loe ,case when stat.description = 'Analysis' then papp.appestimate*.20 when stat.description = 'Design' then papp.appestimate *.10 when stat.description = 'Code' then papp.appestimate *.40 when stat.description = 'Test' then papp.appestimate *.05 when stat.description = 'UAT' then papp.appestimate *.10 when stat.description = 'Completed' then papp.appestimate *.05 when stat.description = 'Requirements' then papp.appestimate *.20 when stat.description = 'Estimates Provided' then papp.appestimate*.10 end ActualWeighted from prtadmin.projectapp papp, prtadmin.applicationloe appLoe, projectmain pmain, prtadmin.status stat, prtadmin.applicationgrp appgrp, prtadmin.application app, departmentGrp dept
where papp.applicationcd = appLoe.applicationCd
and appLoe.year = 2006
and papp.projectid = pmain.projectid
and papp.appstatuscd = stat.statuscd
and appgrp.groupcd = app.applicationgrpcd
and papp.applicationcd = app.applicationcd
and appgrp.deptgroupcd = dept.deptgroupcd
and pmain.overalltargetyear = 2006)
order by department;
It gives me the following error: SQL0104N An unexpected token ";" was found following "order by department".
Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601
Thanks for your help
All hail the INTERWEB!