Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DB2 :: RE: Refining an SQL

$
0
0
Author: rajesh1183
Subject: Reply to: Refining an SQL
Posted: Wed May 25, 2016 11:42 am (GMT 5.5)

is it possible to split the query into two..icon_question.gif such that the optimizer would pick the required index based on your query which improves the performance..

Code:

Cursor1:
SELECT COLUMN1, COLUMN2 from TABLE1
Where
(COLUMN3 = :input1 value )


Code:

Cursor2:
SELECT COLUMN1, COLUMN2 from TABLE1
Where
(COLUMN4 = :input2 value )



Code:

IF INPUT3 = 'valid value'
    OPEN, FETCH -- CURSOR2
ELSE
    OPEN, FETCH -- CURSOR1
END-IF

_________________
Thanks,
Rajesh


Viewing all articles
Browse latest Browse all 9405

Trending Articles