Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Hi i need to write a query on the following requirement.

SELECT COMM_TEXT
INTO :WS_MIKM_COMM_TEXT
FROM MPIPROD.MIKMV01
WHERE ACCOUNT_NO = :WFD_ACCOUNT_NO
AND (SUBSTR(COMM_TEXT,1,39) = :WS_COMMENT_TEXT
AND SUBSTR(COMM_TEXT,47,14) = :WS_DENY_DESC)
OR (SUBSTR(COMM_TEXT,1,39) = :WS_COMMENT_TEXT)

The above query is to be modified. The requirement is if
both the fields are equal then that has to be given
priority. In the above query if it satisfies any one it
comes out without checking if both being equal is possible.



Hi i need to write a query on the following requirement. SELECT COMM_TEXT ..

Answer / satish

SELECT COMM_TEXT
INTO :WS_MIKM_COMM_TEXT
FROM MPIPROD.MIKMV01
WHERE (CASE WHEN (SUBSTR(COMM_TEXT,1,39 = :WS_COMMENT_TEXT)
AND SUBSTR(COMM_TEXT,47,14) = :WS_DENY_DESC)) THEN 1
ELSE
(SUBSTR(COMM_TEXT,1,39) = :WS_COMMENT_TEXT) THEN 2
END) IN (1,2)
AND ACCOUNT_NO = :WFD_ACCOUNT_NO


Tell me if i am wrong??


ACCOUNT_NO = :WFD_ACCOUNT_NO
AND CASE
OR (SUBSTR(COMM_TEXT,1,39) = :WS_COMMENT_TEXT)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

What is a data page?

1 Answers  


what is the use of cursors?

3 Answers   iGate,


What is the difference between Primary key and unique index?

6 Answers  


what is the certification that has a good value for a practioner in mainframes but not habving much knowledge on db2 related stuff?

2 Answers  


could you give me an example how, where i code CHECKPOINT and restart...I need and example....thanks..

5 Answers  


In cobol+DB2program if the code of cobol program has changed than i have to do precompilation once again?

6 Answers   TCS,


Explain the use of the WHERE clause.

2 Answers   IBM,


What is db2 connect?

0 Answers  


I use CS and update a page. Will the lock be released after I am done with that page?

2 Answers  


I need to view the number of tables existing under one particular Owner. Is it possible? If so, pl give the SQL query for this?

3 Answers  


how to fetch multiple records without using cursor

14 Answers   HCL,


what are bind concepts in db2 cobol?

0 Answers  


Categories