Remote function call of dblink in a procedure by using the parameter as dblink

Hello.

Need to call a function of distance of a procedure with a parameter like dblink. Is this possible?

EX:

DECLARE
remote_db varchar2 (10);
exec_string varchar2 (100);
result varchar2 (10);
BEGIN
remote_db: = myremotedb;
exec_string: = ' miremotefunction@'|| exec_string | "in the result of the double."
run immediately (exec_string);
END;


Any other sugestion?

Thank you very much

Any other sugestion?

Yes, hide all remote objects behind local synonyms. Then you need dynamic SQL and avoid all the headaches.

In the case of link names change in environments, and deployment, simply a new set of synonyms for each environment.

Concerning
Peter

Tags: Database

Similar Questions

  • By using the parameter as a column in a select statement inside the stored procedure.

    I'm doing a variation of what follows. Can someone tell me how to use the parameter passed in the IN clause correctly? Thank you
    drop table test1;
    drop table test2;
    
    CREATE TABLE TEST1
    (
      COL1  NUMBER
    );
    
    CREATE TABLE TEST2
    (
      COL2  NUMBER
    );
    
    insert into test1 values (1);
    insert into test2 values (1);
    
    commit;
    
    create or replace  procedure test_sp (col_name varchar2)
    as
    
    var1 number;
    begin
    
    select col1 into  var1 from test1 where col1 in (select col_name from test2);
    
    end;
    
    exec test_sp ('COL2');
    Deleted table.
    Deleted table.
    Table created.
    Table created.
    1 line of creation.
    1 line of creation.
    Validation complete.
    Created procedure.
    BEGIN test_sp ("COL2"); END;
    Error on line 29
    ORA-01722: invalid number
    ORA-06512: on-site ".» TEST_SP', line 7
    ORA-06512: at line 1

    You must use dynamic sql statements:

    SQL> drop table test1;
    
    Table dropped.
    
    SQL> drop table test2;
    
    Table dropped.
    
    SQL> CREATE TABLE TEST1
      2  (
      3    COL1  NUMBER
      4  );
    
    Table created.
    
    SQL> CREATE TABLE TEST2
      2  (
      3    COL2  NUMBER
      4  );
    
    Table created.
    
    SQL> insert into test1 values (1);
    
    1 row created.
    
    SQL> insert into test2 values (1);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> create or replace  procedure test_sp (col_name varchar2)
      2  as
      3  var1 number;
      4  begin
      5  execute immediate 'select col1 from test1 where col1 in (select ' || col_name || ' from test2)' into var1;
      6  end;
      7  /
    
    Procedure created.
    
    SQL> exec test_sp ('COL2');
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • Call objects (packages-Pl/SQL procedures) DB of the ADF

    Hello

    1. How can we call DB procedures/Packages using ADF?

    2 are there scenarios describing when to use what Layout? & Also any introduction of layouts in the ADF.

    Thank you.

    Hello

    You can expose your PL/SQL package in the form of web services as well and use it on your layout. Check this blog entry on the call of PL/SQL of the ADF, it may be useful
    http://baigsorcl.blogspot.com/2010/05/calling-PLSQL-procedure-and-function-in.html

    This presentation would help understand layouts http://blogs.oracle.com/shay/2010/05/adf_faces_layouts_demo_-ahid.html
    also, you can refer to the guide of the web user interface.

  • Cannot download apps - constantly says that cc has lost functionality I have re installed several times and used the cc cleaning tool - HELP please not very impressed with not be able to use a new customer applications!

    Hi all

    New customer to CC, cc said constantly that he lost the functionality and to re - install, I have done this several times and used the CC cleaning tool. What's the point of having CC if you cannot use this?

    Thanks for your reply, but I spent some time with support online yesterday which has managed to make me sort, I do not have a UPDATER AAM file, I could not delete the contents of the OOBE folder either, I had to rename the folder creative cloud. I was sent then the application manager - who was then updated to the new until I'm able to get apps. Long-term, but it worked. I tried the procedure you have above, just not all the steps worked for me. Thanks to the Member of the support staff who helped me, I have been literally pulling my hair out!

  • Call of duty Black Ops Zombies 2, using the wrong graphics card

    Hello, I recently contacted Activision about the mode of call of duty Black Ops Zombies 2 very agitated and jumpy, like what you would get if you've played online with someone across the world, like really bad lag offline server, now I can play the campaign and multiplayer on the highest graphics settings and have no problem at all just the Zombies mode, even in offline mode. People at Activision back to me and said it could be because the Zombies is using the integrated graphics card Intel CPU and not discrete AMD card, and they said I should contact HP to see if if there is a way to activate manually in Control Panel. I'll link the Forum on Activision's post to read what said the people.
    https://support.Activision.com/Atvi_my_support_case_details?ID=500U0000005nbrlIAA&RMA=0

    If it does not work the link, then let me know and I will copy them here for you to see, if you think you need.

    Hi Goochster,

    I tried the link you provided, but it is inaccessible, unless we have a forum of Activision account.

    Normally, all you have to do is right click on an empty spot on the desktop and select Configure switchable graphics.

    Select it gpu performance and click apply. That should leave the AMD GPU default graphics package.

    Put a check mark in the box for the "saving GPU on battery switch' your laptop will not consume so much battery capacity.

  • How to run a stored procedure by using the steps in database?

    Hello

    I'm trying to run some procedures of the store and it will not work.

    See the file attached is seq.

    I have a varchar parameter (50), which must also be provided to the stored procedure and it returns an int.

    To do this I had to only use data in an open statement

  • Scroll function does not work on Mac if you use the mouse. To scroll, the only way is by using the arrow keys.

    I can also click, hold and drag the scroll to the top and bottom bar.

    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:

    For Firefox versions prior to 29,0:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the "Reset Firefox" line

      button.

    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.

    For Firefox 29,0 and above:

    1. Click the menu button

      click Help

      and select troubleshooting information. Now, should open a new tab containing your troubleshooting information.

    2. At the top right of the page, you should see a button that says "Reset Firefox"

      . Click on it.

    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.

  • WHAT IS THE PROCEDURE TO USE THE SD CARD IN LENOVO K3 NOTE TO MOVE APPS

    I use Lenovo K3Note for these days, I insert card 16 GB but mobile supports the same. Can someone give me the suggessation to how I move my apps on SD card? I'm trying with Lenovo, it shows then Unstall the MOVE updates. Mostily demanding mobile for ROOT.

    If I go into SETTINGS---> storage - SD CARD option. Them is ATTENTION notice "If you select the SD card, applications installed in internal memory cannot be used and that the device will restart, you're sure to change SD CARD?

    Cancel or OK

    Now what do I do to use my SD card which doesn't work with my Lenovo Note K3's.

    Note from the admin; private information published to avoid abuses

    Simply select the option of sd card... The fone restarts n u will be able to move apps to sd card... Good luck...

  • Despite indicating to the path, still have manually pointing DLL every time LV works using the library function node call

    I use the node of the library function call in LV 8.6. I checked the path to specify the box diagram and made directly in the DLL file that I use. Whenever I have started with Labview, I have to go to the diagram and physically find the DLL in one of my calls to make it work properly. Once I have do this everything seems to work as expected. Anyone else see this issue? Any suggestion would be appreciated.

    Thank you

    Steckman wrote:

    I use the node of the library function call in LV 8.6. I checked the path to specify the box diagram and made directly in the DLL file that I use. Whenever I have started with Labview, I have to go to the diagram and physically find the DLL in one of my calls to make it work properly. Once I have do this everything seems to work as expected. Anyone else see this issue? Any suggestion would be appreciated.

    Thank you

    Probably that DLL does not depend on other DLLs that reside in the same directory you point to in the configuration node dialog box call library. What is happening is this:

    Without going into this directory:

    LabVIEW applications Windows to load the DLL, Windows detects that it needs to load other DLLs and can not find in its standard search sites:

    (1) already loaded into memory

    (2) in the application directory (where the exe that began the current process resides in the LabVIEW IDE would be where is LabVIEW.exe)

    (3) in the system directory

    (4) in the Windows directory

    (5) any directory in the PATH environment variable contains

    (6) in the directory 'active '.

    Because Windows cannot find a person to load DLL he abandoned the main DLL loading and returns an error to LabVIEW.

    Now, you go to the configuration dialog box and point to the DLL. The dialog box browse file in LabVIEW uses the standard OS dialog box and this dialog box has the behavior obnoxious always update the "current" directory in the directory where a file got selected in. LabVIEW sees now that the path has "changed" and asks again to load the DLL. Yet once, Windows detects that it needs to load other DLLs too for this DLL but this time going over the search order, it will actually hit the DLL in the same directory and that's all fine.

    It is certainly NOT a problem of LabVIEW. LabVIEW does not and should not really need to know that a DLL needs other DLL loaded and more importantly should never try to think he can do better than Windows, it probably could, but is simply not his task of dependency DLL loading.

    It is your responsibility as a programmer and user of this DLL to know its dependencie, and if you did not write the DLL, to hit the original on his head programmer, if it has not documented these dependencies and make sure that these dependencies are actually properly resolved for Windows placing them in one of the places mentioned above

    ((2) is generally the best location for applications applications because it will not pollute the Windows directory or the user of the application system and 5) is the best for the development machine as you can add a directory to your PATH environment variable where you put the dll you need to develop a specific application.

    Rolf Kalbermatter

  • iTunes problem. Error: R6025 - pure virtual function call

    Original title:

    iTunes problem.

    Trying to open iTunes, I get this error: R6025 - pure virtual function call. Can someone tell me what is the problem?

    Hi Dave,.

    The error indicates iTunes has not been correctly updated.

    Users facing this issue have managed to solve this problem by following the steps below.

    Try to remove all associated iTunes and then rebuild it which is often a good starting point, unless the symptoms indicate a more specific approach.

    Remove and then reinstall iTunes and other components of software for Windows Vista, Windows 7 or Windows 8

    Please return to the State of the question.

  • Call stored procedures and using its output parameters in a report

    Hello

    I have a procedure defined in a package on the database. This procedure returns a number of output parameters. How to call this procedure and use the output parameters in my report?

    Thank you, Mark

    Depends on the level at which the procedure should be called. If its at the State level, call the form in the trigger-REPORT-BEFORE (or AFTER-PARAMFORM) and store the off-values space reserved columns. These you can use anywhere in your report.

  • USING THE parameters in procedures

    Hello Experts;


    Hello all;


    I am trying to run a program by using the parameter of the procedure (IN and OUT IN).

    I have an emp table I want to update the details of the column perk.


    > > Here is coding > >


    1 create or replace procedure emp_salary

    2 (id IN emp.eid%type, salary IN OUT emp.esalary%type) IS

    number of tmp_sal 3.

    4 BEGIN

    5. Select esalary in the tmp_sal of the emp where eid = id;

    6 If tmp_sal between 10000 and 20000 THEN

    7 salary_inout: = tmp_sal * 1.2;

    8 tmp_sal between 20001 and 29999 ElseIf THEN

    9 salary_inout: = tmp_sal * 1.8;

    10 if ELS tmp_sal > 30000 then

    11 salary_inout: = tmp_sal * 2.0;

    12 * END;

    SQL > /.

    CAUTION: Procedure created with compilation errors.

    SQL > show errors;

    PROCEDURAL EMP_SALARY errors:

    LINE/COL ERROR

    -------- -----------------------------------------------------------------

    10/5 PLS-00103: encountered the symbol "IF" when awaits an of the

    Next: =. ( @ % ;   The symbol ';' was replaced by 'IF' continue.

    12/4 PLS-00103: encountered the symbol ";" when expecting one of the

    Suite: If

    MY version of DB is: 10.2.0.1

    Details of the EMP:


    SQL > select * from emp;

    | EID | ENAME |  EQUAL |  ESALARY | ECITY |  EPERK |

    1 sona |   MBA |  10000 | ********    |            |

    Maya 2 |   MCA |  15000 |  **********|            |

    3 sony |   MSC |  20000 |  ****         |            |

    4 King |   Magnin |  22000 |  **********|             |

    5 ford |   Magnin |  40000 | **********|              |

    Thanks in advance;

    Hello

    Sorry, I'm not sure to understand any issue.

    8f953842-815B-4D8C-833d-f2a3dd51e602 wrote:

    Hello Frank klush.

    > Argument datatype >

    EID NUMBER

    ESALARY VARCHAR2 (15)

    Question 1: if I declare esalary is varchar2, how will this affect my argument?

    As I have already said, the pay argument is not used.  As long as it is not used, it doesn't matter what type of data it has, but you must call the procedure with an argument of this type of data.

    Because you named the "wages" argument, I suppose that it is supposed to contain a value that could come from the emp table esalary column.  If that's what you plan to use it for, then you stated correctly in the procedure, such as emp.esalary%TYPE.  If you change the defifinitin = table one to be esalart (for example) a certain NUMBER (which seems to be a good idea), then you will not have to change the code anything in the procedure, simply recompile the procedure.

    Question 2: Ok. Emp_salary procedure requires 2 arguments, if, therefore, here only one argument is passed for example salary only.

    What makes sense here?

    DECLARE

    1. s emp.esalary%TYPE;
    2. BEGIN
    3. emp_salary (123, s);
    4. END;
    5. /

    Thanks in advance, really I put t know this logic. Please explain a little more.

    because I learn pl/sql.

    Thank you.

    Where is that a single argument?

    In your original code, zero arguments were passed.

    In the anonymous block above, two arguments are passed:

    (1) the literal NUMBER 123.  The 1st formal argument, id, has the data type of emp.eid%TYPE, and emp.eid said a NUMBER, so 123 is a value to pass as the argument IN perfectly well.

    (2) the variable s.  The 2nd formal argument, salaries, is defined as emp.esalary%TYPE, and that's exactly how s is defined, so s is a perfectly fine variable pass as argument IN OUT.

  • Remote touch the codec using the host name - matching cache of IPv4

    Pairing for some of the features of my remote client contact is often lost/broken. It uses the DHCP protocol for codecs and uses dynamic DNS entries as 'host name' at the time of the twinning contact to the codec devices.
    While this works for pairing at first, it seems the cache keys resolved IPv4 address of the codec instead of the host name. Whenever the IP address of the codec changes, the pairing is lost.
    Am I wrong? I came to the conclusion that codecs must be treated using static IPs or DHCP reservations for Peel remote to work reliably
    Click Select codec manually..., enter the IP address or host name of the codec and tap Start matching.
    THX
    / David

    Appears this is a limitation of the Touch and/or codec, see bug CSCua05282.  The contact must use the IP address, which is why when you entered the hostname of the endpoint it solved its IP address and used it.

  • relative to the parameter in a stored procedure returns

    I'm doing a sp sp / sql with select and update, the idea is to return the value assigned in the select, but when I test the procedure about adding the parameter to the method PPerformance does not, in fact I am new to oracle, I searched some tutorials but I have not managed to solve the problem


    my source its:
    create or replace
    PROCEDURE PA_CONSECUTIVO (TipoConsecutivo in  VARCHAR2, AUXI OUT int )
    
    AS
    aux2 int;
    BEGIN
    
     SELECT consecutivo + 1 into aux2 FROM  tbl_consecutivo
        WHERE UPPER(ltrim(rtrim(Tipo_Consecutivo))) = UPPER(ltrim(rtrim(TipoConsecutivo)));
        
        UPDATE tbl_Consecutivo SET consecutivo = aux2 
    WHERE upper(ltrim(rtrim(Tipo_Consecutivo))) = upper(ltrim(rtrim(TipoConsecutivo))) ;
    
     AUXI:=aux2;
        
    
    
    END PA_CONSECUTIVO;
    the table og the request her:
    TIPO_CONSECUTIVO     VARCHAR2(20 BYTE)
    CONSECUTIVO     NUMBER(38,0)
    FECHAULTIMO     DATE
    I appreciate the help.

    Published by: 1008490 on 29-may-2013 07:49

    Your stored procedure has 2 settings while you provide 1. Use something like:

    SET SERVEROUTPUT ON
    DECLARE
        V_AUXI NUMBER;
    BEGIN
        PA_CONSECUTIVO('ENTRADA',V_AUXI);
        DBMS_OUTPUT.PUT_LINE('AUXI = ' || V_AUXI);
    END;
    /
    

    SY.

  • Call a member function from a cursor in a procedure

    Hello people

    I'm a newbie in the process of learning of 10 G and oracle. My question is:

    I created a type called row_po and set a member function getCost() that returns the total cost of the order with headings like the nested table, which I intend to call from a procedure. In the procedure my SELECT returns more than one record, and that's why I need to use a cursor. For each record, I've got display the order_no, quantity, and the order_cost (qty, and order_cost are part of a nested table headings). I am able to access the order_no and quantity, but do not know how to call the member function to get the order_cost. Here are my steps:

    CREATE OR REPLACE PROCEDURE get_podet (part_num number)
    AS
    CURSOR c2 is
    SELECT *.
    OF po, TABLE (in. LineItemList_nestab) tab_po L
    WHERE L.PartNo = part_num;
    BEGIN
    TO crec looped c2
    DBMS_OUTPUT. Put_line (' ORDER NUMBER: ' | crec.) PONo);
    DBMS_OUTPUT. Put_line (' LINE QTY: ' | crec.) Qty);
    {color: #ff0000} * DBMS_OUTPUT. PUT_LINE (' ORDER VALUE: ' |) ''); -order_cost, which must be returned by the member function I mentioned-*.
    {color} END LOOP;
    EXCEPTION
    WHILE OTHERS THEN
    DBMS_OUTPUT. Put_line ('Failed' |) "SQLCODE: ' |" SQLCODE);
    DBMS_OUTPUT. PUT_LINE ('SQL ERROR MESSAGE' |) SQLERRM);
    END;
    /

    The red line is where I want to call my function getCost() which is a member of the tab_po in. as stated in my SELECTION.

    All thoughts were highly appreciated.

    Thanks and greetings

    It's always tricky with objects (or so I think...)

    Modify the query in your procedure:

    SELECT treat (value (po) as row_po).getCost() tot_cost
         , po.*
         , l.*
    FROM tab_po po, TABLE (po.LineItemList_nestab) L
    

    This would make the function:

    CREATE OR REPLACE PROCEDURE get_podet(part_num in number)
    AS
    CURSOR c2 is
    SELECT treat (value (po) as row_po).getCost() tot_cost
         , po.*
         , l.*
    FROM tab_po po, TABLE (po.LineItemList_nestab) L
    WHERE L.PartNo = part_num;
    BEGIN
    FOR crec in c2 LOOP
    DBMS_OUTPUT.PUT_LINE('ORDER NUMBER: ' || crec.PONo);
    DBMS_OUTPUT.PUT_LINE('LINE QTY: ' || crec.Qty);
    DBMS_OUTPUT.PUT_LINE('ORDER VALUE: ' ||crec.tot_cost
    ); -- order_cost which should be returned from the member function i've mentioned --
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Failed' || 'SQLCODE: ' || SQLCODE);
    DBMS_OUTPUT.PUT_LINE('SQL ERROR MESSAGE ' || SQLERRM);
    END;
    

    Published by: Alex Nuijten on January 13, 2009 15:29

Maybe you are looking for

  • Z2 Vibe Pro - Microsoft Exchange problem

    Hi, I experience problems with my new Vibe Z2 Pro when connecting to my Microsoft Exchange business. My company requires the use of the client certificate for the connection, I imported the certificate successfully, but when the Email application try

  • Can't dl the firmware! Help! Please...

    Get a Solution Explorer error when trying to dl the latest firmware for my wrt600n - $# @^ javascript app just will not work, have you tried w/Sun + MS java - no luck - can someone help? Or should I just dl dd - wrt and forget about it?

  • Print selection

    Hello It comes to my emails in Microsoft Outlook. I want to print only a selected page (not all, even or odd) or maybe just a paragraph of text selected. I can't find an option to do this in the configuration of the printer C4580. Completely absurd w

  • Empty folder at a specific time

    I have a folder that has been set up to empty its contents at midnight every day by a COMPUTER technician who is no longer available.  I want to do it in a different folder; Anyone know how to set up?  (No, this isn't her recycle bin.)

  • How to change itune Version in English.

    I get the following message is displayed after unplugging the ipad "this version of itunes has not been properly located for that language. Please run the English version.