Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kaldubai
Creator
Creator

running PL-SQL

im trying to fetch one of the view from oracle erp

but in order to fetch the view i need to run a procedure to set the parameters otherwise it will be showing me 0 records

can some1 please advise

ODBC CONNECT TO [Qlik-oracle];

begin

SQL EXEC apps.mo_global.set_policy_context(p_access_mode => 'S', p_org_id => 397);

end;

Sale:

LOAD "SHR_ID",

    SHR,

    "CUST_NUM",

    "CUST_NAME",

    "CUSTOMER_PHONE",

    "CTT_CLASS",

    "TRX_DATE",

    "TRX_NUMBER",

    "SALESREP_NUMBER",

    "SALESREP_NAME",

    "SOR_NUMBER",

    "BRAND_CODE",

    "BRAND_NAME",

    "ITEM_ID",

    SEGMENT1,

    DESCRIPTION,

    QTYS,

    QTYR,

    "SOLD_VALUE",

    "RET_VALUE",

    "HDR_DISC",

    "HDR_DISC_REASON",

    "PL_DISC_AMT",

    "LINE_DISC",

    "LINE_DISC_PERC",

    "LINE_CHANGE_REASON_CODE",

    "LINE_DISC_REASON",

    "LINE_DISC_APPROVER_NAME";

SQL SELECT *

FROM APPS."AMF_SALE_VIEW_WD";

1 Solution

Accepted Solutions
kaldubai
Creator
Creator
Author

the solution to this was as below:


sql call

//begin

  apps.mo_global.set_policy_context(p_access_mode => 'S', p_org_id => 397);


I just had to comment out the begin key word and it worked just fine.


check the below thread for reference

Extracting views from Oracle

View solution in original post

4 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Please do not post the same question twice (even when in different forums). You will turn a single discussion in two threads and as a result split the attention. We can all see your original question in the general overview.

Original discussion: running PL-SQL

maxgro
MVP
MVP

try (passing parameter by position)

odbc connect .....;

SQL

{CALL apps.mo_global.set_policy_context('S', 397) } ;


load      .....;

sql select     ....;

kaldubai
Creator
Creator
Author

@peter

thanks for notifying.

kaldubai
Creator
Creator
Author

the solution to this was as below:


sql call

//begin

  apps.mo_global.set_policy_context(p_access_mode => 'S', p_org_id => 397);


I just had to comment out the begin key word and it worked just fine.


check the below thread for reference

Extracting views from Oracle