Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Output from a procedure in a table format

Bhavin MamtoraOct 10 2016 — edited Oct 20 2016

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_NOFIRST_NAMEMOBILE_NOEMAILLIQUID_INVEST_FLAGPAN_NOMAX_TRXN_DATEDEMAT_FOLIOMERGED_FOLIO
6074953Bhavin 1234567890abc@xyz.comYESABCXYZ07-10-16NNO
8014636Bhavin 1234567890abc@xyz.comNOABCXYZ(NULL)NNO
8014633Bhavin 1234567890abc@xyz.comNOABCXYZ(NULL)NNO
7999534Bhavin 1234567890abc@xyz.comNOABCXYZ(NULL)NNO
7919608Bhavin 1234567890abc@xyz.comNOABCXYZ(NULL)NNO
7999535Bhavin 1234567890abc@xyz.comNOABCXYZ(NULL)NNO

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

This post has been answered by unknown-7404 on Oct 10 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 7 2016
Added on Oct 10 2016
13 comments
5,915 views