This discussion is archived
7 Replies Latest reply: Dec 28, 2012 10:14 PM by 963717 RSS

Multi Org Error

963717 Newbie
Currently Being Moderated
Hi,
procedure get_invoices(cur out t_cursor) -- t_cursor is a ref cursor
as
begin
apps.mo_global.set_policy_context('S',82);

open for cur
select * from ap_invoices_all;


end;

when i call this procedure it is throwing error. {table and view dose not exist }
please anybody guide me how can i use view in procedure.

It's urgent.

Thanks,
GreenX
  • 1. Re: Multi Org Error
    yoonas Expert
    Currently Being Moderated
    Hi,

    In which shcema are you creating this procedure and where are you calling this procedure? When you compiled the procedure it got compiled successfully?

    Regards
    yoonas
  • 2. Re: Multi Org Error
    963717 Newbie
    Currently Being Moderated
    Yes,
    i have a custom scheme and no complied error and i calling this procedure through .Net C#.

    Regards,
    Tariq
  • 3. Re: Multi Org Error
    AlexAnd Guru
    Currently Being Moderated
    >
    procedure get_invoices(cur out t_cursor) -- t_cursor is a ref cursor
    as
    begin
    apps.mo_global.set_policy_context('S',82);

    open for cur
    select * from ap_invoices_all;

    end;
    >
    why you can try to use multi-org by mo_global if you aren't using it in your procedure?

    >
    select * from ap_invoices_all
    >
    this code doesn't use moac

    if you want moac use
    select * from ap_invoices;
    also example Re: When to use MO_GLOBAL.INIT and MO_GLOBAL.SET_POLICY_CONTEXT.


    >
    i have a custom scheme and no complied error and i calling this procedure through .Net C#.
    >
    why do you think what's error of Multi Org?
    why not
    >
    open for cur
    select * from ap_invoices_all;
    >
    ?

    try
    procedure get_invoices(cur out t_cursor) -- t_cursor is a ref cursor
    as
    begin
    
    -- init org_id
    begin
     apps.mo_global.set_policy_context('S',82);
    end;
    
    --open for cur
    open cur for
    select * from ap_invoices;
    
    end;
    --add
    as example using c# to ebs
    https://andyblg.wordpress.com/2012/06/27/c-to-ebs-r12/

    Edited by: AlexAnd on Dec 27, 2012 1:40 AM
  • 4. Re: Multi Org Error
    yoonas Expert
    Currently Being Moderated
    Grant privilege on ap_invoices_all to your custom scheme and use apps.ap_invoices_all in your query
  • 5. Re: Multi Org Error
    AlexAnd Guru
    Currently Being Moderated
    >
    Grant privilege on ap_invoices_all to your custom scheme and use apps.ap_invoices_all in your query
    >
    not quite true for moac

    ap_invoices_all not use moac
    for moac use ap_invoices

    about privilege
    it's may be true but
    >
    i have a custom scheme and no complied error
    >

    looks like OP is lying ;)
    also based on
    >
    open for cur
  • 6. Re: Multi Org Error
    yoonas Expert
    Currently Being Moderated
    Thanks Alex for pointing out that, i will have to read more on moc :)

    Regards
    Yoonas
  • 7. Re: Multi Org Error
    963717 Newbie
    Currently Being Moderated
    Thanks very much AlexAnd.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points