MySQL Forums
Forum List  »  InnoDB

how to handle empty data from select statement inside the procedure
Posted by: khadar mohiddin
Date: May 14, 2012 07:56PM

In the following code how to handle when there are no rows in select statement like in oracle exception NO_DATA_FOUND ????????
HOW TO HANDLE IN MYSQL ??


SELECT A.STATUS, A.VISIBLE, NVL(A.STATUS_STRING_CODE, -1), NVL(A.STATUS_STRING, ''), NVL(A.LOCALE_STRING, ''),
NVL(A.DEVICE_GROUP, 0), NVL(A.CLIENT_IP_ADDR, ''), NVL(A.CLIENT_PORT_NO, 0), NVL(C.DEVICE_GROUP, 0),
NVL(A.MSISDN, '')
INTO dbStatus, dbVisible, dbStatusStrCode, dbStatusStr, dbLocalStr, dbDeviceGrp, dbIpAddr, dbPortNo, dbOffDevGrp,
dbMsisdn
FROM USERS A, USER_DEVICES B, DEVICES C
WHERE A.USER_ID = dbPalId
AND A.USER_ID = B.USER_ID (+)
AND B.DEVICE_ID = C.DEVICE_ID (+);

EXCEPTION
WHEN NO_DATA_FOUND THEN
dbReturn := PAL_DOES_NOT_EXISTS;
goto END_FUNC;

Options: ReplyQuote


Subject
Views
Written By
Posted
how to handle empty data from select statement inside the procedure
2128
May 14, 2012 07:56PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.