Accessing package variable through DB link

Hi,
I have ref cursor variable in remote DB package and want to refer that in another script.
v_refcur rem_package.generic_cursor_type@REMOTEDB
and accessing procedure in the remote DB
I am getting the following error
ORA-20111: ORA-02064: distributed operation not supported
ORA-06512: at "user.XXHJ_API", line 1097
ORA-06512: at line 43
any help is appreciated..

Ref Cursors are not supported across databases.
Explain in more detail as to what you are trying to achieve and someone here can suggest alternatives.

Similar Messages

  • Accessing a packaged variable through db link

    How do I access a packaged variable remotely? (Syntax)

    You cannot do that:
    SQL> conn xx/xx@xx
    Connected.
    SQL> create package p is
      2   a number;
      3  end;
      4  /
    Package created.
    SQL> conn yy/yy@yy
    Connected.
    SQL> desc p@yy
    SQL> set serveroutput on
    SQL> create synonym p1 for p@xx;
    Synonym created.
    SQL> desc p1;
    SQL> begin
      2    p1.a := 1;
      3    dbms_output.put_line(p.a);
      4  end;
      5  /
      p1.a := 1;
    ERROR at line 2:
    ORA-06550: line 2, column 6:
    PLS-00512: Implementation Restriction: 'P1.A': Cannot directly access remote package variable or cursor
    ORA-06550: line 2, column 3:
    PL/SQL: Statement ignoredInstead you should access these variables via functions and/or procedures. In following example I've created the private variable in package p but this doesn't matter whether it is private or public.
    SQL> conn xx/xx@xx
    SQL> create or replace package p is
    2 procedure set_a (v in number);
    3 function get_a return number;
    4 end;
    5 /
    Package created.
    SQL> ed
    Wrote file afiedt.buf
    1 create or replace package body p is
    2 a number;
    3 procedure set_a (v in number) is
    4 begin
    5 a := v;
    6 end;
    7 function get_a return number is
    8 begin
    9 return a;
    10 end;
    11* end;
    SQL> /
    Package body created.
    SQL> conn yy/yy@yy
    Connected.
    SQL> set serveroutput on
    SQL> desc p1
    FUNCTION GET_A RETURNS NUMBER
    PROCEDURE SET_A
    Argument Name Type In/Out Default?
    V NUMBER IN
    SQL> ed
    Wrote file afiedt.buf
    1 begin
    2 p1.set_a(1);
    3 dbms_output.put_line(p1.get_a);
    4* end;
    SQL> /
    1
    PL/SQL procedure successfully completed.
    Gints Plivna
    http://www.gplivna.eu

  • Forms 9i accessing package variables

    I created a package in my sql session which contains only variables. When I connect to the database through Oracle Forms and try to access these variables in a trigger I receive the error "Cannot directly access remote package variables or cursor" How can I access these variables from within a forms module?

    You cannot access package variable or constants directly from a remote PL/SQL client. Only PL/SQL running on the server can access these. You need to implement get and set methods in the package.

  • Accessing Package variables

    Hi friends..
    I have to access the value of a variable which is declared public in the package in a select statement
    i tried this way
    select package_name.variable_name from dual; which is not working.
    I had a alternate solution..Declare a function in the package to make the value return by a function and access the function in the select statement.
    Is this approach correct or do i have any other alternatives?
    Thanks,
    Dwarak.k

    The reason that this does not work is that the SQL Engine cannot simply read a value residing in the package state in the PL/SQL Engine. SQL has no means to access (read or write) that value - only the PL/SQL Engine has.
    The SQL engine can however call PL/SQL functions - and such a function running in PL/SQL can access whatever it likes within the PL/SQL context.
    Is this a good idea, using package state for static variables from a SQL perspective?
    My initial reaction is that it's not a good idea. Primarily because the majority of database clients today are stateless clients - even within the J2EE context.
    For example, your Java Application Server creates a pool of 10 connections to Oracle. User John connects and is serviced by pool process 5. A PL/SQL state variable is set in that Oracle connection. The very next request from user John is serviced by pool process 9 - as pool process 5 is busy servicing Scott.
    Just who will be reading whose static PL/SQL state variables?
    PL/SQL static/state variables should be limited for use by PL/SQL only. E.g. something that I always do is to create a package called CONST (after the constants declaration in Pascal/Delphi) and define all my PL/SQL statics there.
    The PL/SQL code must be written being aware that each new call can be made from another front-end user (resetting session state becomes important).
    For other constants... - that is why lookup and application configuration tables should be created. Single copy of the data. Concurrency catered for. Data integrity provided.

  • Select from dual  into a variable through db links

    HI,I need to select value of current_timestamp in to a variable d1 of a remote database inside function.
    function (db_lnk varchar2)return number
    as
    dbl varchar2(10);
    begin
    dbl:=db_lnk;
    select current_timestamp into d1 from dual@dbl;
    end;
    but getting error table or v iew does not exist.
    if i do
    select current_timestamp into d1 from dual@'||dbl||';
    then it says database link name expected.
    How to achieve this?
    Thanks

    Peter Gjelstrup wrote:
    Foreign languages, foreign languages :-){noformat}*grins*{noformat} I know - and your English is miles better than my Danish (I'm assuming - hopefully correctly?! - that that's your 1st language based on your location!) which I don't even know any words of! *{:-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Passing jsp variable through a link

    hi everybody!!
    can anyone help me? i am in great trouble. Here is my problem description....
    I have one jsp page named a1.jsp in this page i have some checkbox in a form. an html link.
    I select a checkbox and when i click the link then onclick() event of the link execute the javascript function and take the value of the checkbox in a variable.
    I want to take the value to the page a2.jsp when i click the link.
    Please help me!!
    Here is my sample code............
    this is the code of a1.jsp page
    when i click the link named(click the link below i ) i want to go to page a2.jsp by taking the script variable a;
    <script>
    var a=" ";     
    function submitForm()
    a="shakil";
    </script>
    <a href="a2.jsp" onClick="submitForm();">Click the  link</a>_______________________________________________________

    hi,
    a1.jsp
    <script>
    var a=" ";     
    function submitForm()
         a="shakil";
    window.top.location.href ="./a2.jsp?a="+ a;
    </script>
    Click the linka2.jsp
    hello: <%=request.getParameter ( "a" ) %>

  • How to find unused variable through sequence

    Hi,
    I would like to know if it is possible to find unused variable through sequence in order to suppress them ?
    Thank you

    Hi,
    If you're fixed on that version of TestStand for a while (for whatever reason) and you see this situation coming up again, you could always build a small tool to automate the process.
    From the current sequence file's handle, you could traverse all the locals and file globals to make a list of all variables and then search the sequences step by step to see if they're in use.
    What this won't tell you is if any code modules or custom step types are directly accessing those variables through the sequencecontext handle so removing them can cause issues.
    A secondary approach is to cut all the locals (or whatever the variable scope is) in to a new sequence file (or work with a backup version of your sequence file) and delete them from the existing file and see what errors get thrown up.
    Finally, as Doug suggests, to get a latest copy of TestStand on to another machine, you could download a trial version and work with that if it's a one off. After all - if you find the sequence analyser feature that useful, it's a great reason to consider your upgrade policy / timing in the future anyway!
    Thanks
    Sacha
    // it takes almost no time to rate an answer

  • Package variable

    Can anyone tell me how to access package variables from forms6. When I tried to access, it says 'Implementation Restriction : '|variable name|' : Cannot directly access remote package variable '. Is there any other way to access these variables.
    Thanks in advance,
    Partha

    Anton,
    Thanks for your reply. And this is a very good idea. since I have so many variables to store in the package, I think I need to pass variable name also to the function. I am exploring this feature mainly to replace global variables in forms. could you tell me how best is this idea of replacing global variables in forms with package variables ? and also if you have any sample code using these package variables in forms, could you please send me that.
    Thanks
    Partha
    null

  • Calling public package functions and variables through dblink

    Is it possible to call a global public variable in a package in one database from another package procedure in another database using a database link? If so, could you let me know the syntax? Same question for package functions.

    Hi,
    check this documentation link especially the stmt...
    http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/appdev.102/b14251/adfns_packages.htm#i1007858
    You cannot access remote package variables and constants.May be you can write a function in the remote db which when called will return the variable value.
    for calling remote package functions...
    syntax from documentation is [[schema.]package.]function_name[@dblink][(param_1...param_n)]
    an example given in the above link for this...
    EXECUTE fire_emp1@boston_server(1043);
    Ravi Kumar
    Edited by: ravikumar.sv on Aug 31, 2009 11:29 AM

  • Accessing a Global package variable Via Select

    Hi All,
    I want to access a global variable i.e package global variable through a select query. Is this possible or not possible. Please share some inputs on this.
    Thanks

    Just to clarify that you can reference the global variable if your SQL is itself within PLSQL. It will be bound in.
    CREATE OR REPLACE PACKAGE p1
    AS
      my_global NUMBER := 1;
      FUNCTION f_get_my_global
      RETURN NUMBER;
      PROCEDURE p_do_something;
    END;
    CREATE OR REPLACE PACKAGE BODY p1
    AS
      FUNCTION f_get_my_global
      RETURN NUMBER
      AS
      BEGIN
         RETURN my_global;
      END;
      PROCEDURE p_do_something
      AS
        l1 NUMBER;
      BEGIN
        SELECT /*+ find_me */
               my_global
        INTO   l1
        FROM   DUAL;
      END;
    END;
    SQL>  exec p1.p_do_something;
    PL/SQL procedure successfully completed.
    SQL> select sql_text from v$sql where sql_text like '%find_me%';
    SQL_TEXT
    SELECT /*+ find_me */ :B1 FROM DUAL
    SQL>

  • Can you access packages or sequences via a database link

    I am trying to access a sequence through a database link.
    Does anyone know if this is possible ?

    Hi,
    Thanks very much and I apology for the lack of information in the post.
    I was trying to select from the sequence using
    select myseq@my_link.nextval
    from dual;
    because of this i started looking at web site documentation and could not find any examples or any references to plsql packages or sequences using database links and the oracle documentation on links only specified selecting from tables or views.
    this lead to my post whereas as you described it is my syntax that is the problem.
    thanks again

  • Accessing database package variables from Forms

    I have a database package that populates a table of values, i.e.
    type t_route_list is table of rt_route.RTR_ID%type;
    route_list t_route_list
    route_list gets populated by a package function and I want to access route_list in the Form.
    While I can access other package variables by writing a function that returns the variable, Forms doesnt seem to like functions that return a user defined datatype as above. I have also tried using a procedure with an OUT param instead of a function but it also fails with same error.
    i.e.
    declare
    v_route_list pkg_bulk_route_replace.t_route_list;
    begin
    pkg_bulk_route_replace.init;
    pkg_bulk_route_replace.get_route_list(v_route_list);
    message(v_route_list(1));
    end;
    This will not compile, but removing the index (1) from the last line makes it compile but crash with ORA-0600.
    The code above with message replaced with dbms_out.put_line works fine on TOAD.
    So my question is......
    Can my database package return a plsql table to a form and if so, how?!

    Actually I've got this to work now!
    Thde main culprit appears to be a difference in the version of sql or pl/sql used on forms (version 5) and the database (8.1.7).
    I had defined my table as a nested table. By redefining this as a indexed table, simply by adding on 'index by binary_integer' on my server package, I am suddenly able to access the elements of the table on my form. Fortunately this did not break the server code either - the table was populated using bulk collect and that still works.
    Still got a bit of coding to do, but things are looking up now.

  • How to access the LOB objects through database links??????????????

    How to access the LOB objects through database links??????????????

    Hi
    See:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:52297289480186
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5322964030684
    And you also might want to get a new keyboard, your '?' seems to be stucked....

  • Package Variable accessing...

    Hi all,
    When I try to access a packaged variable from frontend, Its giving a compile-time error :
    Cannot directly access remote package variable or cursor
    Why is it so? Is there any way to directly access them by means of some qualifier, etc.??
    Its working fine when I try to do the same from SQL*Plus session.
    Thanks
    RK Raju

    Package variables cannot be directly accessed from a Form, since it runs on the client, and your package is on the server. Each time your code checked or set a package variable, it would require a network round trip, and it wouldn't take much to ruin your response times.
    The only way is to create a function or procedure in the package that you can call from the Form to set or retrieve the package variable values.

  • ORA-20001: Unauthorized access (security group package variable not set).

    I'm creating an app that uses APEX authentication and features self-registration (working) and forgot password (not working) forms.
    My forgot password is public (requires no authentication). The user provides username and secret answer, which are validated, then provides the new password. I attempt to use htmldb_util.reset_pw to reset the user's password, but it's not working.
    I have a process on the new password page calling a PL/SQL anonymous block that looks like this (see below), where P16_ITEM1 = username and P18_ITEM1 = new password.
    BEGIN
    apex_040000.htmldb_util.reset_pw( V('P16_ITEM1'), V('P18_ITEM1') );
    END;
    I also don't know how to send accurate success/failure messages from such PL/SQL block back to APEX, but that's a separate issue I guess.
    Anyway, when testing via SQL Developer as the user with APEX_ADMINISTRATOR_ROLE, I get the following error:
    ORA-20001: Unauthorized access (security group package variable not set).
    ORA-06512: at "APEX_040000.WWV_FLOW_FND_USER_API", line 22
    ORA-06512: at "APEX_040000.WWV_FLOW_FND_USER_API", line 1220
    ORA-06512: at "APEX_040000.HTMLDB_UTIL", line 1253
    ORA-06512: at line 8
    I've searched previous threads and tried different suggestions with no luck.
    I'm on Oracle DB XE 11g and APEX 4.x.
    Any help will be appreciated. Thanks,
    Alex.

    Anyway, when testing via SQL Developer as the user with APEX_ADMINISTRATOR_ROLE, I get the following error:
    ORA-20001: Unauthorized access (security group package variable not set).When running code outside Apex that depends on the Apex security group being set, run the following before your own code:
    wwv_flow_api.set_security_group_id(apex_util.find_security_group_id('YOUR_SCHEMA_NAME'));Google "wwv_flow_api.set_security_group_id" for more details, such as this blog post:
    http://www.easyapex.com/index.php?p=502
    - Morten
    http://ora-00001.blogspot.com

Maybe you are looking for

  • The difference between a .dmg file & a .cdr file (using Disk Utility) ?

    Hi, In particular, I created both from a DVD using Disk Utility. When I chose "read only" a .dmg was created. When I chose "DVD/CD Master" a .cdr was created. They are exactly the same size. Is there any difference ? Thanks in advance. Pat De Marco

  • Yahoo! Mail - No PUSH NOTIFICATIONS From Sleep Via Wi-Fi - Is There A Fix?

    I'm a power user, 100% positive I've got all the settings correct in the iPad. Push is turned to 'on', I've been to the Advanced screen and made sure that Yahoo is individually set to Push as well. While I have the 3G model since Friday's release, I

  • Cannot find Photoshop Album in My Pictures

    I have been looking all over my C:drive for the Photoshop Album Starter and have located the program but still cannot access the pictures. The digital camera photos folder is empty, however when I open the actual program, the pictures appear. How can

  • [Oracle JDBC Driver]Invalid parameter binding(s).

    Hi there I am using the OracleCachedRowSet, and it works fine until I tries to update a resultset with a null value. When I call rs.acceptChanges(connection); it results in the following exception. Please help if anyone has found a workaround to this

  • Solution on Link Failover for Hosted Webserver

    Hi, One of my customer has Web based application which is hosted over internet on IP provided by ISP. Challange is in case, the ISP link fails webserver is not available. Customer is planning to add one more link from different ISP. How do I Load bal