Nested selections (Selection Tab) in hashed file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Nested selections (Selection Tab) in hashed file

Post by avneeshrai »

HI,

We are facing an issue when we insert selection criteria in the SELECTION tab of Hashed file. The below is the select stmt



(COL1='1' or (COL1='2' and COL2=#Param1#) or (COL1='3' and COL2=#Param2#)) and COL3=#Param3#



Then it gives error when we select view data : DSD.UVOpen Retrieve: syntax error. Unexpected symbol. Token was "(". Scanned command was SELECT DSJOB_XML_HF WITH ( COL1 = "1" "or" ( .



NOTE: The hashed file does return data if I remove all the braces , but we are afraid that might change the functionality.



Did anyone work on nested selections in hashed file?



Thanks,
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

you should at lease write:

Code: Select all

(COL1='1' or (COL1='2' and COL2='#Param1#') or (COL1='3' and COL2='#Param2#')) and COL3='#Param3#' 
a apostroph ' before and after the param.
Wolfgang Hürter
Amsterdam
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Post by avneeshrai »

WoMaWil wrote:you should at lease write:

Code: Select all

(COL1='1' or (COL1='2' and COL2='#Param1#') or (COL1='3' and COL2='#Param2#')) and COL3='#Param3#' 
a apostroph ' before and after the param.

Hi,

Thanks , we did try that and get the same error!

'(COL1='1' or (COL1='2' and COL2='#Param1#') or (COL1='3' and COL2='#Param2#'))' and COL3='#Param3#'

Also tried the below which lets us view the data but the logic does not work, the difference in the below stmt is we have used single quotes for the individual OR stmts.


(COL1='1' or '(COL1='2' and COL2='#Param1#')' or '(COL1='3' and COL2='#Param2#')') and COL3='#Param3#'
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Post by avneeshrai »

Hi,

We tried Double Quotes and it Worked
Thanks
Post Reply