Error executing stored procedure

I have the following store procedure
trun_stg_acls
this is created by user 'cat'. I created grant execute permission on 'catloader'.
But when i try to execute the procedure it gives me the following error
1 DECLARE
2 BEGIN
3 DBMS_OUTPUT.PUT_LINE('BEGIN TRUNCATE');
4 TRUNC_STG_ACLS;
5 COMMIT;
6 DBMS_OUTPUT.PUT_LINE('END TRUNCATE');
7* END ;
8 /
TRUNC_STG_ACLS;
ERROR at line 4:
ORA-06550: line 4, column 2:
PLS-00201: identifier 'TRUNC_STG_ACLS' must be declared
ORA-06550: line 4, column 2:
PL/SQL: Statement ignored
I have a similar procedure trunc_stg_tables which executes fine.
Can any body please help me on this?

Or you could just do:
DECLARE
BEGIN
DBMS_OUTPUT.PUT_LINE('BEGIN TRUNCATE');
CAT.TRUNC_STG_ACLS;
COMMIT;
DBMS_OUTPUT.PUT_LINE('END TRUNCATE');
END ;
/

Similar Messages

  • Error executing Stored Procedure that returns a recordset in Visual Basic 6

    Hello, i tried to use the example in the link posted as a response to my question in a previous thread, and in Visual Basic 6, when i execute the Stored procedure it gives me the following error:
    This is the package created as indicated in the example FAQ you posted.
    package types
    as
    type cursorType is ref cursor;
    end;
    This is the procedure created as indicated in the example FAQ you posted.
    PROCEDURE SP_TITUVALO(T_BR IN VARCHAR2,
    P_Cursor OUT TYPES.cursorType )
    AS
    BEGIN
    OPEN P_Cursor FOR
    SELECT * FROM TASAS WHERE BR=T_BR AND TASA > 0;
    END;
    This is the code used to execute the Stored Procedure in VB6:
    Dim objConn As New ADODB.Connection
    Dim connString
    Dim cmdStoredProc As New ADODB.Command
    Dim param1 As New ADODB.Parameter
    Dim RS As ADODB.Recordset
    Set param1 = cmdStoredProc.CreateParameter("T_BR", adVarChar, adParamInput, 255, "97")
    cmdStoredProc.Parameters.Append param1
    objConn.Open strconex
    Set cmdStoredProc.ActiveConnection = objConn
    cmdStoredProc.CommandText = "SP_TITUVALO"
    cmdStoredProc.CommandType = adCmdStoredProc
    Set RS = cmdStoredProc.Execute
    This is the error returned:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SP_TITUVALO'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ****************************************************************

    Juan,
    Not sure about FAQ you are referring to, but it seems that you need to set PLSQLRSet property of ADODB.Command to TRUE. Because if you fail to do so - errors with refcursors are likely to happen.
    Consider:
    Set objConn = CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=OraOLEDB.Oracle;Persist Security Info=False;Data Source=test9ora;User ID=max;Password=blabla"
    objConn.Open
    'Dim cmdStoredProc
    Set cmdStoredProc = CreateObject("ADODB.Command")
    Dim param1
    Set param1 = cmdStoredProc.CreateParameter("T_BR", adVarChar, adParamInput, 255, "97")
    param1.Value = "X"
    cmdStoredProc.Parameters.Append param1
    'Dim RS
    Set cmdStoredProc.ActiveConnection = objConn
    'The following line was missed out
    cmdStoredProc.Properties("PLSQLRSet") = True
    cmdStoredProc.CommandText = "SP_TITUVALO"
    cmdStoredProc.CommandType = adCmdStoredProc
    Set RS = cmdStoredProc.ExecuteThis works fine, at least for me.
    Cheers.

  • Oracle Error Executing Stored Procedure

    Hi
    I'm invoking a stored procedure from Oracle Database. The procedure is running Ok in oracle, but when i run the procedure from .NET, failed. The code when stop is :
    Reader = cmdReader.ExecuteReader()
    The error is:
    A first chance exception of type 'System.Data.OracleClient.OracleException' occurred in System.Data.OracleClient.dll
    A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
    In the Catch Exception:
    Catch ex As OracleException
    MsgBox(ex.Code.ToString)
    The result is: 6550
    Do you can help me?

    Since you are using Microsoft's ADO.NET Provider for Oracle, I suggest that you post your question with a short sample on "ADO.NET Data Providers" forum here - http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=45&SiteID=1

  • Problem in executing Stored Procedure from Trigger

    Hi,
    Case1.
    I am executing a stored procedure form a trigger. The stored procedure is not executing fully.
    Case 2.
    But when when I execute Stored Procedure alone it is executing.
    CREATE OR REPLACE TRIGGER mhubadmin.call_proc_ratesheet_new
    after INSERT OR delete ON mhubadmin.pvt_br_ratesheet
    FOR EACH ROW
    declare
    var_orgid number;
    begin
    if inserting then
    select org_child_id into var_orgid from business_relationship where br_id=:new.br_id;
    mhubadmin.proc_ratesheet_new(var_orgid);
    else
    select org_child_id into var_orgid from business_relationship where br_id=:old.br_id;
    mhubadmin.proc_ratesheet_new(var_orgid);
    end if;
    end;
    CREATE OR REPLACE PROCEDURE proc_ratesheet_new(var_orgid in number)
    IS
    cursor c3 is select distinct(purs.user_id) from hubuser hu
    inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
                   where hu.ORG_ID=var_orgid;
    cursor c1(varUser_id number) is select purs.user_id,purs.ratesheet_id from hubuser hu
    inner join PVT_USER_RATESHEET purs on hu.USER_ID=purs.USER_ID
                   where hu.ORG_ID=var_orgid and purs.USER_ID=varUser_id;
    cursor c2(varUser_id number) is select hu.user_id,pbr.ratesheet_id from HUBUSER hu
                             inner join BUSINESS_RELATIONSHIP br on hu.ORG_ID=br.ORG_CHILD_ID
                             inner join PVT_BR_RATESHEET pbr on br.BR_ID=pbr.BR_ID
                                  where hu.user_id in(select distinct(purs.USER_ID) from hubuser hu
                                       inner join PVT_USER_RATESHEET purs
                                                                     on hu.USER_ID=purs.USER_ID
                                                 where hu.ORG_ID=var_orgid) and hu.user_id=varUser_id;
    foundFlag boolean;
    incrFound integer;
    insertFound integer;
    deleteFound integer;
    str varchar2(4000);
    BEGIN
         incrFound:=0;
         insertFound:=0;
         for c3var in c3 loop
    for c2var in c2(c3var.user_id) loop
              insert into test values ('Step3:'||c2var.user_id);
              foundFlag:=false;
              for c1var in c1(c3var.user_id) loop
                   if c2var.ratesheet_id=c1var.ratesheet_id then
                        foundFlag:=true;
                             incrFound:=incrFound+1;
                             exit;
                        end if;
                   end loop;
                   if foundFlag=False then
                   --insert into pvt_user_ratesheet (username_ratesheet_id,user_id,ratesheet_id) values (SEQ_USER_RATESHEET.nextval,c3var.user_id,c2var.ratesheet_id);
                   dbms_output.put_line('Inserted for user :'||c3var.user_id||' is - ratesheet :'||c2var.ratesheet_id);
                   insertFound:=insertFound+1;
                   end if;
              end loop;
    end loop;
         commit;
         incrFound:=0;
         deleteFound:=0;
         for c3var in c3 loop
              for c1var in c1(c3var.user_id) loop
              foundFlag:=false;
              for c2var in c2(c3var.user_id) loop
                        if c1var.ratesheet_id=c2var.ratesheet_id then
                        foundFlag:=true;
                        incrFound:=incrFound+1;
                        exit;
                        end if;
                   end loop;
                   if foundFlag=False then
                   --delete from pvt_user_ratesheet where user_id=c3var.user_id and ratesheet_id=c1var.ratesheet_id;
                        --dbms_output.put_line('Deleted for userid:'||c3var.user_id||' for ratesheet :'||c1var.ratesheet_id);
                        deleteFound:=deleteFound+1;
                   end if;
              end loop;
    end loop;
         commit;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.put_line (SQLCODE||' '|| SQLERRM);
    END;
    Regards,
    Mathew

    In general, I would suggest that you only catch errors that you can handle reasonably. If you know that a SELECT INTO might return 0 rows for example, handle the NO_DATA_FOUND exception. Having a WHEN OTHERS, particularly without re-raising the exception, only serves to hide the source of the problem. I would much rather that my code fail quickly and explicitly than hope that I see an error message in the output and that other code doesn't start failing because the system wasn't left in an appropriate state.
    As Mark suggests, you may choose to implement a comprehensive logging framework using autonomous transactions, in which case a WHEN OTHERS would be reasonable, but you would still want to propagate exceptions you cannot handle.
    If you see a WHEN OTHERS clause and there is no RAISE, you probably have an error waiting to happen.
    Justin

  • Could not execute stored procedure in oracle

    hello experts,
    Problem: I can not execute stored procedures stored in Oracle data base. Error Message: Portal request failed. Could not execute stored procedure.
    My steps:
    i connected my locally installed Oracle data base to the VC. I mapped the data base user to my VC user. I tested connection and it is fine. Further I see the db alias in Visual Composer and i can drop stored procedures to my story board. I can define parameters, but when I am executing procedures I get the error message.
    Further I installed MS SQL Server lokally and connected to the VC and it is working fine. I can do everything.
    Why it is not working for Oracle DB?
    DriverName: com.sap.portals.jdbc.oracle.OracleDriver
    Connect-URL: jdbc:sap:oracle://ip:port;sid=XE
    Any comment is highly appreciated.
    anton.

    Hi,
    Also you can follow this link which explains you the procedure to configure BI JDBC system for visual composer.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6209b52e-0401-0010-6a9f-d40ec3a09424
    Regards
    Inder
    Do reward points if helpful.

  • How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?

    Hi 
    I have a stored procedure. It can be executed like this
    exec test @p = 1;
    exec test @p = 2
    exec test @p = n;
    n can be hundred.
    I want the sp being executed in parallel, not sequence. It means the 3 examples above can be run at the same time.
    If I know the number in advance, say 3, I can create 3 different Execution SQL Tasks. They can be run in parallel.
    However, the n is not static. It is coming from a table. 
    How can I execute Stored Procedures in PARALLEL and DYNAMICALLY ?
    I think about using script task. In the script, I get the value of n, and the list of p, from the table, then running a loop with. In the loop, I create a threat and in the threat, I execute the sp like : exec test @p = p. So the exec test may
    be run parallel. But I am not sure if it works.
    Any idea is really appreciated.

    Hi nam_man,
    According to your description, you want to call stored procedures in parallel, right?
    In SSIS, we can create separate jobs with different stored procedures, then set the same schedule to kick the jobs off at the same time. In this way, we should be careful to monitor blocking and deadlocking depending on what the jobs are doing.
    We can also put all stored procedures in SSIS Sequence container, then they will be run in parallel.
    For more information about SSIS job and Sequence container, please refer to the following documents:
    http://www.mssqltips.com/sqlservertutorial/220/scheduling-ssis-packages-with-sql-server-agent/
    https://msdn.microsoft.com/en-us/library/ms139855(v=sql.110).aspx
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String

    In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .

    Hi Srinath,
    The below blog might be useful
    http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
    PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
    regards,
    Harish

  • Found a bug in "Execute Stored Procedure..." command

    Hi...I've found one interesting "feature": if I do click "Execute Stored Procedure"on SP, which contains an XML parameter (doesn't matter if it's input or output), Management Studio generates script without declaring datatype of that
    parameter. But if I click "Generate Script" everything works fine. This situation can be observed in SQL Server 2005-2012.

    Hello,
    Please submit a product feedback on Microsoft Connect:
    https://connect.microsoft.com/sqlServer/
    Thank you for sharing what you have discovered.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Execute stored procedure as sysadmin

    Hi,
    I am running powershell script to execute stored procedure on SQL server. Powershell script is run with low privilege user account on SQL server, but SP is restoring databases and requires sysadmin permissions. How can I execute SP with sysadmin permissions?
    Could this be done proxy account? without additional users creation. Any links? Thanks

    You can create the sp using a sysadmin account (or in dbo schema) and use EXECUTE AS OWNER inside it
    Then give the powershell account execute access to the procedure and it will run under context of dbo user  (or owner account) which will have necessary permission to do the data base restore etc
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Entity Framework - Execute Stored Procedures

    I want to execute stored procedure using entity framework.
    I am using entity framework 6.
    The stored procedure has SELECT and RETURN statement.
    How can I read the output from SELECT and RETURN statements using
    dbContext.Database.ExecuteSqlCommand or dbContext.Database.SqlQuery statement ?

    Hello Sumit Kadam,
    >> The stored procedure has SELECT and RETURN statement.
    For the select statement, Entity Framework would support natively:
    http://www.entityframeworktutorial.net/stored-procedure-in-entity-framework.aspx
    For the return statement, we could use the dbContext.Database.SqlQuery statement as below to fetch the value:
    var returnCode = new SqlParameter();
    returnCode.ParameterName = "@ReturnCode";
    returnCode.SqlDbType = SqlDbType.Int;
    returnCode.Direction = ParameterDirection.Output;
    // assign the return code to the new output parameter and pass it to the sp
    var data = db.Database.SqlQuery<Order>("exec @ReturnCode = ProGetOrder", returnCode);
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to customize events, execute stored procedures using JSF and ADF BC

    As a java beginner, I started with developing simple web application using JSF and ADF business component through visual and declarative approach. I need to know how to customize events, execute stored procedures, invoke functions on triggering events associated with rich controls. for eg. how to write customized functions on button click or checkbox click events to achieve business requirement and can be modified whenever required.
    Edited by: 792068 on Aug 31, 2010 9:40 PM

    Which business layer is prefered to create interactive data model: 1. ADF business components or 2. Enterprise JavaBeans using Java persistance API (JPA) or 3. Toplink 4. Portlets
    which minimizes writing low level codes and how much OOPS knowledge is required for creating above business layer binding data to viewcontroller layer?

  • Execute Stored Procedures from Stellent

    Can we execute stored procedures from stellent 7.5.2 ?
    By using java, I dont find any method to execute stored procedure from WorkSpace interface.
    Please guide me to solve this..
    Appreciate your help and efforts.

    May not be exactly what you're looking for, but I hope this helps:
    http://www.corecontentonly.com/Blog/Calling-A-Stored-Procedure-From-Oracle-Fusion-ECM-Stellent
    For java based execution basically:
    1. Create your stored proc in the db
    2. Create a component
    3. Create a query resource
    4. In your java code use the createResultSet method of the Workspace object and pass in the name of your query resource and then the current databinder object

  • Execute stored procedure from Unix shell script

    My current method of executing stored procedures (wpl_1 and wpl_2) from a unix shell script is as follows:
    <<wpl.sh>>
    sqlplus user/password @/home/oracle/scripts/wpl.sql
    <<wpl.sql>>
    set serveroutput on size 1000000
    set timing on
    execute wpl_1('0000010676','~')
    execute wpl_2('0000010676','~')
    execute wpl_1('0000010236','FIX')
    execute wpl_2('0000010236','FIX')
    exit
    Question: Is it possible to combine the two scripts (unix and oracle) together?

    A little rusty on this, but this may work:
    My current method of executing stored procedures
    (wpl_1 and wpl_2) from a unix shell script is as
    follows:
    <<wpl.sh>>sqlplus user/password @/home/oracle/scripts/wpl.sql << EOF
    set serveroutput on size 1000000
    set timing on
    execute wpl_1('0000010676','~')
    execute wpl_2('0000010676','~')
    execute wpl_1('0000010236','FIX')
    execute wpl_2('0000010236','FIX')
    exit
    EOF
    >
    Question: Is it possible to combine the two scripts
    (unix and oracle) together?

  • Facing error while trying to execute stored procedure from JSF Application

    Hi, I am facing the below error when I try to execute a stored Procedure from JSF application which is deployed on WAS 7.0
    =2013-03-04 19:06:58,550 INFO [com.lloydstsb.iw.util.DBUtils] - DBUtils : executeFileNetStoredProc method started..
    =2013-03-04 19:11:58,271 ERROR [com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl] - Data Access Exception
    com.lloydstsb.iw.common.exceptions.DataAccessException: Data Access Exception Occured : Integration Stored Proc- java.sql.SQLException: java.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
         at com.lloydstsb.iw.util.DBUtils.executeFileNetStoredProc(DBUtils.java:959)
         at com.lloydstsb.iw.util.DAOUtil.executeFileNetStoredProc(DAOUtil.java:117)
         at com.lloydstsb.iw.dao.FileNetCustomDBSynchDAOImpl.updateFileNetDetailsCustomDB(FileNetCustomDBSynchDAOImpl.java:36)
         at com.lloydstsb.iw.servlet.IndexServlet.service(IndexServlet.java:127)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
         at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859)
         at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
         at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
    The oracle version we are using is 11g.
    Previously it worked fine when the application was used in 10g.
    Can someone please help me in resolving this issue?
    Kiran
    Edited by: 991640 on Mar 4, 2013 8:25 PM

    java.lang.ClassCastException: oracle.jdbc.driver.LogicalConnection incompatible with oracle.jdbc.OracleConnection
    Are the the JDBC JARs packaged with the application? If so, remove the applicaiton packaged JDBC JARs as the JARs are also in WebSphere application server.

  • Error While Executing Stored Procedure - SAP BPC 5.0

    Hi all
    I have defined stored procedure 'EP2' in the account transformation rules and which runs fine with all the entities.
    But when I filter particular entity which give no data extrace to the selections made instead of giving the comment:
    0 rows created and update it gives the error below.
    Kindly Help me out if any one has the idea of running stored procedure
    Executing SPRUNCALCACCOUNT "[[FINANCE]],[[ACTUAL]],[[LC]],[[SPSCOPE_367693]],[[SPLOG_887033]],[[EP2]]"
    SPRunCalcAccount Version 2.06
    -ERR- CALC-070 No DATA Extract From FACT Table
    Time to run stored procedure:2.8 sec.
    Edited by: Harish Bysani Kodanda on Mar 14, 2008 8:46 AM
    Edited by: Harish Bysani Kodanda on Mar 14, 2008 8:47 AM
    Edited by: Harish Bysani Kodanda on Mar 14, 2008 8:48 AM

    Yes, the business rules stored procedures surface an error if there is an empty data set to operate on.

Maybe you are looking for