Error in Executing Procedure through DBLink

Hi,
I am facing some problems in executing a procedure through DBLink.
I have two schema A and B in two different database.
In schema A I am having one procedure X in package Y and my requirement is that I want to execute this procedure in schema B. So in schema B i have created one DBLink ABC and trying to execute procedure X using this DB link.
begin
A.Y.X@ABC;
end;
But I am getting below error:
ORA-06550: line 2, column 1:
PLS-00201: identifier 'A.Y.X@ABC' must be declared
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
Any help would be greatly appreciated!
Thanks In Advance..
Regards,
Sachin Bansal

Hi,
Yes, I am connecting to user A of DB1 and in this user I am having procedure X in Package Y. My DBLink in Schema B of DB2 is pointing to user A of DB1.
I have created DBLINK using below script:
create public database link abc
connect to A
identified by A
using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=XXX)(PORT=1521)))(CONNECT_DATA=(service_name=XXX)))';
Above DBLInk is working fine..I am able to access all the table of schema A in schema B using this DBLink. But when I trying to execute any procedre of schema A in schema B then i am getting error.
Regards,
Sachin

Similar Messages

  • Error when executing DBMS_ERRLOG through Stored Procedures...

    Hi,
    We have TWO schemas like IDWH_ODS and IDWH_ERR running on Oracle 10g Rel.2.
    The schema IDWH_ERR has direct SELECT privilege on all the base tables in IDWH_ODS schema. (As Pl/sql doesn't support ROLE, we have granted direct SELECT on each of the tables)
    IDWH_ODS schema has tables like ACCOUNT & CUSTOMER, for which I need to create DML Error logging tables in IDWH_ERR schema.
    I have one procedure 'Cr_Errlog_Tabs' in IDWH_ERR schema which gets all tables in IDWH_ODS and creates Error logging table in IDWH_ERR schema using DBMS_ERRLOG package. My problem starts here,
    When I execute the DBMS_ERRLOG package in IDWH_ERR through SQL*Plus LIKE,
    > exec DBMS_ERRLOG.CREATE_ERROR_LOG('idwh_ods.ACCOUNT','ERR$_ACCOUNT','idwh_err');
    it's creating the error log table 'ERR$_ACCOUNT' in IDWH_ERR schema.
    (...the same will be working when execute through Anonymous plsql block)
    BUT, when i execute the DBMS_ERRLOG package with same parameters through the stored Procedure 'Cr_Errlog_Tabs', it throws the following error...
    ORA-01031: insufficient privileges
    Please let me know how the solution at the earliest.

    WHY DO YOU FEEL YOU HAVE TO START A NEW THREAD FOR YOUR PROBLEM!?
    Insufficient priv error when executing DBMS_ERRLOG through PLSQL

  • Error while executing procedure for excel upload

    Hi Friends
    Pl. find below error while executing procedure for loading excel data. pl. verify and suggest for any changes in the format of data.
    Rgds
    SriG

    If reading Excel as a database you would use "Access LSLINK"
    Access external means you are reading a file. I don't think it is possible to treat Excel as a file because the internal structure is complex.
    In the past I have saved the Excel as a CSV or as a Tab delimeted file. Then I use something like
    ACCESS External
      USE &filename
      BEGIN
        DESCRIPTION free ,
        Variables text 20
        Organisation text 20
        'July 2008' numeric 20
        'August 2008' numeric 20
        'September 2008' numeric 20
        'October 2008' numeric 20
        'November 2008' numeric 20
        'December 2008' numeric 20
        'January 2009' numeric 20
        'February 2009' numeric 20
        'March 2009' numeric 20
        'April 2009' numeric 20
        'May 2009' numeric 20
        'June 2009' numeric 20
      END
      peek
      read
    ... quit the access sub system
    END

  • Error while executing procedure in TOAD which contains parameter and dblink

    Hi all,
    I am getting error while executing the following code in TOAD and APEX.
    It contains parameter( start_date and end_date) and dblink(@TO_FUT).
    When I hardcode the parameter values, It works fine.
    When I dont give hardcoded values in the procedure, the error comes.
    When I comment the lines whereever parameter comes, still the error comes.
    I am not sure whether it is parameter issue or dblink issue or some other issue
    Is anybody having any clue about this error?
    Your help is very much appreciated.
    The code:
    CREATE OR REPLACE PROCEDURE PROC_ENR_ACC(START_DATE DATE,END_DATE DATE)
    AS
    BEGIN
    EXECUTE IMMEDIATE 'TRUNCATE TABLE OUTPUT_TABLE';
    INSERT INTO OUTPUT_TABLE
    (FIRST_NAME ,LAST_NAME,HID ,EFF_DT,CID,PLAN, FLAG)
    SELECT
    TEMP1.FIRST_NAME,
    TEMP1.LAST_NAME,
    TEMP1.HID,
    TEMP1.EFF_DT,
    TEMP1.CID,
    TEMP1.PLAN,
    NVL((SELECT 'Y'
    FROM FADMIN.MEMI_TABLE@TO_FUT MEMI
    WHERE MEMI.MEME_CK = TEMP1.MEME_CK
    AND MEMI.TXN_EFF_DT = TEMP1.EFF_DT
    AND MEMI.PBP = TEMP1.PLAN
    AND MEMI.MEMI_TXN_CD IN ('AC','RE')
    AND MEMI.MEMI_SEQ_NO = (SELECT MAX (MI.MEMI_SEQ_NO)
    FROM FADMIN.MEMI_TABLE@TO_FUT MI
    WHERE MI.MEME_CK = MEMI.MEME_CK
    AND MI.TXN_EFF_DT = MEMI.TXN_EFF_DT
    AND MI.PBP = MEMI.PBP
    AND MI.MEMI_TXN_CD IN ('AC','RE')
    AND MI.MEMI_INTF_STS = 03 )),'N') AS FLAG
    FROM
    ( SELECT
    M1.FIRST_NAME ,
    M1.LAST_NAME ,
    M1.HID ,
    M1.EFF_DT,
    M1.CID,
    M1.PLAN ,
    (SELECT MEME.MEME_CK
    FROM FADMIN.MEME_TABLE@TO_FUT MEME, FADMIN.GRGR_TABLE@TO_FUT GRGR
    WHERE MEME.M_HIN = M1.HID
    AND MEME.GRGR_CK = GRGR.GRGR_CK
    AND GRGR.GRGR_ID = M1.GRGR_ID
    )AS MEME_CK
    FROM FADMIN.METR_TABLE@TO_FUT M1,
    ( SELECT M3.HID, M3.EFF_DT FROM FADMIN.METR_TABLE@TO_FUT M3
    WHERE M3.TYPE IN ('60','61')
    AND M3.REPLY IN ('117','118')
    AND TRUNC (M3.METR_TRANS_DT) BETWEEN START_DATE AND END_DATE
    AND M3.SYIN_INST = (SELECT MAX (M4.SYIN_INST)
    FROM FADMIN.METR_TABLE@TO_FUT M4
    WHERE M4.HID = M3.HID
    AND M4.TYPE IN ('60','61')
    AND M4.REPLY IN ('117','118')
    AND TRUNC (M4.EFF_DT) = TRUNC (M3.EFF_DT))
    ) TEMP
    WHERE M1.TYPE IN ('60','61')
    AND M1.REPLY ='011'
    AND TRUNC (M1.METR_TRANS_DT) BETWEEN START_DATE AND END_DATE
    AND M1.SYIN_INST = (SELECT MAX (M2.SYIN_INST)
    FROM FADMIN.METR_TABLE@TO_FUT M2
    WHERE M2.HID = M1.HID
    AND M2.TYPE IN ('60','61')
    AND M2.REPLY ='011'
    AND TRUNC (M2.EFF_DT) = TRUNC (M1.EFF_DT))
    AND M1.HID = TEMP.HID (+)
    AND M1.EFF_DT = TEMP.EFF_DT (+)
    AND TEMP.HID IS NULL
    UNION
    SELECT
    M1.FIRST_NAME ,
    M1.LAST_NAME ,
    M1.HID ,
    M1.EFF_DT,
    M1.CID,
    M1.PLAN ,
    (SELECT MEME.MEME_CK
    FROM FADMIN.MEME_TABLE@TO_FUT MEME, FADMIN.GRGR_TABLE@TO_FUT GRGR
    WHERE MEME.M_HIN = M1.HID
    AND MEME.GRGR_CK = GRGR.GRGR_CK
    AND GRGR.GRGR_ID = M1.GRGR_ID
    )AS MEME_CK
    FROM FADMIN.METR_TABLE@TO_FUT M1
    WHERE M1.TYPE IN ('60','61')
    AND M1.REPLY IN ('016', '017', '022', '023')
    AND TRUNC (M1.METR_TRANS_DT) BETWEEN START_DATE AND END_DATE
    AND M1.SYIN_INST = (SELECT MAX (M2.SYIN_INST)
    FROM FADMIN.METR_TABLE@TO_FUT M2
    WHERE M2.HID = M1.HID
    AND M2.TYPE IN ('60','61')
    AND M2.REPLY IN ('016', '017', '022', '023')
    AND TRUNC (M2.EFF_DT) = TRUNC (M1.EFF_DT))
    )TEMP1 ;
    END;
    The error:
    ORA-00918: column ambiguously defined
    ORA-02063: preceding line from TO_FUT
    ORA-06512: at "PROC_ENR_ACC", line 5
    ORA-06512: at line 5

    Okay
    Here's the code formatted
    CREATE OR REPLACE PROCEDURE PROC_ENR_ACC (START_DATE DATE, END_DATE DATE)
    AS
    BEGIN
       EXECUTE IMMEDIATE 'TRUNCATE TABLE OUTPUT_TABLE';
       INSERT INTO OUTPUT_TABLE (FIRST_NAME,
                                 LAST_NAME,
                                 HID,
                                 EFF_DT,
                                 CID,
                                 PLAN,
                                 FLAG)
       SELECT   TEMP1.FIRST_NAME,
                TEMP1.LAST_NAME,
                TEMP1.HID,
                TEMP1.EFF_DT,
                TEMP1.CID,
                TEMP1.PLAN,
                NVL (
                     (SELECT   'Y'
                      FROM   MEMI_TABLE MEMI
                      WHERE       MEMI.MEME_CK = TEMP1.MEME_CK
                      AND MEMI.TXN_EFF_DT = TEMP1.EFF_DT
                      AND MEMI.PBP = TEMP1.PLAN
                      AND MEMI.MEMI_TXN_CD IN ('AC', 'RE')
                      AND MEMI.MEMI_SEQ_NO = (SELECT   MAX (MI.MEMI_SEQ_NO)
                                              FROM   MEMI_TABLE MI
                                              WHERE   MI.MEME_CK = MEMI.MEME_CK
                                              AND MI.TXN_EFF_DT = MEMI.TXN_EFF_DT
                                              AND MI.PBP = MEMI.PBP
                                              AND MI.MEMI_TXN_CD IN ('AC', 'RE')
                                              AND MI.MEMI_INTF_STS = 03)
                      ),'N') FLAG
       FROM (SELECT   M1.FIRST_NAME,
                      M1.LAST_NAME,
                      M1.HID,
                      M1.EFF_DT,
                      M1.CID,
                      M1.PLAN,
                      (SELECT   MEME.MEME_CK
                       FROM   MEME_TABLE MEME, GRGR_TABLE GRGR
                       WHERE       MEME.M_HIN = M1.HID
                       AND MEME.GRGR_CK = GRGR.GRGR_CK
                       AND GRGR.GRGR_ID = M1.GRGR_ID) MEME_CK
             FROM   METR_TABLE M1,
                    (SELECT   M3.HID, M3.EFF_DT
                     FROM   METR_TABLE M3
                     WHERE   M3.TYPE IN ('60', '61')
                     AND M3.REPLY IN ('117', '118')
                     AND TRUNC (M3.METR_TRANS_DT) BETWEEN START_DATE AND  END_DATE
                     AND M3.SYIN_INST = (SELECT   MAX (M4.SYIN_INST)
                                         FROM   METR_TABLE M4
                                         WHERE   M4.HID = M3.HID
                                         AND M4.TYPE IN ('60', '61')
                                         AND M4.REPLY IN ('117', '118')
                                         AND TRUNC (M4.EFF_DT) = TRUNC (M3.EFF_DT))
                     ) TEMP
             WHERE   M1.TYPE IN ('60', '61') AND M1.REPLY = '011'
             AND TRUNC (M1.METR_TRANS_DT) BETWEEN START_DATE AND  END_DATE
             AND M1.SYIN_INST = (SELECT   MAX (M2.SYIN_INST)
                                 FROM   METR_TABLE M2
                                 WHERE       M2.HID = M1.HID
                                 AND M2.TYPE IN ('60', '61')
                                 AND M2.REPLY = '011'
                                 AND TRUNC (M2.EFF_DT) = TRUNC (M1.EFF_DT))
            AND M1.HID = TEMP.HID(+)
            AND M1.EFF_DT = TEMP.EFF_DT(+)
            AND TEMP.HID IS NULL
            UNION
            SELECT   M1.FIRST_NAME,
                     M1.LAST_NAME,
                     M1.HID,
                     M1.EFF_DT,
                     M1.CID,
                     M1.PLAN,
                     (SELECT   MEME.MEME_CK
                      FROM   MEME_TABLE MEME, GRGR_TABLE GRGR
                      WHERE       MEME.M_HIN = M1.HID
                      AND MEME.GRGR_CK = GRGR.GRGR_CK
                      AND GRGR.GRGR_ID = M1.GRGR_ID) MEME_CK
            FROM   METR_TABLE M1
            WHERE   M1.TYPE IN ('60', '61')
            AND M1.REPLY IN ('016', '017', '022', '023')
            AND TRUNC (M1.METR_TRANS_DT) BETWEEN START_DATE AND  END_DATE
            AND M1.SYIN_INST = (SELECT   MAX (M2.SYIN_INST)
                                FROM   METR_TABLE M2
                                WHERE   M2.HID = M1.HID
                                AND M2.TYPE IN ('60', '61')
                                AND M2.REPLY IN ('016', '017', '022', '023')
                                AND TRUNC (M2.EFF_DT) = TRUNC (M1.EFF_DT))
            ) TEMP1;
    END;
    /When posting code if you put {noformat}{noformat} (with the curly brackets and in lower case) above and below it you can preserve formatting.
    To your original question...
    Is the link name supposed to be variable?
    What do you mean by 'hard coding' the values, do you mean in the procedure itself so you'd actually PROC_ENR_ACC();?
    What happens when you run this?DECLARE
    start_date DATE;
    end_date DATE;
    BEGIN
    start_date := '01-JAN-2009';
    end_date := '01-FEB-2009';
    PROC_ENR_ACC(start_date, end_date);
    END;
    I need to know exactly how to recreate your error...
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    +Don't forget to mark replies helpful or correct+ ;)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ORA-00900: invalid SQL statement Error while Executing Procedure

    Hi:
    I am trying to execute following procedure through java code, but i am getting ORA-00900: invalid SQL statement error.
    Procedure is :
    <code>
    (vResult out int)
    as
    vCardId varchar2(16);
    vForacid varchar2(16);
    vApp_Entry_No varchar2(10);
    vSrNo number(6);
    vCardStatus char(1);
    vCardStat char(2);
    vExpiryDate date;
    Cursor cardCur1 is
    select u.card_number,trim(u.ACCOUNT_NUMBER),u.CARD_STATUS,to_char(u.EXPIRY_DATE,'dd-MM-yyyy')
    FROM DailyCardData u
    where default_indicator='1'
    and isprocessed = 'N'
    order by expiry_date;
    begin
    vSrNo := 0;
    vResult := 0;
    open cardCur1;
    Loop
    fetch cardCur1 into vCardId,vForacid,vCardStat,vExpiryDate;
    if cardCur1%NOTFOUND then
    exit;
    end if;
    if (vCardStat != null) then
    vCardStatus := 'H';
    elsif (vExpiryDate <= sysdate) then
    vCardStatus := 'E';
    else
    vCardStatus := null;
    end if;
    select a.app_entry_no into vApp_Entry_No from Application a,ApplicationLinkedAccounts l
    where l.foracid = vForacid and l.AcSrNo = '1'
    and a.app_entry_no = l.app_entry_no
    and a.cardid is null
    and a.DOWNLOADFILECREATIONFLAG = 'Y';
    update Application set CardId = vCardId,
    Card_Status = vCardStatus,APPLICATIONPROCESSEDFLAG = 'Y',
    APPLICATIONPROCESSEDdate = DOWNLOADFILECREATIONdate
    where App_Entry_No = vApp_Entry_No;
    commit;
    update DailyCardData set isprocessed = 'Y',app_entry_no = vApp_Entry_No
    where card_number = vCardId;
    commit;
    end Loop;
    close cardCur1;
    vResult := 1;
    end;
    </code>
    Can any body help me in that?
    Thank You,
    Anup

    First of all I don't see a procedure header.
    Secondly I see you commit inside your procedure. This is a bug.
    Thirdly I see you also commit inside a loop. This is also a bug, and needs to be removed asap.
    The error indicates a statement doesn't parse. As you don't post the error stack, nor a table definition no one can reproduce the problem.
    You need to isolate the statements, one by one, and run them through sql*plus to see what happens.
    Sybrand Bakker
    Senior Oracle DBA

  • Error  while executing query through rsrt

    hello experts,
    I am facing following error while executing one HR query through rsrt.
    "System error in program SAPLRRI2 and form REP_ASSIGN_INITIAL_OPT-01- (see long text) "
    while executing query through rsrt it automatically goes to debug mode, coming out of debug mode i get the screan showing above error message.
    What would be an issue?
    Regards,
    Nirav
    Edited by: Nirav Shah on Apr 21, 2008 8:19 AM

    Hi ramesh,
    I havent kept any execlusion selection. Though i saw long text, it is like this:
    "Diagnosis
    This internal error is an intended termination resulting from a program state that is not permitted.
    Procedure
    Analyze the situation and inform SAP.
    If the termination occurred when you executed a query or Web template, or during interaction in the planning modeler, and if you can reproduce this termination, record a trace (transaction RSTT).
    For more information about recording a trace, see the documentation for the trace tool environment as well as SAP Note 899572.
      Notification Number BRAIN 299 "
    Regards,
    Nirav

  • Insufficient priv error when executing DBMS_ERRLOG through PLSQL

    Hi,
    I shall be grateful if any one of you give me the solution at the earliest.
    I have 2 schemas like A & B those are running on Oracle 10g rel2.
    As per my buz req' I need to create DML Error log table for 'A.T1' table in B schema using DBMS_ERRORLOG package.
    I have granted direct SELECT on A.T1 to B (...not through ROLE as it doesn't work in plsql)
    The problem is when i'm running the procedure,
    DBMS_ERRLOG.CREATE_ERROR_LOG('A.T1', 'err_T1', 'B');
    in SQL*Plus of B schema, it's creating the error log table successfully.
    But the same will get failed when i run this error log procedure with in a procedure owned by B schema.
    It throws 'ORA-01031: insufficient privileges'...
    I hope this is related to privilege issue which is working fine in SQL*Plus but NOT in PLSQL stored procedure.
    Awaiting your earliest reply.
    Thanks.
    - Ela

    >I dont think it's an issue with direct privilege. Actually the
    package is working when i execute it with in a ananymous block,
    but the same get fails when execute it through procedures...
    Role privs work with anonymous PL/SQL blocks. Does not work with stored PL/SQL code.
    SQL> create user user1 identified by user1 default tablespace users quota 2M on users;
    User created.
    SQL> grant create session to user1;
    Grant succeeded.
    SQL> create role user1_role;
    Role created.
    SQL> grant create table, create procedure to user1_role;
    Grant succeeded.
    SQL> grant user1_role to user1;
    Grant succeeded.
    SQL> connect user1/user1
    Connected.
    PL/SQL procedure successfully completed.
    SQL> create table x( n number );
    Table created.
    SQL> begin
    2 execute immediate 'create table y( n number )';
    3* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> create or replace procedure CreateTable is
    2 begin
    3 execute immediate 'create table z( n number )';
    4* end;
    SQL> /
    Procedure created.
    SQL> exec CreateTable
    BEGIN CreateTable; END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "USER1.CREATETABLE", line 3
    ORA-06512: at line 1
    SQL>

  • Insufficient privilege error when executing DBMS_ERRLOG through PLSQL

    Hi,
    I shall be grateful if any one of you give me the solution at the earliest.
    I have 2 schemas like A & B those are running on Oracle 10g rel2.
    As per my buz req' I need to create DML Error log table for 'A.T1' table in B schema using DBMS_ERRORLOG package.
    I have granted direct SELECT on A.T1 to B (...not through ROLE as it doesn't work in plsql)
    The problem is when i'm running the procedure,
    DBMS_ERRLOG.CREATE_ERROR_LOG('A.T1', 'err_T1', 'B');
    in SQL*Plus of B schema, it's creating the error log table successfully.
    But the same will get failed when i run this error log procedure with in a procedure owned by B schema.
    It throws 'ORA-01031: insufficient privileges'...
    I hope this is related to privilege issue which is working fine in SQL*Plus but NOT in PLSQL stored procedure.
    Awaiting your earliest reply.
    Thanks.
    - Ela

    Hi,
    It's not an issue with direct privilege. Actually the package is working when i execute it with in a ananymous block, but the same get fails when execute it through procedures...
    Even we have given COMMENT ANY TABLE priv to the schema and that too didn't work out.
    awaiting your reply.
    -Saravanan

  • Strange problem in executing procedure using dblink

    I have this strange problem coming in the execution of a procedure accessed using dblink. I will try to explain the scenario. We have one procedure in our schema which is executed using a dblink from another database as we have a integration of systems. This was working fine but after we did a fresh export and import of this schema as we migrated our database to a new better configuration DB server, the execution of this procedure is hanging when it is executed from the dblink from the other database. I hope, I have been able to explain the scenario.
    I hope, my question is clear.
    Please, help in solving the doubt.
    regards

    No starting version number.
    No current version number.
    No indication of whether the link is valid and you can SELECT across it.
    No error message of any kind.
    Nothing from your alert log.
    No indication of whether you have a global names issue.
    Please do the research required to identify the nature of the problem, check the related docs at metalink, and if you still have a problem give us the rest of the story.
    Then perhaps we can help you.

  • Error in executing script through transaction SM49

    Hi,
    we have written a script with multiple parameters.when ever we will try to execute the Script with the parameters it is working fine.
    but whenever we will executing it through the transaction SM49 we are getting the below error.
    error details:
    connecting to server....
    connection denied#
    connection denied#
    connection closed
    can anybody let us know how can we execute the script with multiple parameters through Transaction SM49.
    Regards,
    Vishal

    One thing you can do then, is to transfer the scripts to your db server and issue an
    OS command from within a java stored procedure as described e.g. Re: how will i call sqlplus from pl/sql procedure

  • ORA-06550 error while executing procedure

    HI Friends,
    I have written a proc for the below process.
    SP_Control (table)
    sno     campgn_id     campgn_typ     campgn_no     current_wave
    1     ET07001     ONB     ONB01     1
    2     ET07001     ONB     CNB01     1
    3     ET03053     IAL     IAL1A     A
    4     ET03053     IAL     IAL2A     A
    5     ET03053     IAL     IAL3A     A
    6     ET03053     IAL     IAL4A     A
    After calling the procedures with bellow parameters
    Get_next_campgn(‘ONB01’,’ONB’);
    Get_next_campgn(‘CNB01’,’ONB’);
    Get_next_campgn(‘IAL1A’,’IAL’);
    Get_next_campgn(‘IAL2A’,’IAL’);
    Get_next_campgn(‘IAL3A’,’IAL’);
    Get_next_campgn(‘IAL4A’,’IAL’);
    …………… it should update the table with below data.
    sno     campgn_id     campgn_typ     campgn_no     current_wave
    1     ET07001     ONB     ONB02     2
    2     ET07001     ONB     CNB02     2
    3     ET03053     IAL     IAL1B     B
    4     ET03053     IAL     IAL2B     B
    5     ET03053     IAL     IAL3B     B
    6     ET03053     IAL     IAL4B     B
    I have written a procedure like this and its compliled successfully.
    But throws error while executing like
    execute Get_next_campgn(‘ONB01’,’ONB’);
    create or replace procedure Get_next_campgn(p_campgn varchar2,p_type varchar2)
    as
    begin
    update SP_Control set campgn_no = substr(p_campgn,1,length(p_campgn)-1)||to_char(ascii(substr(p_campgn,-1,1))+1) ,
    curr_wave = to_char(ascii(curr_wave)+1)
    where campgn_type = p_type
    and campgn_no = p_campgn ;
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end Get_next_campgn;
    Error::::
    Error starting at line 15 in command:
    execute Get_next_campgn(‘ONB01’,’ONB’)
    Error report:
    ORA-06550: line 1, column 24:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    ( ) - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable>
    table continue avg count current exists max min prior sql
    stddev sum variance execute multiset the both leading
    trailing forall merge year month day hour minute second
    timezone_hour timezone_minute timezone_region timezone_abbr
    time timestamp interval date
    <a string literal with character set specification>
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Please suggest....

    The procedure executed successfully for me.
    drop table sp_control;
    create table sp_control
      campgn_no varchar2(20),
      curr_wave varchar2(20),
      campgn_type varchar2(20)
    insert into sp_control values ('ONB01', '1', 'ONB');
    insert into sp_control values ('IAL1A', 'A', 'IAL');
    create or replace procedure Get_next_campgn(p_campgn varchar2,p_type varchar2)
    as
    begin
    update SP_Control set campgn_no = substr(p_campgn,1,length(p_campgn)-1)||to_char(ascii(substr(p_campgn,-1,1))+1) ,
    curr_wave = to_char(ascii(curr_wave)+1)
    where campgn_type = p_type
    and campgn_no = p_campgn ;
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end Get_next_campgn;
    begin
      Get_next_campgn('ONB01','ONB');
    end;
    select * from sp_control;
    --Output as Follows:
    drop table sp_control succeeded.
    create table succeeded.
    1 rows inserted
    1 rows inserted
    procedure Get_next_campgn(p_campgn Compiled.
    anonymous block completed
    CAMPGN_NO            CURR_WAVE            CAMPGN_TYPE         
    ONB050               50                   ONB                 
    IAL1A                A                    IAL                 
    2 rows selectedJust a hunch, in the Procedure call
    execute Get_next_campgn(‘ONB01’,’ONB’);the "Single Quotes" does not appear correct. They were probably typed into some other editor.
    When executed as
    execute  Get_next_campgn(‘ONB01’,’ONB’);
    Error starting at line 1 in command:
    begin
      Get_next_campgn(‘ONB01’,’ONB’);
    end;
    Error report:
    ORA-06550: line 2, column 19:
    PLS-00103: Encountered the symbol "‘" when expecting one of the following:
       ( ) - + case mod new not null <an identifier>
       <a double-quoted delimited-identifier> <a bind variable>
       table continue avg count current exists max min prior sql
       stddev sum variance execute multiset the both leading
       trailing forall merge year month day hour minute second
       timezone_hour timezone_minute timezone_region timezone_abbr
       time timestamp interval date
       <a string literal with character set specification>
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:So, just replace them in any SQL editor and your Invoker block shall work properly.
    Regards,
    P.

  • RPC error while executing procedure

    Hi,
    whenever I execute a procedure which extracts data from COBOL through relativity, it gives me RPC error and exits, the procedure code and error description is provided below,
    Procedure Code:
    ===========
    CREATE OR REPLACE Procedure CDB.pop_UtilityBill AS
    txt_Truncate Varchar2(200);
    txt_Rename Varchar2(500);
    BEGIN
    txt_Truncate := 'truncate table UtilityBill_Tmp';
    execute immediate (txt_Truncate);
    --Loading of Date from UTLMERGE File to Temporary Table
    Insert into UtilityBill_TMP
    (UtlBillDate,Branch ,Booth ,Batch,Card,Bill ,DocNo,Account ,ElcAcc ,ElcFil, GasAcc, GasFil, RegCode , ExchCode, PtclAcc , PtclFil ,
    WasaAcc, WasaFil , Amount , TranType , ChequeNo , Bank , Flag , UtlBillTime , PostId , FlatbedFlag , FlatbedMicrread , FlatbedEndorse , BillingMonth )
    Select DECODE("MrgDate",0,TO_DATE(NULL),TO_DATE("MrgDate"+1721423,'J')) UtlBillDate,
    "Branch",
    "Booth",
    "Batch",
    "Card",
    "Bill",
    "DocNo",
    "Account",
    "ElcAcc",
    "ElcFil",
    "GasAcc",
    "GasFil",
    "RegCode",
    "ExchCode",
    "PtclAcc",
    "PtclFil" ,
    "WasaAcc",
    "WasaFil" ,
    "Amount",
    "TranType",
    "ChequeNo",
    "Bank" ,
    "Flag" ,
    "MrgTime" UtlBillTime ,
    "PostId",
    "FlatbedFlag",
    "FlatbedMicrread" ,
    "FlatbedEndorse",
    "BillingMonth"
    From UTLMRG2M_CURR@BIDB
    INNER JOIN Branches_Control_UtlBill BU on BU.Branch = "Branch"
    where "MrgDate" > UtilityBill_Date
    and "Card" <> 9;
    COMMIT;
    --Loading of Date from Temporary Table to Interface Table
    INSERT INTO UtilityBill_I
    (UtlBillDate,Branch ,Booth ,Batch,Card,Bill ,DocNo,Account ,ElcAcc ,ElcFil, GasAcc, GasFil, RegCode , ExchCode, PtclAcc , PtclFil ,WasaAcc,
    WasaFil , Amount , TranType , ChequeNo , Bank , Flag ,UtlBillTime , PostId , FlatbedFlag , FlatbedMicrread , FlatbedEndorse , BillingMonth )
    Select UtlBillDate,
    Branch,
    Booth,
    Batch,
    Card,
    Bill,
    DocNo,
    Account,
    ElcAcc,
    ElcFil,
    GasAcc,
    GasFil,
    RegCode,
    ExchCode,
    PtclAcc,
    PtclFil ,
    WasaAcc,
    WasaFil ,
    Amount,
    TranType,
    ChequeNo,
    Bank ,
    Flag ,
    UtlBillTime ,
    PostId,
    FlatbedFlag,
    FlatbedMicrread ,
    FlatbedEndorse,
    BillingMonth
    From UtilityBill_TMP;
    COMMIT;
    --Swapping of Data from Interface Table to Actual Table
    EXECUTE IMMEDIATE('RENAME UtilityBill TO UtilityBill_Bkp');
    EXECUTE IMMEDIATE('RENAME UtilityBill_I TO UtilityBill');
    EXECUTE IMMEDIATE('RENAME UtilityBill_Bkp TO UtilityBill_I');
    -- Insertion in Interface Table for Next Day Preparation
    INSERT INTO UtilityBill_I
    (UtlBillDate,Branch ,Booth ,Batch,Card,Bill ,DocNo,Account ,ElcAcc ,ElcFil, GasAcc, GasFil, RegCode , ExchCode, PtclAcc , PtclFil ,WasaAcc,
    WasaFil , Amount , TranType , ChequeNo , Bank , Flag ,UtlBillTime , PostId , FlatbedFlag , FlatbedMicrread , FlatbedEndorse , BillingMonth )
    Select UtlBillDate,
    Branch,
    Booth,
    Batch,
    Card,
    Bill,
    DocNo,
    Account,
    ElcAcc,
    ElcFil,
    GasAcc,
    GasFil,
    RegCode,
    ExchCode,
    PtclAcc,
    PtclFil ,
    WasaAcc,
    WasaFil ,
    Amount,
    TranType,
    ChequeNo,
    Bank ,
    Flag ,
    UtlBillTime ,
    PostId,
    FlatbedFlag,
    FlatbedMicrread ,
    FlatbedEndorse,
    BillingMonth
    From UtilityBill_TMP;
    COMMIT;
    txt_Truncate := 'TRUNCATE TABLE UtilityBill_Tmp';
    execute immediate(txt_Truncate);
    Commit;
    END;
    Error Description:
    ===========
    BEGIN pop_UtilityBill; END;
    ERROR at line 1:
    ORA-02068: following severe error from BIDB
    ORA-28511: lost RPC connection to heterogeneous remote agent using
    SID=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=cdbprd)(PORT=1521)
    ))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=HSODBC1)))
    ORA-06512: at "CDB.POP_UTILITYBILL", line 10
    ORA-06512: at line 1
    HS trace file:
    ========
    Oracle Corporation --- TUESDAY MAY 08 2012 18:03:53.979
    Heterogeneous Agent Release
    9.2.0.8.0
    HS Agent received unexpected RPC disconnect
    Network error 1003: NCR-01003: NCRS: Read error.
    Oracle database Version:
    ===============
    Oracle9i Release 9.2.0.8.0 - Production
    Operating System:
    ===========
    Microsoft Windows Server 2003 SP2
    can anybody help me out on this?

    remove the line break then if youre loading that in. Apologies, I didnt read the next line. The error is with the insert, if youre loading that up as a sql command file it wont run like that with the line break as it reads it as separate commands quick example.
    SQL> host more ins.sql
    insert into t1
    (select * from dba_objects
    where rownum = 1);
    commit;
    SQL>
    SQL> create table t1 as select * from dba_objects where 1=0;
    Table created.
    SQL> @ins
    OWNER
    OBJECT_NAME
    SUBOBJECT_NAME                  OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
    CREATED   LAST_DDL_ TIMESTAMP           STATUS  T G S  NAMESPACE
    EDITION_NAME
    SYS
    ICOL$
                                           20              2 TABLE
    OWNER
    OBJECT_NAME
    SUBOBJECT_NAME                  OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
    CREATED   LAST_DDL_ TIMESTAMP           STATUS  T G S  NAMESPACE
    EDITION_NAME
    09-DEC-10 09-DEC-10 2010-12-09:03:39:59 VALID   N N N          1
    Commit complete.
    SQL> select * from t1;
    no rows selected
    SQL>
    -- ok, try it without the linebreak
    SQL> host more ins1.sql
    insert into t1
    (select * from dba_objects
    where rownum = 1);
    commit;
    SQL> @ins1
    1 row created.
    Commit complete.
    SQL>

  • Internal communication error when execute procedure on HANA MPP Cluster

    Hi All,
           I'm executing a hana POC at customer environment, it's a 6 nodes hana cluster (with one master & 5 work node).
    When I create a table cross all nodes, and than execute a procedure with that table, it's failed by internal error
    create columnt table CC.AA (NEWDATE DATE primary key) replica AT all locations;
    create procedure CC.P_INS_ADW_DIM_DATE( )
    LANGUAGE SQLSCRIPT
    SQL SECURITY INVOKER
    AS
    FULLDATE DATA;
    MONTHNUMBER INTEGER;
    YEARNUMBER INTEGER;
    DAYNUMBER INTEGER;
    BEGIN
           FULLDATE:=TO_DATE('19800101','YYYYMMDD');
           INSERT INTO "CC"."AA" CALUES(FULLDATE);
    END;
    CALL CC.P_INS_ADM_DIM_DATE( );
    The error message like below:
    SAP DBTech JDBC: Cannot connect to VolumeID=7 [Cannot connect to host 172.21.36.58:34215 [Connection timed out]]
    172.21.36.58 is internal communication IP address of the cluster node, while is public IP should be 192.168.1.123
    I'm wonder if Hana call data through internal channel, does the port should be 3××003
    And I saw in /etc/hosts internal IP bound to host name, not public IP
    hana003  172.21.36.58
    Can anyone help?
    thanks!

    Hi Experts,
      Did anybody faced same problem mentioned above? how to fix it.
    Thanks,
    Umashankar

  • Oracle procedure through dblink ora-3113

    The architecture of my service as follows: Windows Service connects to database (DB1) through the OCI protocol. After a successful connection it calls the alias of the procedure which is dblinked from another database server(DB2). Next it gets some data from dblinked tables and finally closes connection.
    My oracle version is 9.2.0 on both databases.
    Sometimes the sistem administrator make dump of the databases. And when my service makes the first "lifecicle" after the dump is done i got ora-3113.
    so, when i connecting there is no errors, but when i am calling the procedure, i got this error. And when i start my service again, there is no errors and everythig is going fine!

    Sounds like some kind of connection pooling is used - which means that when your service runs, it attempts to use a previously successful pooled connection to the database. But as the database dump resulted in a db reset, the server process that serviced that connection no longer exists.
    The connection is used, attempts to communicate with the server process no longer there, and gets a eof on that communication in return as the IP stack tears up that invalid tcp connection.

  • Error while executing procedure

    Hi,
    I am executing a procedure, which will write a query result into a spreadsheet and it will store it into the local PC. i am trying to run this procedure using TEST username.
    Now i created a utl_file directory like below:
    create directory MYDIR5 AS 'c:\raj';
    and i tried to assign permission like below :
    grant read,write on directory MYDIR5 to TEST
    i got the below error, while i am executing the GRANT stmt:
    ORA-01749: you may not GRANT/REVOKE privileges to/from yourself
    So who has to grant privileges for this. I tried to execute the procedure without granting privileges but it end up with ORA-29283: error.
    So pls help me on this issue.
    Thanks in advance!!!

    You looked up the CREATE DIRECTORY statement right? What does it say under "Prerequisites"?
    > I am executing a procedure, which will write a query result into a spreadsheet and it will store it into the local PC
    Is the database also on your local PC? UTL_FILE runs on the database server.

Maybe you are looking for