Weird stored procedure

Hi all.

11.2.0.1

We have a stored procedure that is suspended for a long time now. But he used to run a minute only.

I followed the locks, but there is none.

If I manually run a sql procedure content in sqlplus, it will work fine.

I already stopped and start it again, but nothing helped.

I have also recompile and collect statistics schema, but in vain.

How to solve this problem please...

Help, please...

as POGO said: "we have met the enemy and it is us!"

Oracle does not allow a fall or a recompilation of any SP after DML & unless or until COMMIT or ROLLBACK was issued by the same session.

Tags: Database

Similar Questions

  • infinite loop in stored procedure

    I am trying to create an infinite loop to test an error condition. I do this in the stored procedure. I have not created a stored procedure before. I get errors when I am writing the script. Can you please tell me what I'm doing wrong with this script?


    CREATE OR REPLACE PROCEDURE blah.test_timeout

    IS

    number of deadline_days: = 1;
    grace_period number: = 0;

    BEGIN
    -get day of the date limit

    While deadline_days < 4000
    LOOP
    grace_period: = grace_period + 1;
    dbms_output.put_line (' Hello mum ');
    END LOOP;


    RAISE_APPLICATION_ERROR (-20071, "what_error error:' | ') SQLERRM (sqlcode));

    END;
    /




    Thank you!

    First tell me that this error message happens when you run this script.

    You can use only * $, _, #* when you give the name of procedure, function, package, variable, trigger. Here, you use * (.) * in your name of the procedure so it will give you error.

    and you first declare exception in your procedure declaration section. and raise it in Exception of procedure section.
    In this you have to give the condition for which exception condition must raise.

    This is a sample I'll send to your reefrence:-_

    CREATE OR REPLACE PROCEDURE raise_demo (inval NUMBER) IS
    evenno EXCEPTION;
    oddno EXCEPTION;
    BEGIN
    MOD IF (inval, 2) = 1 THEN
    RAISE oddno;
    ON THE OTHER
    RAISE evenno;
    END IF;
    EXCEPTION
    WHEN evenno CAN
    dbms_output.put_line (to_char (Inval) |) "is even");
    WHEN oddno THEN
    dbms_output.put_line (to_char (Inval) |) "is weird");
    END raise_demo;

  • ORA 04067: not performed, stored procedure 'PUBLIC '. Does not exist.

    We are migratory forms 6i to 10 g. during execution of the forms on our premises
    It works well, but when we run same form of application server
    We get error ORA 04067: not running, "PUBLIC" stored procedure. Does not exist.
    We have applied the patch for BUG 5123798 , but still it does not work.
    Note: We have no procedure named PUBLIC.

    We came to the conclusion this problem % rowtype and type %
    Forms with the procedures which have a % rowtype as in, setting out do not work. When we use the insert/update instead of using % rowtype everything works fine. It's a little weird. Some know this problem.

    PROCEDURE insertbrs_ware_trans)
    p_brs_mack_trans_rec brs_waretran_trans % ROWTYPE
    )
    IS
    BEGIN


    I'd really appreciate your help.


    Thank you
    Sandy

    Hi Sandy

    If you have applied the hotfix you did a "opatch apply.

    To find out what has been applied making a 'lsinventory opatch.

    Best
    Torben

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

    Hello

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

    See the file attached is seq.

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

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

  • Get the EXIT and the RETURN of a stored procedure parameters

    I have a stored procedure (SQL Server 2008 R2 MS) as in the following example.

    Thanks to the connectivity of database I get OUTPUT parameters, but I can't get the game DATA RECORDS and RETURN value.

    Someone knows how to do this?

    CREATE PROCEDURE [dbo]. [TS_Teste] (@T057_S_NOMEMAQUINA VARCHAR (20), @STATUS INT OUTPUT, OUTPUT OF NVARCHAR (500) OF @ERRO)

    AS

    BEGIN
    DECLARE THE TABLE @TABLE (CODE INT, DESCRIPTION VARCHAR (30))

    INSERT VALUES INTO @TABLE (51, 'A')
    INSERT VALUES INTO @TABLE (52, 'B')

    INSERT VALUES INTO @TABLE (53, 'C')

    SELECT * FROM @TABLE

    SET @STATUS = 1

    SET @ERRO = "Nenhum erro!

    RETURN 0

    END

    I finally found what was wrong... He had a line in the stored procedure only aditional. It should be like this:

    CREATE PROCEDURE [dbo]. [TS_Teste] (@T057_S_NOMEMAQUINA VARCHAR (20), @STATUS INT OUTPUT, OUTPUT OF NVARCHAR (500) OF @ERRO)

    AS

    BEGIN
    SET NOCOUNT ON;                                                                                               -NEW LINE!

    DECLARE THE TABLE @TABLE (CODE INT, DESCRIPTION VARCHAR (30))

    INSERT VALUES INTO @TABLE (51, 'A')
    INSERT VALUES INTO @TABLE (52, 'B')

    INSERT VALUES INTO @TABLE (53, 'C')

    SELECT * FROM @TABLE

    SET @STATUS = 1

    SET @ERRO = "Nenhum erro!

    RETURN 0

    END

  • Stored procedure

    I can't using stored procedures and need advice.

    If I try to run the stored procedure code, I get an error saying that I not provided a required entry, but the LabVIEW looks I'm him.

    But I get this error message.

    The database table is as follows:

    @ID is generated in the process, he is looked at and inserted.

    I don't have the opportunity to get into the database.  It is a stored procedure of writtin by the DB of my COMPUTER service engineer.  The image above has the required fields highlighted in yellow I need to provide when executing my code.

    Can you see where my mistake was made?

    Thanks for the comments.

    Ben

    The procedure does not match the names of parameters with the values that you provide.  You provide only 5 params, but there are 8 in the stored procedure.  In your case, SerialNumber is spent in the ID, PartNumber in SerialNumber, etc..  Add some empty in your cluster params, if they are not mandatory.

  • How can I transfer content from an XML file in a MS SQL database of the stored procedure using LabWindows/CVI SQL Toolkit?

    Hello

    I have a problem to transfer content to an XML file in a MS SQL database through a stored procedure data/fixed. I am able to transfer the content of the file using method...

    HSTMT = DBPrepareSQL (hdbc, EXEC usp_InsertReport " ... ");

    resCode = DBExecutePreparedSQL (hstmt);

    resCode = DBClosePreparedSQL (hstmt);

    ... but in this case, I am not able to read the return value of the stored procedure.

    I tried to follow the example of the stored procedure in the help documentation (DBPrepareSQL), but I miss a xml data type?

    No idea how to solve my problem?

    Cake of KR

    DianaS salvation,

    Thanks for your comments. During this time I found another way which fullfill my needs:

    resCode = DBSetAttributeDefault (hdbc, ATTR_DB_COMMAND_TYPE, DB_COMMAND_TEXT);

    sprintf (sz_SqlStatement, "DECLARE @TESTID INT EXEC @TESTID = usp_InsertReport ' SELECT 'RetVal' %s = @TESTID", sz_Buffer ");
    HSTMT = DBActivateSQL (hdbc, sz_SqlStatement);

    While ((resCode = DBFetchNext (hstmt)) == DB_SUCCESS)

    {

    / * Enter values in the record. */

    resCode = DBGetColInt (hstmt, 1, & s32_TestId);
    }

    resCode = DBDeactivateSQL (hstmt);

    sz_Buffer is the content of the XML file.

    Cake of KR

  • SQL stored procedure input and output parameters

    Hello Gang,

    My dead end trying to call a stored procedure in SQL Server 2008 with the LV database tool.

    for purposes of experimentation, I've created a small procedure with an input parameter that returns an integer as return value.  It works describing a query, but all attempts at LV produce an error-2147217900 when executing query VI.  I did find examples of that.

    Sending a bunch of parameters to a stored procedure and checking the value of return seems to be pretty common stuff.

    I'll appreciate any help.

    Thank you

    Roger

    Hi Roger,

    There are a few prerequisites which I will list below. If you have not checked these things, so don't hesitate, as your hiccups can be there.

    Prerequisites:

    1. Ensure that you can read from a table in the database to verify that you can access the database (user permissions) and ensure that your login details are correct. Among other things, make sure that the. DSN switches to the correct database. (See the simple example below, SQL Select.vi)
    2. Make sure that your user (if you use SQL authentication) has permissions to run the STORED procedure by running the procedure in SQL Server Management Studio (you seem to have already done this)

    Example by calling a procedure without parameters (attached as SPROC_No_Parameters.vi):

    Example by calling a procedure with parameters (attached as SPROC_Parameters.vi):

    An article on the execution of stored procedures is here:

    http://digital.NI.com/public.nsf/allkb/07FD130746083E0686257300006326C4

    Don't forget to download the example VI since it includes the cases where you want an output parameter of the procedure rather than a table.

    I tested these against two very simple SPROCs and it worked fine (on SQL Server 2005, but 2008 should be the same).  Stored procedures have been:

    CREATE PROCEDURE [dbo]. [GetContacts]

    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    SELECT * FROM Contacts
    END

    and

    CREATE PROCEDURE [dbo]. [MultiplyAges]
    @param1 INT = 1
    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    SELECT (age * @param1) OF Contacts
    END

    I would like to know if these examples work for you or if you have any other questions.  Don't forget to go through this KB article and articles related to it, they should cover other situations.

    Matt

  • Calling stored procedures with parameters with the database connectivity Toolkit

    Hi all

    I'm new to the forum and struggling to find a solution to a particular problem I have in this respect, using the LabVIEW Database Connectivity Toolkit on a project, I am currently working on my work.  I have a database in which I tables and stored procedures with parameters.  Some of these stored procedures have input, output and return parameters.

    I tried to follow this example, but to no avail: http://digital.ni.com/public.nsf/allkb/07FD130746083E0686257300006326C4?OpenDocument

    Such a stored procedure I am working on the implementation is named "dbo.getAllowablePNs", running "SELECT * from DeviceType" (DeviceType is the table).  In this case, it requires no input parameter, it has an output parameter that generates the table [cluster] and has a return parameter that returns an integer value (status code for execution) to show if an error occurred.  The DeviceType table has 3 columns; ID (PK, int not null), PN (nvarchar ((15), null) and NumMACAddresses (int, null).)  I have surpassed many examples and I talk to the support OR try to implement this and similar procedures stored in LabVIEW but have not been successful.  I am able to connect to the database with the VI of open connection without error, but spin in some confusion as a result of this step.  I then try to use the VI of parameter query create to call the stored procedure and set the parameters.  I guess I would then use the Set parameter value for each parameter that is connected to the entry of parameters on the previous query with parameters VI VI?  I am also having some confusion during and after these steps as well.  I would greatly appreciate advice or suggestions that anyone could have in this situation because I am not a SQL expert.  Also, I would be happy to provide more information that might be useful.

    Kind regards

    Jon

    Here's what I use to do this.  I think I had to change him create parameterized query VI for him to work.  There is a post on the forum about this somewhere.

  • IPCC Express Premium supports stored procedure calls

    IPCC expresses premium version support database features get information from databases odbc by calling stored procedures? The customer does not want that all custom sql queries with access, we are only allowed to use existing stored procedures.

    Yes, there is a post in March that describes what you need to do. I am currently using stored procedures with a SQL DB client and it works very well. I don't have to add custom tables that correspond to the stored procedure output well.

    http://forums.Cisco.com/eForum/servlet/NetProf?page=NetProf&type=EmailAFriend&CommCmd=MB%3Fcmd%3Dpass_through%26location%3Doutline%40%5E1%40%40.1ddd8f26%2F2#selected_message

    Mike

  • call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. The other rows are based on the entities

    Hi Experts,

    JDeveloper 12.1.3.0.0

    I have a VO based on entity object. With a column of the VO is transient attribute (I created).

    I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.

    So can anyone suggest how can I achieve this?

    Thank you

    AR

    I think that you need a stored function (which returns the value) in this case, is not?

    Take a look at:

    https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm

    and search for:

    Invoking stored function with only Arguments in

    call your function in the Get attribute and return value accessor...

  • Problem with stored procedure and validation

    I have the following stored procedure:

    create or replace PROCEDURE SOME_PROC)

    /*

    Some settings

    */

    ) AS

    NUMBER of errors

    BEGIN

    errors: = FN_CHECK_BUSINESS_RULE_1 (/ * some args * /);

    if(Errors > 0) then

    raise_application_error (ERR_CONSTANTS. SOME_ERROR_NUMBER, ERR_CONSTANTS. SOME_ERROR_MESSAGE);

    end if;

    INSERT INTO une_table (/ * columns * /) VALUES (/ * values * /);

    END SOME_PROC;

    Because the business rule 1 is placed inside the stored procedure I can't check it out without calling the stored procedure.

    I need to call the stored procedure 10 times with a different set of parameters and validation of the changes only after all calls to the stored procedure

    are successful. I want to show the user all the errors that occurred during the stored procedure calls. If for a first example of stored procedure call

    succeeds and a second failure no data has to be stored in a database.

    How to prevent the stored procedure for insert lines until I call the method commit of ApplicationModule?

    Thanks in advance.

    No, other users only see the lines until you commit. The search term is the transaction isolation level. Tom Kite write a paper on this here ask Tom: on transaction isolation levels. This article gives some samples, according to theory, and you should read it.

    Timo

  • Y at - it a syntax better/more runs to get data to and from stored procedures?

    To test the stored procedure call, I created a simple package

    create or replace package TEST_PROCEDURES as
    
    procedure Test1 (
       arg1 in number,
       arg2 in number,
    
       res1 out number,
       res2 out number);
    
    end;
    
    

    and a page with fields number four (P1_INPUT_2, P1_OUTPUT_1, P1_INPUT_1, P1_OUTPUT_2) and a button excuting the code following PL/SQL:

    declare
      arg1 integer;
      arg2 integer;
      res1 integer;
      res2 integer;
    begin
      arg1 := :P1_INPUT_1;
      arg2 := :P1_INPUT_2;
    
      TEST_PROCEDURES.Test1(arg1, arg2,
                            res1, res2);
                        
      APEX_UTIL.SET_SESSION_STATE('P1_OUTPUT_1', res1);
      APEX_UTIL.SET_SESSION_STATE('P1_OUTPUT_2', res2);
    end;
    
    

    It works, but it looks like a lot of unnecessary code to me. Any suggestions?

    TryingAPEX wrote:

    To test the stored procedure call, I created a simple package

    create or replace package TEST_PROCEDURES as

    procedure (Test1

    in number arg1,

    arg2 in number,

    RES1 number,

    Res2 number);

    end;

    and a page with fields number four (P1_INPUT_2, P1_OUTPUT_1, P1_INPUT_1, P1_OUTPUT_2) and a button excuting the code following PL/SQL:

    declare

    whole arg1;

    Whole arg2;

    integer res1.

    whole Res2;

    Start

    arg1: =: P1_INPUT_1;

    Arg2: =: P1_INPUT_2;

    TEST_PROCEDURES. Test1 (arg1, arg2,

    RES1, res2);

    APEX_UTIL. SET_SESSION_STATE ('P1_OUTPUT_1', res1);

    APEX_UTIL. SET_SESSION_STATE ('P1_OUTPUT_2', res2);

    end;

    It works, but it looks like a lot of unnecessary code to me. Any suggestions?

    Why would you do that? APEX may be referenced in the same way as all the other bind variables (although it is worth noting that their type is always VARCHAR2, so in this case, it will rely on the implicit conversion):

    begin
      test_procedures.test1(:p1_input_1, :p1_input_2, :p1_output_1, :p1_output_2);
    end;
    

    For the previous discussion on this topic, see set manually with PL/SQL session state .

    Always advanced postal code using the functionality of the syntax highlighted in the editor.

  • Version of 5.0.2.00.07(online à APEX) - error in the execution of a stored procedure through anonymous block

    DECLARE

    the stored procedure varchar2 (25);

    BEGIN

    -DBMS_OUTPUT. Put_line ("enter the name of the procedure :'||: procname");

    the stored procedure: =: procname;

    DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    stored procedure.

    END;

    : procname is a variable binding in the apex to switch the running value.

    apex-bind_var.png

    This is the error I get

    ORA-06550: line 7, column 2:

    PLS-00221: "STORED procedure" is not a procedure or is not defined

    ORA-06550: line 7, column 2:

    PL/SQL: Statement ignored

    5the stored procedure: =: procname;

    6 DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    7. the stored procedure.

    8 END;

    SmtWtL wrote:

    DECLARE

    the stored procedure varchar2 (25);

    BEGIN

    -DBMS_OUTPUT. Put_line ("enter the name of the procedure :'||: procname");

    the stored procedure: =: procname;

    DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    stored procedure.

    END;

    : procname is a variable binding in the apex to switch the running value.

    This is the error I get

    ORA-06550: line 7, column 2:

    PLS-00221: "STORED procedure" is not a procedure or is not defined

    ORA-06550: line 7, column 2:

    PL/SQL: Statement ignored

    5. the stored procedure: =: procname;

    6 DBMS_OUTPUT. Put_line (' procedure :'|| stored procedure);

    7. the stored procedure.

    8 END;

    What you're trying to achieve?

    Bind variables cannot be used for the dynamic execution of stored programs. Dynamic SQL using lexical rather than bind substitution must be used to run when the program name is not known until execution of the programs.

    declare
      sproc varchar2(25);
    begin
      sproc := :procname;
      dbms_output.put_line('procedure:'||sproc);
      execute immediate 'begin ' || sproc || '; end;'; -- DO NOT DO THIS!
    end;
    

    It is a fundamental design flaw and a security disaster. It's stops essential compilation controls is performed and is open to attack by SQL injection and other security vulnerabilities. There is no good reason to do this.

  • Call the stored procedure, and bind parameters by name

    Hello

    I use the Oracle ODBC 12 c driver to pass values from one Interface to our database Oracle 11.2. The Interface software collects data from modbus protocoll and calls a stored procedure. Right now my syntax to call the stored procedure looks like this:

    CALL procedure-name ('STRING', 'Timestamp as String', numValue1);

    It works very well. Now, I have to add a default setting to my procedure. To stay flexible to make other changes, I want to call the procedure and bind the parameters by name. Release 10.2.0.1.0 ISC ODBC Notes:

    Added support for the named parameter, binding the parameters by name. ODBC Oracle driver now allows the application to specify the parameters of a stored procedure by name, in the procedure call. Named parameters are to be used in calls to stored procedures and should not be used in other SQL statements.

    So, it shouldn't be a problem to use named notation, but how do I do this in ODBC? I tried like this, but oracle returns an ora-00936 error of missing expression:

    call procedure-name (paramName1 = > 'STRING',= paramName2 > 'Timestamp as String',paramName3 = > numValue1).


    Thank you for your help.

    Finally, I was able to find the error. The syntax of the statement was very good. The problem was caused by another declaration that I edited before and the error has not attracted Attention immediately.

    Thanks for reading and looking for an answer.

Maybe you are looking for