Dear All,
I would like to know how to get output from a procedure in a table format.
I have created a query and its working fine but am using 4 functions in the query.
Below query uses 4 functions i.e.FN_GET_LIQUID_INVEST, FN_GET_LIQUID_MAX_TRXN,FN_GET_DEMATFOLIO,FN_GET_CONS_FOLIO
Query :
SELECT FOLIO_NO , FIRST_NAME , MOBILE_NO, EMAIL , LIQUID_INVEST_FLAG , PAN_NO, MAX_TRXN_DATE, DEMAT_FOLIO, MERGED_FOLIO
FROM
(SELECT FOLIO_NO,
UPPER(FIRST_NAME) FIRST_NAME,
MOBILE_NO,
EMAIL ,
FN_GET_LIQUID_INVEST(FOLIO_NO) LIQUID_INVEST_FLAG ,
PAN_NO,
FN_GET_LIQUID_MAX_TRXN(FOLIO_NO) MAX_TRXN_DATE,
FN_GET_DEMATFOLIO(FOLIO_NO) DEMAT_FOLIO,
FN_GET_CONS_FOLIO(FOLIO_NO) MERGED_FOLIO
FROM CUSTOMER_MASTER B
)
WHERE MERGED_FOLIO = 'NO'
AND DEMAT_FOLIO = 'N'
AND PAN_NO = 'ABCXYZ'
ORDER BY LIQUID_INVEST_FLAG DESC NULLS LAST, MAX_TRXN_DATE DESC NULLS LAST;
Sample Output:
FOLIO_NO | FIRST_NAME | MOBILE_NO | EMAIL | LIQUID_INVEST_FLAG | PAN_NO | MAX_TRXN_DATE | DEMAT_FOLIO | MERGED_FOLIO |
6074953 | Bhavin | 1234567890 | abc@xyz.com | YES | ABCXYZ | 07-10-16 | N | NO |
8014636 | Bhavin | 1234567890 | abc@xyz.com | NO | ABCXYZ | (NULL) | N | NO |
8014633 | Bhavin | 1234567890 | abc@xyz.com | NO | ABCXYZ | (NULL) | N | NO |
7999534 | Bhavin | 1234567890 | abc@xyz.com | NO | ABCXYZ | (NULL) | N | NO |
7919608 | Bhavin | 1234567890 | abc@xyz.com | NO | ABCXYZ | (NULL) | N | NO |
7999535 | Bhavin | 1234567890 | abc@xyz.com | NO | ABCXYZ | (NULL) | N | NO |
If I execute the procedure with input parameter as pan_no then it should provide output as above. As of now, I have created view on the above query and its working fine.
I want to learn/understand how to get the output of the above query in a table format using procedure i can then incorporate logic of functions in the procedure itself.
Oracle Version :
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
"CORE 11.2.0.3.0 Production"
TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production