How can I call a function table in pipeline via DB link?

I am using a function table in pipeline defined in a remote DB (DB_A) of my DB in local (DB_B) via a link DB (DB_A_REMOTE).

The function table in pipeline is defined in a package with all the specifications of type he needs and works very well when she is called locally but when called it remotely fails

Here is an example configuration in DB_A:
connect scott/tiger
create or replace
package pkg as
  type rec is record (
    dte date
  );
  type rec_set is table of rec;
  
  function dts(p_eff_date date) return rec_set pipelined;
  function dt(p_eff_date date) return date;
end;
/
create or replace
PACKAGE BODY pkg AS

  function dts(p_eff_date date) return rec_set pipelined AS
    r rec;
  BEGIN
    r.dte := p_eff_date;
    pipe row(r);
    r.dte := r.dte+1;
    pipe row(r);
    RETURN;
  END dts;

  function dt(p_eff_date date) return date as
  begin
    return p_eff_date;
  end;

END pkg;
/
In DB_B, I have the following configuration:
create database link DB_A_REMOTE connect to Scott identified by tiger using 'DB_A';
create or replace synonym RPKG for PKG@DB_A_REMOTE;
In DB_A, I can access the two PKG functions very well
SQL> select pkg.dt(sysdate) from dual
DJ.DT(SYSDATE)       
----------------------
21-SEP-2012 11:26:31   

SQL> select * from table(pkg.dts(sysdate))
DTE                  
----------------------
21-SEP-2012 11:26:31   
22-SEP-2012 11:26:31   
23-SEP-2012 11:26:31   
24-SEP-2012 11:26:31   
However, in DB_B the I get the following:
SQL> select rpkg.dt(sysdate) from dual
RPKG.DT(SYSDATE)     
----------------------
21-SEP-2012 11:29:05   

SQL> select * from table(rpkg.dts(sysdate))

Error starting at line 2 in command:
select * from table(rpkg.dts(sysdate))
Error at Command Line:2 Column:20
Error report:
SQL Error: ORA-06553: PLS-752: Table function DTS is in an inconsistent state.
06553. 00000 -  "PLS-%s: %s"
*Cause:    
*Action:
selection rpkg.dt shows I can get to the remote package and run functions in it, but the second line is where my problem.

Why the function table in an inconsistent state and how can I fix this problem so that it will work in all of the linlk database?

Published by: Sentinel on September 21, 2012 11:35

Go! You have posted more than 1,000 times and know that you must provide your Oracle version 4-digit.
>
Why the function table in an inconsistent state and how can I fix this problem so that it will work in all of the linlk database?
>
You can't - it is not supported.

See the note under the PIPELINED clause in the declaration section of the definition of the doc of PL/SQL and function
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e25519/function.htm
>
Note:

You cannot run a function table in pipeline over a database link. The reason is that the return type of a function table in pipeline is a SQL type defined by the user, which can be used in a single database (as explained in the Guide of the Oracle object-relational database developer). Although the return type of a function table in pipeline may appear as a PL/SQL type, the database actually converts this PL/SQL type to a type defined by the corresponding SQL user.
>
Your code using PL/SQL types for these types are implicitly converted to the SQL type needed to access the service using SQL. But the SQL types have an OID (object ID) which is not recognized on the other server so that the other server is unable to create the appropriate type.

If you click on the link provided to the other doc in this note, you will see that even though you can create a type and specify an OID you still won't be able to use it as you wish.
http://docs.Oracle.com/CD/E11882_01/AppDev.112/e11822/adobjbas.htm#ADOBJ7083
>
Restriction on the use of Types defined by the user with a remote database

Objects or user-defined types (specifically, types declared with a SQL CREATE TYPE statement, as opposed to types declared in a PL/SQL package) are currently only useful in a single database. Oracle database limits the use of a link of database as follows:

Unable to connect to a remote database for select, insert, or update a type defined by the user or a REF object on a remote table.

You can use the CREATE TYPE statement with the Optional keyword OID to create an object identifier specified by the user (OID) that allows an object type for use in multiple databases. See the discussion on the attribution of an OID for a type of object in Oracle Database Data Cartridge Developer's Guide.

You cannot use the links from the database of the PL/SQL code to declare a local variable of a type defined by the remote user.

You cannot pass an argument value or return of type user defined in a PL/SQL remote procedure call.

Tags: Database

Similar Questions

  • How can I call two functions in the HTML Form element attributes

    Hello

    I want the same value in the text field two, when I select the value to select the list then the value with a number increment should be two text field.
    I use both java script

    < script >
    function sumItems() {}
    function getVal (item) {}
    If ($x (point) .value! = "")
    Return parseFloat ($x (item) .value);
    on the other
    return 0;
    }
    $x('P19_LAST_END_YR').value = getVal ('P19_LAST_STR_YR') + 1;
    }
    < /script >


    < script >
    function per1Items() {}
    function getVal (item) {}
    If ($x (point) .value! = "")
    Return parseFloat ($x (item) .value);
    on the other
    return 0;
    }
    $x('P19_LAST_END_YR').value = getVal ('P19_START_YEAR') + 1;
    }
    < /script >


    now how can I call function onchange two attributes of the element in the HTML form for the discount:
    ' onChange = "javascript:sumItems()" onChange ="javascript:per1Items().

    Hello

    Try

    onchange="sumItems();per1Items();"
    

    BR, Jari

  • How can I call a function with parameter out of sql

    Hello world
    I'm calling a Sql statement function and I get this error ORA-06572: XX function has arguments.

    can you offer any solution on this workaround.

    Thank you

    Hello

    Sorry, you cannot call functions with OUT arguments (or arguments, but I'll just say in the future) SQL statements.
    This is one of the reasons why many people avoid having arguments in functions.
    THE arguments are never optional. If the function expected of them, you must pass to them.

    Depending on your needs, you can write a Wrapper function that has no arguments.
    For example, if you want to call this function:

    fun1 ( in_out_str      IN OUT  VARCHAR2
         , in_num          IN      NUMBER
         )
    RETURN  NUMBER ...
    

    you don't need really the value changed to in_out_str, then you can write a function like this:

    fun1_wrapper ( in_str          IN      VARCHAR2
                   , in_num          IN      NUMBER
                   )
    RETURN  NUMBER
    IS
        in_str2     VARCHAR2 (32767)  := in_str;
    BEGIN
        RETURN  fun1 ( in_str2
                       , in_num
               );
    END  fun1_wrapper;
    

    You can use fun1_wrapper in a SQL statement, even if you cannot use fun1 in the same statement.

    Published by: Frank Kulash on February 27, 2013 09:42

  • How can I call a function of server by a button?

    Hello world...

    I have a problem...

    I need to call a server function by pressing a button. I put the requirement on the label...

    This is my script:

    writeBtn1.addEventListener (MouseEvent.CLICK, writeFile1);

    private void writeFile1 (e:MouseEvent = null): void
    {
    checkBtn = (writeBtn1.label == 'Confirmation' & & textInput1.text! = "");  my State...
    If (checkBtn)
    {
    NC. Call ("WriteNow", null, textInput1.text + "\n");
    writeBtn1.label = "done";
    }
    }

    I would like to call the function on the release of the button...

    Can someone help me?

    Please...

    Emiliano.

    use:

    writeBtn1.addEventListener (MouseEvent.CLICK, writeFile1);

    writeBtn2.addEventListener (MouseEvent.CLICK, writeFile1);

    writeBtn3.addEventListener (MouseEvent.CLICK, writeFile1);

    private void writeFile1 (e:MouseEvent = null): void
    {
    {if(e.currentTarget==writeBtn1)}

    No matter what

    } else {if(e.currentTarget==writeBtn2)

    do whateverelese

    } else {}

    It's writeBtn3

    }

    }

  • How can I call a function with a parameter?

    Hey guys, I am trying to perform a function within a loop function and I am running into a problem. Whenever I run the program it gives me this error: 1136: Incorrect number of arguments.  1 expected.    However, I can't add the parameter because the function that I'm running is an event. Here is the code:

    package

    {

    import flash.display.Stage;

    import flash.events.Event;

    import flash.events.KeyboardEvent;

    import flash.ui.Keyboard;

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    SerializableAttribute public class extends MovieClip Hero

    {

    public var stageRef:Stage;

    public var health: Number = 6;

    public var speed: number = 3;

    public var leftPressed:Boolean = false;

    public var rightPressed:Boolean = false;

    public var upPressed:Boolean = false;

    public var downPressed:Boolean = false;

    public void Hero()

    {

    stage.addEventListener (KeyboardEvent.KEY_DOWN, keyPressed);

    stage.addEventListener (Event.ENTER_FRAME, loop, false, 0, true);

    }

    public void loop(E:Event):void

    {

    keyPressed();

    {if (leftPressed)}

    x = speed;

    } else {if (rightPressed)

    Speed x +=;

    }

    {if (upPressed)}

    y = speed;

    } else {if (downPressed)

    y += speed;

    }

    }

    public void keyPressed(event:KeyboardEvent)

    {

    If (event.keyCode is Keyboard.LEFT)

    {

    leftPressed = true;

    } else {}

    leftPressed = false;

    }

    If (event.keyCode is Keyboard.RIGHT)

    {

    upPressed = true;

    } else {}

    upPressed = false;

    }

    If (event.keyCode is Keyboard.UP)

    {

    rightPressed = true;

    } else {}

    rightPressed = false;

    }

    If (event.keyCode is Keyboard.DOWN)

    {

    downPressed = true;

    } else {}

    downPressed = false;

    }

    }

    }

    }

    The function definition using what follows, and it should work with and without passing the argument

    public void loop(E:Event=null):void

  • How can I create a function using variables TestStand and call from Meadow step Expression?

    In one sequence, I have dozens of prior Expressions, which are almost the same thing, like this...

    Locals.tagID = (Parameters.singlePhaseEnabled? ('L': "D") & Str (Locals.phase) & "006".

    .. and the only thing different is this three-digit string in the end ("006" may vary). How can I write a function that I can call from Meadow step Expression then it should look like this? ...

    Locals.tagID = MyNewFunction("006")

    You can not write custom expressions for commands.

    That being said, there are two options:

    • Create a sous-suite with a single step. Use a setting of the sequence as "function parameter.

    • Create a step type custom including a lower level module that implements the function. Add a step edit to allow the user to the steptype graciously change the setting.

    • Store the variable setting in a local global variable / file and change the value in each step. This will, at least, keep the same 'function' for each step.

    Norbert

  • How can I call a public function in a component to another component?

    I have two components: form and Confirmation.  Form is a Web and Confirmation is a TitleWindow.

    Form contains several controls and a "submit" button.  Confirmation contains an OK button.  When the user clicks on the button send, Confirmation is displayed above the form (the form is blurred).  When the user clicks OK on the Confirmation button, I want to perform a function on the form to set default values in controls.

    How can I address the function of the component in the form of Confirmation component so I can start the function?

    Thank you!

    Here is the source

    CustomForm.mxml

    http://www.Adobe.com/2006/mxml"width ="400"height ="300">

    public function callBack(): void {}

    lblStatus.text = "success";

    }

    ]]>

    label = "Submit" / >

    CustomTitle.mxml

    http://www.Adobe.com/2006/mxml '.

    layout = "absolute" width = "200" height = "80".

    showCloseButton = "true" closed = "closeMe (event)" "

    backgroundAlpha = "1".

    Color = "#173553" backgroundColor = "#EEEEEE."

    headerColors = «#FFFFFF, #CBCCCC»

    borderColor = "#666666" borderStyle = "solid" >

    Import mx.managers.PopUpManager;

    public var callBack: Function = new Function();

    private void closeMe(event: Event): void {}

    PopUpManager.removePopUp (this);

    callBack();

    }

    ]]>

    TitleWindowSample.mxml
    "" xmlns = "*".
    layout = "absolute".
    Width = "100%" height = "100%".
    creationComplete = "init ()" > "
    Import mx.managers.PopUpManager;
    private void init (): void {}
    customForm.submit.addEventListener (MouseEvent.CLICK, onMouseClick);
    }
    private void onMouseClick(event: MouseEvent): void {}
    customForm.lblStatus.text = "";
    var customTitle: CustomTitle = new CustomTitle();
    customTitle.callBack = customForm.callBack;
    PopUpManager.addPopUp (customTitle, this);
    PopUpManager.centerPopUp (customTitle);
    }
    ]]>
    Width = "100%" height = "100%".
    verticalAlign = "middle" horizontalAlign = "center" >
  • How can I write in a table cell (row, column appear) in a databae?

    How can I write in a table cell (row, column appear) in a database using LabVIEW Database Toolkit? I use Ms Access. Suppose I have three columns in a table, I write 1 row of the 1st column, then 1st rank of the 3rd column. The problem I have is after writing the 1st column of 1st row, the reference goes to the second row, and if I write in the 3rd column, he goes to the 2nd row 3rd column. Any suggestion?

    When you perform a SQL INSERT command, you create a new line. If you want to change an existing line, you must use the UPDATE command (i.e. UPDATE tablename SET column = value WHERE some_column = some_value). The some_column could be the unique ID of each line, date and time, etc.

    I don't know what is the function to use in the Toolbox to execute a SQL command, since I do not use the Toolbox. Also, I don't understand why you don't do a single INSERT. It would be much faster.

  • How can I do this function of towing in a function

    How can I do this function of towing in a function

    //------------------------------------------------------------------------

    function test1(e:Event):void

    {

    box1_mc.x = 5

    }

    function test2(e:Event):void

    {

    box2_mc.x = 5

    }

    //---------------------------------------------------------------------------

    i magine I have 1000 movie clip like that (box1_mc or box2_mc) it will be difficult to do 1000 functions

    I just need to pass the name of the clip, for example. (box1_mc or box2_mc) to the function

    function test(mc:MovieClip):void {}
    MC.x = 5;
    }

    But if you use some sort of event to call the function, you need to change your earpiece.

    What exactly are you trying to do?

  • When I open a new tab by clicking on t he '+' tab, I get a search engine called "-Search. How can I get rid of this? Where is this link?

    When I open a new tab by clicking on t he '+' tab, I get a search engine called "-Search. How can I get rid of this? Where is this link?

    Hello

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.

    Note: This will make you lose all the Extensions and preferences.

    • Sites Web open is not recorded in less than 25 versions of Firefox.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

    Thank you.

  • When I start typing my ID to connect to the e-mail, the program ended my email address and for the safety of the reasons that I don't want that so how can I turn that function off auto

    When logging in to my gmail account, as soon as I start typing my ID program ends my e-mail address. For security reasons that I want to provide my email address complete and password - I don't want to auto fill or auto insert or anything automatic. How can I disable this function?

    • Click on the (empty) input field on the web page to open the drop-down list
    • Select an entry in the drop-down list
    • Press the DELETE key (on a Mac: shift + delete) to remove it.
    • Tools > Options > Security: passwords: "saved passwords" > "show passwords".
  • How can I call a stage, which is in a sous-suite, of a different sous-suite

    Hi, could someone me, please?

    How can I call a stage, which is in a sous-suite, of a different sous-suite.

    For example:

    Two sub sequence, is called, it is called B. In the order B, there is a step called BStep.

    In a sequence, there is a stage called AStep.

    Now, I Hope AStep can I call BStep, how can I do?

    Thank you in advance!

    Allan,

    What you're asking to do is not a practice of good software.  That's like saying you want to call a single line of code into a DLL.

    The best way to do what you want is to put the steps in a 3rd sous-suite.  Then set the subsequence with the parameters of the step.  Then call this subsequence of a sequence and the sequence B 3rd.

    This way, whenever you update the stage, they both get changes.

    Hope this helps,

  • How can I call the stream media player in webworker.

    Hi all.

    I need a few snipets of invoke media player from the webworker blackberry

    How can I call it stream media player in webworker please help me.

    You should be able to:

    location.href = 'mymediaurl';
    
  • How can I disable the function on my v5 acer inspire?

    OT : How can I disable the function on my v5 acer inspire where when you click on the mouse somehow your whole page disappears? It wasn't like this in one of my computers before windows 8.

    How can I activate noff functionality of mouse that causes your entire page to disappear when you click on it the wrong way .i have an acer v5 inspire.please help. Ive had a lot of computers, but this feature never appeared until the windows 8

    Please help its driving me crazy

    James m

    Hello

    Thanks for posting your query on the Microsoft Community.

    According to the description, I understand that you are facing problems with your mouse.

    I suggest you to refer to suggestions of Mohammad_Imran replied on 5 April 2013 and check if that helps.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-TMS/how-to-disable-swipe-gesture-on-touchpad/77c9e8c5-0C5A-4527-a60e-81e8168aec52

    You can also check:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-TMS/how-do-i-change-the-settings-for-my-Windows-8/a0349e35-B090-42fb-A586-feac551a0100

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

  • How can I call Adobe? I need to talk about how to create my site and bind it to lightroom. I have creative cloud.

    How can I call Adobe? I need to talk about how to create my site and bind it to lightroom. I have creative cloud.

    The only phone support I know is not for sales, the use of programs

    You will also likely get detailed assistance in the specific forums for the programs you use

    Forum of https://forums.adobe.com/thread/1929760 to find a forum for your program list

Maybe you are looking for