IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

woking on a ims-db2 migration pgm

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> IMS DB/DC
View previous topic :: View next topic  
Author Message
ashimer



Joined: 13 Feb 2004
Posts: 374
Location: Bangalore

Posted: Fri Sep 24, 2004 9:02 am    Post subject: woking on a ims-db2 migration pgm  

I am woking on a ims-db2 migration pgm.
I am using the following query in my cursor


Select cols
From table
Where concat(key1,concat(key2,concat(key3,key4))) >= concat(:key1,concat(:key2,concat(:key3,:key4))) in pl1.
Can you plz suggest a better way so that I cud tune up my sql query.



thanks
ashish
Back to top  
ovreddy



Joined: 06 Dec 2004
Posts: 200
Location: Keane India Ltd., Hyderabad

Posted: Thu Dec 16, 2004 5:30 pm    Post subject: One way..  

Hi Ashish,

One way to combine more than two columns is you can use concatination operator ( || ) instead of CONCAT which is more compatible.

select cols from tab where col1 || col2 || col3 || col4 = :col1 || :col2 || :col3 || :col4;

Other wise you can create a function to do this...

Bye,
Reddy.
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> IMS DB/DC
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM