Wb_rt_api_exec over a database link

When I call wb_rt_api_exec over a database link I receive:
ORA-20001: Task not found - Please check the Task Type, Name and Location are correct.
ORA-06512: at "OWB_10_2_0_1_31.WB_RT_API_EXEC", line 704.
When I run the command on the other database it works.
Is there a way to do this?
Thanks,
Joe

We had the same error when starting a package with WB_RT_API_EXEC.RUN_TASK from JBoss Middleware. It ran fine when started directly from SQLDeveloper, but threw the error when started from JBoss. Adding the pragma solved the problem, we also had to put a commt; at the end of the procedure.

Similar Messages

  • Insert, update and delete trigger over multiple Database Links

    Hello guys,
    first of all I'll explain my environment.
    I've got a Master DB and n Slave Databases. Insert, update and delete is only possible on the master DB (in my opinion this was the best way to avoid Data-inconsistencies due to locking problems) and should be passed to slave databases with a trigger. All Slave Databases are attached with DBLinks. And, additional to this things, I'd like to create a job that merges the Master DB into all Slave DB's every x minutes to restore consistency if any Error (eg Network crash) occurs.
    What I want to do now, is to iterate over all DB-Links in my trigger, and issue the insert/update/delete for all attached databases.
    This is possible with the command "execute immediate", but requires me to create textual strings with textually coded field values for the above mentioned commands.
    What I would like to know now, is, if there are any better ways to provide these functions. Important to me is, that all DB-Links are read dynamically from a table and that I don't have to do unnecessary string generations, and maybe affect the performance.
    I'm thankful for every Idea.
    Thank you in advance,
    best regards
    Christoph

    Well, I've been using mysql for a long time, yes, but I thought that this approach would be the best for my requirements.
    Materialized View's don't work for me, because I need real-time updates of the Slaves.
    So, sorry for asking that general, but what would be the best technology for the following problem:
    I've got n globally spread Systems. Each of it can update records in the Database. The easies way would be to provide one central DB, but that doesn't work for me, because when the WAN Connection fails, the System isn't available any longer. So I need to provide core information locally at every System (connected via LAN).
    Very important to me is, that Data remain consistent. That means, that it must not be that 2 systems update the same record on 2 different databases at the same time.
    I hope you understand what I'd need.
    Thank you very much for all your replies.
    best regards
    Christoph
    PS: I forgot to mention that the Databases won't be very large, just about 20k records, and about 10 queriees per second during peak times and there's just the need to sync 1 Table.
    Edited by: 907142 on 10.01.2012 23:14

  • Accessing large partitioned tables over a database link - any gotchas?

    Hi,
    We are in the middle of a corporate acquisition and I have a question about using database links to efficiently access large tables. There are two geographically distinct database instances, both on Oracle 10.2.0.5 sitting on Linux boxes.
    The primary instance (PSHR) contains a PeopleSoft HR and Payroll system and sits in our data centre.
    The secondary instance (HGPAY) runs a home grown payroll application and sits in a different data centre to PSHR.
    The requirement is to allow PeopleSoft (PSHR) to display targeted (one employee at a time) payroll data from the secondary instance.
    For example in HGPAY
    CREATE TABLE MY_PAY_DATA AS
    SELECT TO_CHAR(A.RN, '00000000') "EMP" -- This is an 8 digit leading 0 unique identifier
    , '20110' || to_char(B.RN) "PAY_PRD" -- This is a format of fiscal year plus fortnight in year (01-27)
    , C.SOME_KEY -- This is the pay element being considered - effectively random
    , 'XXXXXXXXXXXXXXXXX' "FILLER1"
    , 'XXXXXXXXXXXXXXXXX' "FILLER2"
    , 'XXXXXXXXXXXXXXXXX' "FILLER3"
    FROM ( SELECT ROWNUM "RN" FROM DUAL CONNECT BY LEVEL <= 300) A
    , (SELECT ROWNUM "RN" FROM DUAL CONNECT BY LEVEL <= 3) B
    , (SELECT TRUNC(ABS(DBMS_RANDOM.RANDOM())) "SOME_KEY" FROM DUAL CONNECT BY LEVEL <= 300) C
    ORDER BY PAY_PRD, EMP
    HGPAY.MY_PAY_DATA is Range Partitioned on EMP (approx 300 employees per partition) and List Sub-Partitioned on PAY_PRD (3 pay periods per sub-partition). I have limited the create statement above to represent one sub-paritition of data.
    On average each employee generates 300 rows in this table each pay period. The table has approx 180 million rows and growing every fortnight.
    In PSHR
    CREATE VIEW PS_HG_PAY_DATA (EMP, PAY_PRD, SOME_KEY, FILLER1, FILLER2, FILLER3)
    AS SELECT EMP, PAY_PRD, SOME_KEY, FILLER1, FILLER2, FILLER3 FROM MY_PAY_DATA@HGPAY
    PeopleSoft would then generate SQL along the lines of
    SELECT * FROM PS_HG_PAY_DATA WHERE EMP = ‘00002561’ AND PAY_PRD = ‘201025’
    The link between the data centres where PSHR and HGPAY sit is not the best in the world, but I am expecting tens of access requests per day rather than thousands, so I believe the link should have sufficient bandwidth to meet the requirements.
    I have tried a quick test on two production sized test instances and it works in that it presents the data, when I look at the explain plan I can see that the remote database is only presenting the relevant sub-partition over to PSHR rather than the whole table. Before I pat myself on the back with a "job well done" - is there a gotcha that I am missing in using dblink to access partitioned big tables?

    Yes, that's about right. A lot of this depends on exactly what happens in various "oops" scenarios-- are you, for example, just burning some extra CPU until someone comes to the DBA and says "my query is slow" or does saturating the network have some knock-on effect on critical apps or random long-running queries prevent some partition maintenance operations.
    In my mind, the simplest possible solution (assuming you are using a fixed username in the database link) would be to create a profile on HGPAY for the user that is defined for the database link that set a LOGICAL_READS_PER_CALL value that was large enough to handle any "reasonable" request and low enough to quickly kill any session that tried to do something "stupid". Obviously, you'd need to define "stupid" in your environment particularly where the scope of a "simple reconciliation report" is undefined. If there are no political issues and you can adjust the profile values over time as you encounter new reports that slowly increase what is deemed "reasonable" this is likely the simplest approach. If you've got to put in a change request to change the setting that has to be reviewed by the change control board at its next quarterly meeting with the outsourced DBA vendor, on the other hand, you could turn a 30 minute report into 30 hours of work spread over 30 days. In the ideal world, though, that's where I'd start.
    Getting more complex, you can use Resource Manager to kill queries that run too long on the wall clock. Since the network is almost certainly going to be the bottleneck, it's probably unlikely that the CPU throttling is going to do much good-- you can probably saturate the network with a very small amount of CPU. Network throttling in my mind is an extra step up in complexity again depending on the specifics of your particular situation and what you're competing with.
    Justin

  • Reference a function in a different schema over a database link?

    I have a database link, DBL, that connects with user GENE/***. I want to select columns from table BOOKS in schema JOE using function UNIFIX, which is defined in schema BRAD. Can I do it?
    I can select without the function:
    SELECT TITLE
    FROM JOE.BOOKS@DBL;
    I tried this syntax:
    SELECT BRAD.UNIFIX(TITLE)
    FROM JOE.BOOKS@DBL;
    But Oracle gives me a ORA-00904. Is there any syntax that will allow me to reference the function in the linked database? Or do I need to define a view in the remote DB that includes the function?

    SELECT brad.unfix@dbl( title )
      FROM joe.books@dblshould work. Assuming, of course, that the Gene user on the remote system has access both the the BOOKS table in the JOE schema and to the UNFIX function in the BRAD schema.
    Justin

  • Problem when call store procedure over a database link

    Hi all,
    I've create a database link in server "EAST" similar like:
    CREATE DATABASE LINK db_link CONNECT TO tiger IDENTIFIED BY scott USING 'abc';
    and from server "EAST" i ran the procedure located in server "WEST" somethin like:
    exec testing_procedure@db_link('test');
    testing_procedure is look like:
    Create or Replace procedure testing_procedure (p_testing in varchar2)
    as
    cursor check_space is
    select sum(bytes)/1024/1204 tb_size
    from dba_data_files;
    my_check_space%ROWTYPE;
    begin
    open check_space;
    loop
    fetch check_space into my_check_space;
    exit when check_space%NOTFOUND;
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);
    end loop;;
    close check_space;
    end;
    and my problem is when i'm run procedure from "EAST" server, the values in test_tf table is the same as when you run that procedure from "WEST" server. I've check the size for both server "EAST", and "WEST" by select sum(bytes)/1024/1204 command. And the value is completely different. And i guest somehow it reuse the value of "WEST" server no matter when you run that procedure in "EAST" server. Any suggesttion, please give me some advices.
    Thanks,
    Kevin

    If this procedure is in WEST server then even if you call it from some another planet using db link, the cursor inside the procedure will fetch the data from that server only means WEST server. So "select sum(bytes)/1024/1204 tb_size
    from dba_data_files;" statement in your procedure always fetch the size of the datafiles belongs to the WEST database.
    If you want to store the data of two different databases then you have to create the similar procedure in EAST database also.
    BTW, you said the you created a database link "db_link" in EAST database to point to WEST database and on WEST database you have that procedure BUT I don't understand why r u using "db_link" in your procdure code in WEST server in this insert statement:
    insert into test_tf@db_link (test, tb_value) values
    (p_testing, my_check_space.tb_size);Is there a database link on that box also?? Where it is pointing to?? And if not then this code should not be compiled.
    Daljit Singh

  • Database link from Oracle 11g (64 bit) to MySQL over UnixODBC with dg4odbc

    Hello,
    I want to connect to a MySQL Database from Oracle over a database link, but i get always the Error Message ORA-28528: Heterogeneous Services datatype conversion error .
    In the forum or internet I can't find a solution for my problem, so I try now to post this problem.
    Here a detailed description of the problem:
    I use a Oracle 11.1.0.7.0 64bit database which is running on a redhat linux 5.3 64bit.
    I want to connect to a MySql Database 5.0, which is running on a redhat linux 5.2 32bit over unixODBC.
    The configuration from the ODBC seems to be good, because with isql on the ora server I can connect and query all data correct from the MySQL database.
    Also the tsnnames.ora and listener.ora should be configured correctly. The tnsping works also fine.
    But when i try to catch the data over SQLPlus with the database link I always get the error ORA-28528.
    If I try to select just one column it works, but the returned data are incomplete or truncated.
    the version of my libs:
    between mysql and odbc I use libmyodbc3.so version 3.51.12-2.2 (I also tried the version 5, but with them I get a segmentation fault error on isql).
    between odbc and dg4odbc I use libodbc.so version 2.2.11-7.1
    Has anybody a solution or hint for me?
    Many Thanks in advance,
    best regards from Austria
    Manuel
    Edited by: user11243186 on 09.06.2009 02:59

    kdgmanu wrote:
    Hello,
    I always get the error ORA-28528.
    If I try to select just one column it works, but the returned data are incomplete or truncated.
    maybe you are facing bug 6772397, so do a search on metalink for bug 6772397
    >
    Has anybody a solution or hint for me?you could also see the following notes 554409.1 and 603801.1
    Many Thanks in advance,
    best regards from Austriacheers from Zagreb

  • Can we create pl/sql code over database link?

    Hi All,
    We are using Oracle 9i database.
    I want to know if we can create or modify pl/sql code (procedue, package, etc) over the database link? That means - can we create a procedure in remote database using the db link?
    Thanks,
    Dnyanesh

    yes, I can connect to the remote database directly and create/modify the packages.
    But I want the users not to create them using the db link.
    Is there any way to create the pl/sql package over database link?
    Thanks,
    Dnyanesh

  • To create a database link from oracle to sqlserver with NT authentication

    Hi ,
    I need to create a database link from oracle 9i to sql server database with windows authentication.I dont have the database username and password instead the access is given to my NT ID and password.So can anyone provide me the information about creating a dblink to sql server with windows authentication.
    Thanks

    Oracle is attempting to log in to SQL Server using NT authentication.
    The Oracle process, however, is running presumably with a local admin account (normal for a Windows service). SQL Server has no idea what this local account is, so it denies the login.
    You could change the Oracle service to run as a known user (presumably not as your Windows ID but some other Windows ID you create explicitly for Oracle) and then grant that Windows ID in SQL Server appropriate privileges. That would mean, though, that when you queried tables over the database link, you'd be using that new Windows ID's privileges on SQL Server, not your Windows ID's privileges.
    As I've said, though, this is a general architectural limitation for a multi-tier architecture. The end system (SQL Server) generally has no idea who the end user (your Windows ID) is when that user is coming through a middle tier (Oracle). So it cannot apply end-user permissions to connections created by the middle tier.
    Justin

  • How to select for insert a long column through database link?

    How may a long column (for example a sql server 2000 text column) be selected for insert into a clob column in table in 10g over a database link without invoking ora-00997?
    I've tried using dbms_metadata_util.long2clob without success over a database link.

    Is the remote database an Oracle database? Or are you selecting data from SQL Server 2000 over a database link via Heterogeneous Services? What is the data type of the column in the remote database (LONG? TEXT? Something else?)?
    Justin

  • Database link problem in a page process

    I'm trying to access a function over the database link in a page onload process. The called function located in another schema returns a varchar2 value, based on this value, I'll be doing appropriate navigation. But it's giving the following dblink error. However the select statement below works fine in sqlplus. any ideas are appreciated.
    ORA-04054: database link testschema does not exist
    DECLARE
    v_check varchar2(10) := NULL;
    BEGIN
    execute immediate 'select is_valid@testschema(&APP_USER., 10) into v_check from dual';
    END;
    thanks,
    Surya

    First you don't want to use &. anything in sql - use a bind variable and the using clause.
    Second, what if you try creating a view with the dblink in there and call the view? Does that change the error?

  • How to test issue with accessing tables over a DB link?

    Hey all,
    Using 3.1.2 on XE, I have a little app. The database schema for this app only contains views to the actual tables, which happen to reside over a database link in a 10.1.0.5.0 DB.
    I ran across an issue where a filter I made on a form refused to work (see [this ApEx thread| http://forums.oracle.com/forums/message.jspa?messageID=3178959] ). I verified that the issue only happens when the view points to a table across a DB link by recreating the table in the local DB and pointing the view to it. When I do this, the filter works fine. When I change the view back to use the remote table, it fails. And it only fails in the filter -- every other report and every other tool accessing the remote table via the view works fine.
    Anyone know how I can troubleshoot this? For kicks, I also tried using a 10.2.0.3.0 DB for the remote link, but with the same results.
    TIA,
    Rich
    Edited by: socpres on Mar 2, 2009 3:44 PM
    Accidental save...

    ittichai wrote:
    Rich,
    I searched metalink for your issue. This may be a bug in 3.1 which will be fixed in 4.0. Please see Doc ID 740581.1 Database Link Tables Do NoT Show Up In Table Drop Down List In Apex. There is a workaround mentioned in the document.
    I'm not sure why I never thought of searching MetaLink, but thanks for the pointer! It doesn't match my circumstances, however. The Bug smells like a view not being queried in the APEX development tool itself -- i.e. the IDE's coding needs changing, not necessarily those apps created with the IDE.
    I'm working on getting you access to my hosted app...
    Thanks,
    Rich

  • Calling remote procedure through database link

    Hi,
    I have a procedure in a package with a type I delcared as follows:
    Database1 :
    create or replace package p1
    is
    TYPE dependents_rec IS RECORD (
    name VARCHAR2 (80),
    dob date);
    TYPE dependents IS TABLE OF dependents_rec
    INDEX BY BINARY_INTEGER;
    procedure proc1 (p_id in number,
    p_dependents out dependents );
    end;
    On another database database2 i want to call the above procedure from within a procedure in a package that works as a wrapper package with similar structure.
    I recieve the error "Wrong number or types of parameters" error because type dependents is not the same as within the package in database 1.
    How can I call the procedure p1.proc1 over a database link ?
    Thank you

    Hi,
    On database1:
    CREATE OR REPLACE PACKAGE types_pkg is
    TYPE dependents_rec IS RECORD (
    NAME VARCHAR2 (80),
    sex NUMBER (1),
    birth_date DATE,
    birth_place NUMBER (3),
    status NUMBER (1),
    unique_id VARCHAR2 (15)
    TYPE dependents IS TABLE OF dependents_rec
    INDEX BY BINARY_INTEGER;
    end;
    CREATE OR REPLACE PACKAGE wrapper_pkg_demo
    AS
    PROCEDURE read_person_no (
    p_person_id NUMBER,
    p_dependent_info OUT types_pkg.dependents
    END;
    CREATE OR REPLACE PACKAGE BODY wrapper_pkg_demo
    AS
    PROCEDURE read_person_no (
    p_person_id NUMBER,
    p_dependent_info OUT types_pkg.dependents
    IS
    BEGIN
    person_pkg.read_person_no (p_person_id, p_dependent_info);
    END;
    END;
    On database 2:
    CREATE OR REPLACE PACKAGE person_pkg
    AS
    PROCEDURE read_person_no (
    p_person_id NUMBER,
    p_dependent_info OUT types_pkg.dependents@database1
    END;
    CREATE OR REPLACE PACKAGE body person_pkg
    AS
    PROCEDURE read_person_no (
    p_person_id NUMBER,
    p_dependent_info OUT types_pkg..dependents@database1
    IS
    BEGIN
    null;
    END;
    END;
    When compiling the package body on database 1
    ORA-04052: error occurred when looking up remote object TYPES@MOI
    ORA-00604: error occurred at recursive SQL level 1
    ORA-02019: connection description for remote database not found
    Noting that the database link are working properly and when compiling the package on database 2, it compile successfully
    Thank you

  • Interactive report performance problem over database link - Oracle Gateway

    Hello all;
    This is regarding a thread Interactive report performance problem over database link that was posted by Samo.
    The issue that I am facing is when I use Oracle function like (apex_item.check_box) the query slow down by 45 seconds.
    query like this: (due to sensitivity issue, I can not disclose real table name)
    SELECT apex_item.checkbox(1,b.col3)
    , a.col1
    , a.col2
    FROM table_one a
    , table_two b
    WHERE a.col3 = 12345
    AND a.col4 = 100
    AND b.col5 = a.col5
    table_one and table_two are remote tables (non-oracle) which are connected using Oracle Gateway.
    Now if I run above queries without apex_item.checkbox function the query return or response is less than a second but if I have apex_item.checkbox then the query run more than 30 seconds. I have resolved the issues by creating a collection but it’s not a good practice.
    I would like to get ideas from people how to resolve or speed-up the query?
    Any idea how to use sub-factoring for the above scenario? Or others method (creating view or materialized view are not an option).
    Thank you.
    Shaun S.

    Hi Shaun
    Okay, I have a million questions (could you tell me if both tables are from the same remote source, it looks like they're possibly not?), but let's just try some things first.
    By now you should understand the idea of what I termed 'sub-factoring' in a previous post. This is to do with using the WITH blah AS (SELECT... syntax. Now in most circumstances this 'materialises' the results of the inner select statement. This means that we 'get' the results then do something with them afterwards. It's a handy trick when dealing with remote sites as sometimes you want the remote database to do the work. The reason that I ask you to use the MATERIALIZE hint for testing is just to force this, in 99.99% of cases this can be removed later. Using the WITH statement is also handled differently to inline view like SELECT * FROM (SELECT... but the same result can be mimicked with a NO_MERGE hint.
    Looking at your case I would be interested to see what the explain plan and results would be for something like the following two statements (sorry - you're going have to check them, it's late!)
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two),
    sourceqry AS
    (SELECT  b.col3 x
           , a.col1 y
           , a.col2 z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5)
    SELECT apex_item.checkbox(1,x), y , z
    FROM sourceqry
    WITH a AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_one),
    b AS
    (SELECT /*+ MATERIALIZE */ *
    FROM table_two)
    SELECT  apex_item.checkbox(1,x), y , z
    FROM table_one a
        , table_two b
    WHERE a.col3 = 12345
    AND   a.col4 = 100
    AND   b.col5 = a.col5If the remote tables are at the same site, then you should have the same results. If they aren't you should get the same results but different to the original query.
    We aren't being told the real cardinality of the inners select here so the explain plan is distorted (this is normal for queries on remote and especially non-oracle sites). This hinders tuning normally but I don't think this is your problem at all. How many distinct values do you normally get of the column aliased 'x' and how many rows are normally returned in total? Also how are you testing response times, in APEX, SQL Developer, Toad SQLplus etc?
    Sorry for all the questions but it helps to answer the question, if I can.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Report over database link error

    Good morning all.
    I have a database link LINKA from USERA on LOCALSERVER to USERB on REMOTESERVER.
    (create database link LINKA connect to USERB identified by mypassword using validtns)
    In USERC on REMOTESERVER I have a TABLEX, with grant all on TABLEX to USERB on REMOTESERVER.
    In USERB on REMOTESERVER I have a view TABLEXV, select * from USERC.TABLEX
    From USERA on LOCALSERVER I can select * from TABLEXV@LINKA. In fact I can insert/update/delete tablexv from USERA.
    I also have a view TABLEXV on USERA, select * from TABLEXV@LINKA. I can also select/insert/update/delete from USERA.TABLEXV.
    So far so good - all working as expected.
    Then, my APEX app on LOCALSERVER, interactive report, parsing schema USERA, querying TABLEXV, I get the following:
    when "Exclude Link Column", I get the error "The requested URL /pls/apex/f was not found on server.
    when "Link to Single Row View", report displays correctly.
    when "Link to Custom Target", I get the error "The requested URL /pls/apex/f was not found on server.
    When I run the select * from TABLEXV as a regular report (i.e. not interactive), I also get the error.
    So the only time I get the report displayed correctly is using IR and "Link to Single Row View".
    However, clicking on the link (for Single Row View) I get "The requested URL /pls/apex/wwv_flow.show was not found on this server.".
    To summarize:
    - accessing table via view over database link
    - works outside of apex without issue
    - inside only works when Link to Single Row View set
    - But clicking on link fails
    I could live with just having the Link to Singe Row View option if I could disable displaying of the icon so that the user cant click on it.
    APEX 3.2.00.27
    EE Database - 10.2.0.3 (yes I know out of support)
    Remote EE Database - 10.2.0.5
    Real object names replaced to protect the innocent!
    Anyone got any clues?
    I have used remote tables many times in my APEX applications and never had this issue.
    Thanks,
    Rob @ very confused .com

    Good morning all.
    I have a database link LINKA from USERA on LOCALSERVER to USERB on REMOTESERVER.
    (create database link LINKA connect to USERB identified by mypassword using validtns)
    In USERC on REMOTESERVER I have a TABLEX, with grant all on TABLEX to USERB on REMOTESERVER.
    In USERB on REMOTESERVER I have a view TABLEXV, select * from USERC.TABLEX
    From USERA on LOCALSERVER I can select * from TABLEXV@LINKA. In fact I can insert/update/delete tablexv from USERA.
    I also have a view TABLEXV on USERA, select * from TABLEXV@LINKA. I can also select/insert/update/delete from USERA.TABLEXV.
    So far so good - all working as expected.
    Then, my APEX app on LOCALSERVER, interactive report, parsing schema USERA, querying TABLEXV, I get the following:
    when "Exclude Link Column", I get the error "The requested URL /pls/apex/f was not found on server.
    when "Link to Single Row View", report displays correctly.
    when "Link to Custom Target", I get the error "The requested URL /pls/apex/f was not found on server.
    When I run the select * from TABLEXV as a regular report (i.e. not interactive), I also get the error.
    So the only time I get the report displayed correctly is using IR and "Link to Single Row View".
    However, clicking on the link (for Single Row View) I get "The requested URL /pls/apex/wwv_flow.show was not found on this server.".
    To summarize:
    - accessing table via view over database link
    - works outside of apex without issue
    - inside only works when Link to Single Row View set
    - But clicking on link fails
    I could live with just having the Link to Singe Row View option if I could disable displaying of the icon so that the user cant click on it.
    APEX 3.2.00.27
    EE Database - 10.2.0.3 (yes I know out of support)
    Remote EE Database - 10.2.0.5
    Real object names replaced to protect the innocent!
    Anyone got any clues?
    I have used remote tables many times in my APEX applications and never had this issue.
    Thanks,
    Rob @ very confused .com

  • Run process flow over database link

    Hi guys,
    I have two projects here, A and B. Each project has its own process flow, lets say Process A (in project A)and process B(in project B). I need to run process B in process A, so I use the database link, and WB_RT_API_EXEC.run_task function. But when I run the process, I get the following error:
    ORA-20001: Task not found - Please check the Task Type, Name and Location are correct.
    ORA-06512: at "OWBRTR2.WB_RT_API_EXEC", line 704
    does anyone have some idea how to fix this? or any other suggestions for how to do it? thanks.

    Hi Gowtham,
    I am using the following function to send execution details of the process-flow. This process-flow is having 20 mappings. This is working fine.
    The cIient requirment is to pass email-IDs from a back-end table(sam_mail_notification) with columns(smtp, from_address and to_address), right now the function is working on static(constant) values.
    I had modified the function according to the requirement, can you please have a look at the function, and tell me is it correct. Because the values should come from database table. will this function work.
    I got the following error, while deploying,
    ORA-06550: line 55, column 1:
    PLS-00103: Encountered the symbol "END" when expecting one of the following:
    FUNCTION SEND_SUMMARY1()
    RETURN NUMBER
    --initialize variables here
    -- main body
    retval number := 0; --default
    crlf CONSTANT VARCHAR2(2):= CHR(13) || CHR(10);
    pSender VARCHAR2(30) := '[email protected]';
    pRecipient VARCHAR2(30) := '[email protected]';
    pSubject VARCHAR2(100) := 'Process REsults for: '||to_char(sysdate,'dd/mm/yyyy');
    mesg VARCHAR2(32767);
    mail_conn utl_smtp.connection;
    cursor getResults is
    select AREA.OBJECT_NAME,
    AREA.CREATED_ON,
    AREA.UPDATED_ON,
    aramr.ELAPSE_TIME,
    NUMBER_RECORDS_SELECTED,
    NUMBER_RECORDS_INSERTED,
    NUMBER_RECORDS_UPDATED,
    NUMBER_ERRORS,
    AREA.RETURN_RESULT,
    AREA.EXECUTION_AUDIT_STATUS,
    MESSAGE_SEVERITY,
    MESSAGE_TEXT
    from
    all_Rt_audit_executions area,
    all_Rt_audit_map_runs aramr,
    all_rt_audit_exec_messages err
    where AREA.execution_audit_id = ARAMR.execution_audit_id(+) AND
    AREA.execution_audit_id = err.execution_audit_id(+)
    and
    trunc(area.created_on) = trunc(sysdate)
    AND AREA.OBJECT_NAME IS NOT NULL AND AREA.TASK_TYPE!='ProcessFlow'
    AND area.top_level_execution_audit_id =(select max(top_level_execution_audit_id)from all_Rt_audit_executions
    where execution_name = (select execution_name from all_Rt_audit_executions where task_type ='ProcessFlow' and top_level_execution_audit_id =
    (select max(top_level_execution_audit_id) from all_Rt_audit_executions)));
    Cursor getMailDetails is select
    mailhost
    pSender,
    pRecipient
         from sam_mail_notification;
    BEGIN
    for maild in getMailDetails
    loop
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    mesg := 'Date: ' ||TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf ||
    'From: <'|| pSender ||'>' || crlf ||
    'Subject: '|| pSubject || crlf ||
    'To: '||pRecipient || crlf || '' || crlf ||
    end loop;
    'MAPNAME START_TIME END_TIME ELAPSED SELECTED INSERTED UPDATED ERRORS RESULT AUDIT_STSTUS SEVERITY MESSAGE_TEXT'||crlf ;
    for rec in getResults
    loop
    mesg:=mesg || rpad(rec.OBJECT_NAME,30)||
    rpad(to_char(rec.CREATED_ON, 'HH24:MI:SS DD-MON-YY'),20)||
    rpad(to_char(rec.UPDATED_ON, 'HH24:MI:SS DD-MON-YY'),24)||
    rpad(to_char(rec.ELAPSE_TIME),7)||
    rpad(to_char(rec.NUMBER_RECORDS_SELECTED),8)||
    rpad(to_char(rec.NUMBER_RECORDS_INSERTED),10)||
    rpad(to_char(rec.NUMBER_RECORDS_UPDATED),10)||
    rpad(to_char(rec.NUMBER_ERRORS),5)||
    rpad(to_char(rec.RETURN_RESULT),8)||
    rpad(to_char(rec.EXECUTION_AUDIT_STATUS),10)||
    rpad(to_char(rec.MESSAGE_SEVERITY),10)||
    rpad(to_char(rec.MESSAGE_TEXT),200)||crlf;
    end loop;
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, pSender);
    utl_smtp.rcpt(mail_conn, pRecipient);
    utl_smtp.data(mail_conn, mesg);
    utl_smtp.quit(mail_conn);
    return retval;
    EXCEPTION
    WHEN OTHERS THEN
    return 1;
    END;
    Regards,
    Kumar

Maybe you are looking for

  • How do I make iTunes forget my iPhone?

    I set up my iPhone 5 as a new device (not restored from my old iPhone 4 backup) but when I initially connected it to iTunes, I neglected to un-check the box that said something like "Automatically sync apps to this device." This resulted in iTunes tr

  • Multiple accounts, one computer

    We have several family members using itunes, with several different ipods. We would all like to purchase tunes from the itunes store with independent sources - credit cards, gift cards etc. When a gift card is enabled, it remains active until fully u

  • IPhoto 08 makes it difficult to print greeting cards

    It seems to me that it should be easier to print greeting cards yourself from iPhoto. I have tried many ways and there are no options to adjust the print size. No one makes paper the correct size, and printing on a Letter sized page doesn't work. In

  • Billing Plan - Next Bill Date

    Hello I have a requirmenet to generate a charge on a bill for one month only. I've configured my item category to use a custom billing plan.  I have most of the information correctly configured except for the Next Bill Date. The Next Bill Date is sho

  • Cannot receive .doc & .xls files

    I have searched the board, and read that a number of owners receive doc & xls files with no problems. I do receive the e-mail sent to my iPhone, but when it tries to display the file, it always states ( This message has no content ). I use embarqmail