Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does SQR support the keyword CASE..look at this one

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I am trying to use the following select query in my SQR program. This query works perfect and produces the desired result when I use in my analyzer. But when I include it in my SQR it throws an error at CASE..... do lemme know how to build the BEGIN-SELECT/END-SELECT for this query.
lemme remind you I built it already with so many options but it throws an error in one or the other way around CASE.


SELECT B.DESCR,
(CASE WHEN IsNull(CBT.CRSE_RATE_ID,'')=''
THEN CBT.AMT_PER_UNIT
ELSE R.AMT_PER_UNIT
END) AS AMT_PER_UNIT,
(CASE WHEN IsNull(CBT.CRSE_RATE_ID,'')=''
THEN CBT.FLAT_AMT
ELSE R.FLAT_AMT
END) AS FLAT_AMT,
CBT.CRSE_RATE_ID
FROM PS_CLASS_SBFEE_TBL CBT
INNER JOIN PS_ITEM_TYPE_TBL B ON CBT.ITEM_TYPE=B.ITEM_TYPE AND CBT.SETID=B.SETID
LEFT JOIN PS_CRSE_RATE_TBL R ON CBT.CRSE_RATE_ID=R.CRSE_RATE_ID AND CBT.SETID=R.SETID
WHERE CBT.SETID = 'MATC1'
AND CBT.STRM = '1014'
AND CBT.CRSE_ID = '000562'
AND CBT.CRSE_OFFER_NBR = '1'
AND (R.ACAD_GROUP='ASSOC' OR IsNull(R.ACAD_GROUP,'')='')
 
have you found a solution to this?
I have not been able to find anything from PS and have tried a variety of syntax-
koclub@hotmail.com
 
Have you tried running your SQR with a -S parameter to see the results? You should get each of your cursors listed in the log file. I would think you could examine how SQR parsed the SQL to help make a determination as to what is wrong.
 
The following syntax works for SQLServer on NT platform. Put this all on the same line

begin-select
...
'CLIENT' = CASE ASSIGN.CUST_ID WHEN 'INTERNAL' THEN PROJ.DESCR ELSE CUST.NAME1 END &CLIENT,

end-select
 
If you are using Oracle8i- case statements are not supported.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top