Transaction in stored procedure not treated as Atomic?

Hello

I have a stored procedure that inserts a line in a table called reservations and also decrement the places available for an event.

For example: at an event, there are 100 places available. After you add a reservation, it will be left only 99 seats.

I also have a Java program that sends 100 concurrent transactions to the database.

After 100 transactions, there are 100 reservations, but there are still about 60 free places.

So, I guess that the transaction he has not treated as atomic. I don't know why some transactions fail?

The code of the stored procedure:

create or replace PROCEDURE procedureOne (s_price, NUMBER, NUMBER, of s_customer)

s_event NUMBER, DATE, s_movie NUMBER of s_dat)

IS

s_ev NUMBER;

s_free NUMBER: = 0;

BEGIN

commit;

Set transaction read write;

Start

SET TRANSACTION ISOLATION LEVEL READ COMMITTED;

Select Event_ID, Free_seats EN s_ev, s_free

events

where ID_Movie = s_movie;

If s_free > 0 then

Start

update events set Free_seats = s_free-1;

insert into values of reservations (seqa_seq. NEXTVAL, s_dat, s_customer, s_event, s_price);

commit;

end;

on the other

Start

Rollback;

end;

end if;

end;

commit;

end procedureOne;

invatacelul wrote:

So, I guess that the transaction he has not treated as atomic. I don't know why some transactions fail?

You said: "I also have a Java program that sends 100 concurrent transactions to the database. Atomicity applies to a single transaction - it says transaction executes all or nothing. Is what you run in isolation. If you want isolation unless you serialize, transaction 2 sees no uncommitted transaction 1 results because the READ COMMITTED isolation level indicates that a transaction can read only the data that has been committed to the database. And since you wrote your code as SELECT + UPDATE you get results you never expected. Use:

UPDATE OF EVENTS

SET FREE_SEATS = FREE_SEATS - 1

WHERE ID_Movie = s_movie

AND FREE_SEATS > 0;

SY.

Tags: Database

Similar Questions

  • transaction isolation stored procedure-level testing

    Hello

    I want to study the concurrency in the Oracle database using stored procedures in pl/sql with different transaction isolation levels.

    The idea is to send to the database of a number "n" of simultaneous transactions where n can be {100, 200, 400, 1000} and for each isolation level (READ COMMITTED, SERIALIZABLE) to determine the number of transactions committed, how much data, run time incorrect.

    The question is how can I generate n transactions that run simultaneously on the data base and how to get these results. I understand that this task can be done as well by using pl/sql stored procedure in the database or inside a JSP Java web application. Advantages/disadvantages?

    I should mention that I'm a begginner in Oracle...

    Thank you in advance.

    You want to run a large number of asynchronous (parallel) transactions.

    Although this can be done by running the Oracle's work, I think it is easier to work with the client side, using a Java program (for example).

    It doesn't have to be a web application (for example. JSP), can be a client Java that uses Java threads, and each thread is using a single database connection (and the corresponding database session).

    Kind regards

    Zlatko

  • MySQL stored procedure syntax errors

    I have a request online, I want to use transactions either commit all updates of db or anything. The code I created is as follows, not only am I getting an error of syntax on lines 5 and 16, but frankly I do not know that the code is really going to do what I want. Please let me know if you see syntax errors and explain them.

    CREATE PROCEDURE increase_maint_priority
        (maint_item INT, new_priority INT, cur_priority INT, center_id INT)
     
    BEGIN
        START TRANSACTION; -- line 5 syntax error
        -- start updates
        UPDATE maintitem SET priority = (priority+1) 
            WHERE priority > cur_priority
            AND priority <= new_priority
            AND centerID = center_id;
            
        UPDATE maintitem SET priority = new_priority
            WHERE id = maint_item;
        
        COMMIT;
    END; -- line 16 syntax error
    

    Thank you in advance for helping a newb to stored procedures.

    If you want to help me to know if this code will actually work for what I want, that the following describes the situation.

    Main idea: business location apply for maintenance at their Center. Applications can be added anywhere in the list of priority (1 = highest priority). They can also change the priority of an application at any time.

    Previously I was using php to control a loop of update mysql queries (ouch, I know now, 2 sql statements could do the trick) and we live lately priorities in double, and other problems which seem to be very likely related to the update of the priorities of several elements.

    Ex: moving priority 6 to priority 1 requires 1 update query because the current priority of the 6th point, but a second query (or loop of several others since I am very new to the drafting 2 years ago sql statements) to update the other priorities.

    Thus, the desire for transaction method.

    Once again, thanks in advance for any help on this matter.

    PS - I use MySQL workbench to write this and it's where to find errors.

    I do not use MySQL and its syntax is slightly different from the other DBMS stored procedures. In all cases, once you eliminate the warning, you also add a handler to ensure that updates roll back in case of error:

    http://khanrahim.WordPress.com/2010/05/16/transaction-with-stored-procedure-in-MySQL-serve r.

  • user_table should be used in the stored procedure.

    Hello

    I want to find my permanent table user_tables and then drop and recreate it,

    I can use this user_tables in my stored procedure for above purpose or is there any notice that must be used.

    SP is admin sp, used to run in offline mode.

    yorus truly

    Published by: 944768 on 10 February 2013 23:44

    Published by: 944768 on 10 February 2013 23:44

    944768 wrote:
    but I wanted to know that can I use user_table in above proc stored to conclude and then drop and create it when Everitt runs?

    Oracle manages two "flavors" of the stored procedure - copyright and rights of the Summoner. Rights of the DEFINER (default) is always performed under stored security area of the owner of the procedure no matter who calls it. So, if you ask USER_TABLES (or any display USER_, besides) within DEFINER rights stored procedure, you will get a list of tables owned by the owner of the stored procedure, not stored calling procedure. Rights (AUTHID CURRENT_USER) stored Invoker procedure is always carried out under the domain of the calller security. Therefore, if you are querying USER_TABLES (or any display USER_, besides) within the Summoner rights stored procedure you will get a list of tables belonging to the appellant a stored procedure. Hope it answers your question.

    SY.

  • Trigger that executes the stored procedure does not

    I have a trigger on a table which triggers the update of the column 'APPLICATION_OFFER_SENT '! The trigger looks like this:
    CREATE OR REPLACE TRIGGER SCHEMA.COPY_APPLICATIONS
    AFTER UPDATE
    OF APPLICATION_OFFER_SENT
    ON PPLE_T_APPLICATION 
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
        UPDATE_OR_INSERT_APPL(:old.PK_APPLICATION_NO);
    END;
    Simply, he runs a procedure and takes the "PK_APPLICATION_NO" as a single parameter.

    When I run the SP itdefl: exec UPDATE_OR_INSERT_APPL (1042); It works very well.
    But when its done through the relaxation it doesn't?



    The Proc looks like this:
    CREATE OR REPLACE PROCEDURE SCHEMA.UPDATE_OR_INSERT_APPL (IN_APPL_NO NUMBER) IS
    
    CURSOR c1 IS
    SELECT title, fullname, universityid, appl_no,  appl_no_hash, OFFER_EXPIRATION_DATE, APPLICATION_CANCEL_DATE, room_hall 
      FROM SCHEMA.ACCOM_APPLICATION_VIEW
     WHERE appl_no = IN_APPL_NO;
    
    rowcnt NUMBER;
    
     BEGIN
      FOR rec IN c1
          LOOP  
          SELECT COUNT(*) INTO rowcnt FROM SCHEMA2.ACCOMM_OFFER_ACCEPTANCE a WHERE a.appl_no = IN_APPL_NO;
               
               IF rowcnt = 0  THEN
                   INSERT INTO SCHEMA2.ACCOMM_OFFER_ACCEPTANCE (title, fullname, universityid, appl_no, appl_no_hash, offer_expiration_date, application_cancel_date, room_hall)
                        VALUES (rec.title, rec.fullname, rec.universityid, rec.appl_no, rec.appl_no_hash, rec.offer_expiration_date, rec.application_cancel_date, rec.room_hall);
                        COMMIT;
                        
                        
                        
               ELSIF rowcnt !=0 THEN
               
                    UPDATE SCHEMA2.ACCOMM_OFFER_ACCEPTANCE t
                       SET (t.offer_expiration_date, t.application_cancel_date, t.room_hall) = (select OFFER_EXPIRATION_DATE, APPLICATION_CANCEL_DATE, ROOM_HALL from SCHEMA.ACCOM_APPLICATION_VIEW B
                                                                                                      where B.appl_no = IN_APPL_NO);        
              
               END IF;
    
          END LOOP; 
     END;
    Published by: oraCraft on Oct / 09/2010 09:11

    Published by: oraCraft on Oct / 09/2010 09:11

    >
    Validation is in my stored procedure, is not my trigger. I'm sure it's very good
    >

    It is not very well according to the Application Developer Fundametals guide...

    >
    DDL statements are not allowed in the body of a trigger. Furthermore, no control of transaction
    statements are allowed in a trigger. SAVEPOINT, COMMIT and ROLLBACK cannot be
    used. For system triggers, TABLE {CREATE/ALTER/DROP} instructions and
    EDIT... COMPILE are allowed.
    Note: A procedure is called by a trigger cannot perform the previous transaction control statements,
    because the procedure runs in the context of the body of the trigger.
    >

    There is an exception to this rule if you use the pragma AUTONOMOUS TRANSACTION, but I do not see that in your trigger.

    Kind regards
    Bob

  • Could not import the Pentecost Entity Framework stored procedures

    Hi, I have a problem with Entity Framework 5 and stored procedures. I can add stored procedures to mi with "Update Wizard" solution, but them does not show in the Model Explorer and I can't use my code. I have ODAC 12 c Release 2 installed in my pc.

    There is a bug in the database Oracle 12 c that occurs only with a snap-in database. It is fixed in the next group of patches from database. (bug #17448545)

    There are three workarounds in the meantime:

    (1) to re-create the database without the shared option (no plug-in database)

    (2) install your schema in the database of the container instead of a snap-in database. You will need a user name as C ##HR to do. It is not advisable on a production database.

    Add 3) the section of manually in in the edmx file. Note that this is deleted when you "Generate database from model" or "Update model from database".

    for example:

    ...

    ParameterTypeSemantics = "AllowImplicitConversion" scheme = "SCOTT" >

  • Link to database not be created using a stored procedure

    Hello

    I am creating a link of database using a stored procedure.

    Here is the code for it

    CREATE OR REPLACE PROCEDURE create_db_link (ca_db_name IN VARCHAR2,

    ca_service_name IN VARCHAR2)

    AUTHID CURRENT_USER IS

    BEGIN

    EXECUTE IMMEDIATE ' create public database link test_db_link connect to ca_db_name identified by ca_db_name using "ca_service_name" ';

    END create_db_link;

    During execution of the code is created the db_link. But, when I ask all_db_links I get the following result.

    OWNER

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

    DB_LINK

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

    USERNAME

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

    HOST

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

    CREATED

    ---------

    PUBLIC

    TEST_DB_LINK. WORLD

    CA_DB_NAME

    ca_service_name

    20 Aug 13

    Could you please help me understand why it shows the parameter names in the name column of the USER and the HOST instead of the name of the database and the name of the service?

    This is to show exactly what you said to do.

    Did you expect that Oracle would read as if by magic through your string you passed to run immediately and magically know to replace all occurrences of the string that correspond to local (or even global) parameter/variable names with the values of these variables?  It does not work like that.  You could concatenate the values into the string.

    for example

    EXECUTE IMMEDIATE ' create public database link test_db_link connect to ' | ca_db_name |' identified by ' | ca_db_name: ' using the "' | ca_service_name | " ' ;

    But why are create you database links running?  Shouldn't this be part of the design of your application and the initial fact before the application runs?

  • Can not see all the stored procedures in the Entity Data Model Wizard

    I hope it is a simple oversight on my part I try to use the new beta version of odp.net with entity framework support. I can open the Entity Data Model Wizard, give him my information database, and I can choose various tables to use successfully. But in the list where I select the tables, views and stored procedures, the wizard does not see my stored procs or my point of view.

    Does anyone know why he would see the tables but not views or stored procedures? My procs can be found under "packages" If that makes a difference. I tried to create a fictional stored procedure at the level above the title of 'procedures', but it is unclear whether.

    Is it possible for me to debug this from here? The log files, I could watch that would help me?

    Thank you
    Jim

    I belive your Oracle database 10 g such as 9iR2 predates.
    ODP/EF Beta does not list the stored procedures or functions when connect you to a database Oracle 10 g before.

    Readme.txt:
    4. the procedures are not compatible with the DB 9.2.
    Thus, there is no stored procedure listed by the EDM Wizard for 9.2 DBs.

  • Stored procedure, unlike the tables, not in recyclebin, why?

    Hi, I have found that when I drop a stored procedure, it won't go in recyclebin but be permanently deleted.
    Why is this? Why not put recyclebin as table, in case he wants to return?

    My version of db is 10 gr 2.

    Thank you

    Perhaps because a stored procedure does not have its own physical segment but is stored with other PL/SQL objects in the dictionary table
    and note that this trash is also not enabled for SYS objects.

  • For loop stored procedure does not

    Hello

    I wrote a stored procedure that does not work (I mean do not display data)
    I set serveroutput on option also.
    If I run as a single SQL query its working very well. so please help

    create or replace procedure show_empnos (p_deptno number)
    is
    emp_id emp. EMP_ID % TYPE;
    cursor cur_emps is
    Select emp_id emp where department_id = '12';
    Start
    for a cur_emps in
    loop
    dbms_output.put_line (emp_id);
    end loop;
    end;


    See, when I ran that a single SQL interrogate data dosplayed

    SQL > select emp_id from emp where department_id = '12';

    EMP_ID
    ----------
    * 101 *.
    * 101 *.
    * 101 *.

    Help, please.

    You declare a local variable EMP_ID you initialize ever, so it will always be NULL.
    In your cursor, you also select a column EMP_ID.

    The line

    dbms_output.put_line(emp_id);
    

    solve the use of uninitialized local variable and then print a NULL value (which would appear as a blank line in the output). Assuming you want to return the value of the column EMP_ID your cursor, you need

    dbms_output.put_line(a.emp_id);
    

    As a general approach, including local variables whose names match exactly in the name of a column will create problems on the line where you write the code assumes that you speak for column only to discover that the identifier is resolved to the local variable instead. If you need a local variable to store the EMP_ID, therefore, it would make much more sense to declare it as

    l_emp_id emp.EMP_ID%TYPE;
    

    While it is not accidentally get confused with the name of the column.

    Finally, if department_id is a NUMBER, it should be compared to a number, not a string, i.e.

    WHERE department_id = 12
    

    Justin

  • Problem: Not sufficient privileges execution of stored procedure in a package

    I am using Visual Studio 2008 Team Suite, ODT with ODAC 111.07.20 and I am trying to run a procedure stored within a packet, it displays the following error message:

    Oracle.DataAccess.Client.OracleException: ORA-01031: insufficient privileges
    ORA-06512: at & quot; KIKO. PACK_SP & quot; line 205
    ORA-06512: at line 1
    at Oracle.DataAccess.Client.OracleException.HandleErrorHelper (Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx * pOpoSqlValCtx, ByVal src, String, Boolean Bcheck procedure)
    at Oracle.DataAccess.Client.OracleException.HandleError (Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx * pOpoSqlValCtx, ByVal src, Boolean Bcheck)
    at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery)
    at SqlOracleWebService.OracleReplicationTool.GetData (String strNameServer, String strNameDatabase, String strNameTable, String strNameStoreProcedure, String strUserId, String strPassword, intSince, intUntil, Int32 intPort, string strID Int64 Int64) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Oracle\OracleReplicationTool.vb:line 1171
    at SqlOracleWebService.OracleReplicationTool.SmallDataInit (String strNameServerSource, String strNameDatabaseSource, String strNameServerDestiny, String strNameDatabaseDestiny, String strNameTable, String strUserIdSource, String strPasswordSource, String strUserIdDestiny, String strPasswordDestiny, Int32 intPortSource, Int32 intPortDestiny) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Oracle\OracleReplicationTool.vb:line 614
    at SqlOracleWebService.OracleReplicationTool.ReplicationDataInit (Boolean boolBothDirections, String strNameServerSource, String strNameDatabaseSource, String strNameServerDestiny, String strNameDatabaseDestiny, String strNameTable, String strUserIdSource, String strPasswordSource, String strUserIdDestiny, String strPasswordDestiny, Int32 intPortSource, Int32 intPortDestiny) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Oracle\OracleReplicationTool.vb:line 28
    at SqlOracleWebService.Service1.Oracle_ReplicationDataInit (Boolean boolBothDirections, String strNameServerSource, String strNameDatabaseSource, String strNameServerDestiny, String strNameDatabaseDestiny, String strNameTable, String strUserIdSource, String strPasswordSource, String strUserIdDestiny, String strPasswordDestiny, Int32 intPortSource, Int32 intPortDestiny) in C:\Documents and Settings\kiko\Desktop\kiko\SQL-ORACLE\SqlOracleWebService\SqlOracleWebService\Service1.asmx.vb:line 20

    I have change the execute privileges and granted to the user KIKO execute the PACK_SP package, but it does not work. Could you help me?

    Thanks in advance.

    Published by: user9112176 on February 8, 2010 10:27

    This behavior is probably not related to the ODP and will happen when you run the same procedure as the same user of SQLPlus directly for example, so the PLSQL forum is probably a more appropriate place for assistance.

    What is 'KIKO. PACK_SP', line 205? Roles are disabled inside stored procedures, so you must have the permissions that are granted directly.

    It will be useful,
    Greg

  • Using the stored procedure: Source does not have a target executable

    I'm a guy from MS - SQL, so I'm fairly familiar with T - SQL syntax, but feels a heck of a time trying to take the code I wrote for SQL and turn this works with Oracle.

    in any case, I'm using Oracle SQL Developer, and I have a stored procedure that calls the Alter Table statement and adds a column. Just trying to get this one to work before moving on to the other that I have. I get the message that source does not have a target executable when I try to run this command.

    create or replace PROCEDURE rta_conv_addcolumn (rtatablename1 in varchar (20),)
    rtatablename2 in varchar (20),
    rtacolumnname in varchar (256),
    rtacolumninfo in varchar (256))
    AS
    DECLARE rtasql VARCHAR (4000);
    BEGIN
    IF EXISTS (SELECT * from user_tables WHERE table_name = rtatablename1)
    AND NOT EXISTS (SELECT * from user_tab_columns WHERE column_name = rtacolumnname)
    AND table_name = rtatablename1)
    AND NOT EXISTS (SELECT * from user_tab_columns WHERE column_name = rtacolumnname)
    AND table_name = rtatablename2)
    Then rtasql: = ' ALTER TABLE ["+ rtatablename2 +"] ADD "+ rtacolumnname +" "+ rtacolumninfo;
    Run (rtasql);
    END rta_conv_addcolumn;

    If I try to compile I get the following messages, which make no sense, since the syntax I use to declare the input variables seems to be good.

    Error (1.54): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (2.29): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (3.29): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (4.29): PLS-00103: encountered the symbol "(" quand attend une deles de valeurs suivantes:: =.), @ default % of the characters of the symbol ': = ' has been replaced by "(" pour continuer.)
    Error (6.1): PLS-00103: encountered the symbol "DECLARE" when expecting one of the following: begin function package pragma procedure < an ID > subtype type use < a between double quote delimited identifiers of > form current cursor external language the symbol 'start' is substituted for 'SAID' continue.
    Error (15.5): PLS-00103: encountered the symbol "RTA_CONV_ADDCOLUMN" when expects it one of the following values: If

    Adds the column to the table specified in rtatablename1, if there is neither rtatablename1 nor rtatablename2.

    NOT TESTED

    create or replace PROCEDURE rta_conv_addcolumn(rtatablename1 in varchar,
    rtatablename2 in varchar,
    rtacolumnname in varchar,
    rtacolumninfo in varchar)
    AS
    rtasql VARCHAR(4000);
    count1 number;
    count2 number;
    count3 number;
    BEGIN
      SELECT count(*) into count1 FROM user_tables WHERE table_name = rtatablename1;
      SELECT count(*) into count2 FROM user_tab_columns WHERE column_name = rtacolumnname AND table_name = rtatablename1;
      SELECT count(*) into count3 FROM user_tab_columns WHERE column_name = rtacolumnname AND table_name = rtatablename2;
      IF count1>0 AND count2 = 0 AND count3=0 Then
        rtasql:= 'ALTER TABLE '|| rtatablename1 ||'ADD ' || rtacolumnname || ' ' || rtacolumninfo;
        Execute immediate rtasql;
      END IF;
    END rta_conv_addcolumn;
    /
    

    Max

    Published by: Massimo Ruocchio, December 12, 2009 02:15
    Missing AND

  • BPEL does not receive "return value" of MS SQL, stored procedure

    Hello

    We are facing this problem citing a MS SQL stored procedure the BPEL (jdbc 1.2 driver). We have created the wsdl for the stored procedure correctly using a command line utility tool provided with Oracle SOA Suite.
    But the question is THAT BPEL is not able to get the data present in the statement of "return" of the procedure. We receive null output. But it is able to extract the data from the output variable, if any. Case 1 below is for the return statement. Case 2 is for the output variable


    Case 1: in the following, the output is returned using the return statement. The BPEL that calls this procedure is to obtain a NULL value as an answer to this.


    ALTER PROCEDURE [dbo]. [AddNumbersRet]
    -Add the parameters for the procedure
    @Number1 int,
    @Number2 int
    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    Return (@Number1 + @Number2);
    END

    Case 2: in the following, the output is returned using the SumOfNums output variable. The BPEL that calls this procedure is to obtain a correct answer.


    ALTER PROCEDURE [dbo]. [AddNumbers]
    @Number1 int,
    @Number2 int,
    @SumOfNums int output
    AS
    BEGIN

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

    Set @SumOfNums = (@Number1 + @Number2);

    END



    Case 1 is a failure and case 2 is successful. We cannot change our procedures similar to case 1 to use variables of output because of dependencies on other applications.

    All the world is facing this problem? This looks like a bug in BPEL. Please, share your experiences.


    Thanks and greetings

    Mohan

    Published by: user10980910 on December 8, 2009 05:16

    There is a gap in the command line utility that was addressed in the adapter configuration (AS11gR1) Wizard. The API is a procedure, not a function, so does not return the query for the parameters that the utility made anything for the RETURN statement.

    The adapter configuration wizard is unable to say if there is a RETURN statement either, but it provides the user with a check box that can be used to indicate the presence of the declaration. In the wizard, if you check the checkbox, a parameter is added to the XSD to the RETURN statement. In essence, the adapter will process the procedure as a function and you will get the value of the PERFORMANCE.

    Usually, I wish to indicate that you certainly should NOT change the generated XSD. But you might be able to do it, by adding the necessary element to the OutputParameters for your RETURN statement. Add the following immediately AFTER the element of 'Lines', which occurs first in the XSD and BEFORE all items for the other none.

    Use a value for the "" that is meaningful to you. The wizard uses the name of the stored procedure with the name of the element. We could call this "RETURN_VALUE" or else if is more to your liking. Add the item after you generate the XSD using the command line utility, and then use the XSD when you model your BPEL processes. The WSDL should already have the content for this element handling.

  • Basic stored procedure helps - not the return data

    Hi all:

    To be fair, I come from a SQL Server environment and have never written anything for PL/SQL / Oracle before, this is my first attempt, so if nothing is better or more effective, please let me know. The immediate problem I'm having is, I have the following stored procedure, and all I want to do is return the data in the table, so that I can fill my DataSet in code. But when I run the code against this stored procedure, it still don't bring back any data (if I just do a standard "SELECT * FROM lkAllocation", I get the results, so I know data are there and the connection is good). If execution of the procedure in my window in Oracle SQL Developer (call PAYSOL.spallocationselectall ();), my results displays no data as well. What is the problem with this stored procedure?


    create or replace
    PROCEDURE spAllocationSelectAll IS
    Whole AllocationID;
    AllocationName Varchar2 (50);

    BEGIN
    AllocationID: = 0;
    AllocationName: = ";

    SELECT
    AllocationID,
    AllocationName
    IN
    AllocationID,
    AllocationName
    Of
    lkAllocation
    ORDER BY
    AllocationName;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHILE OTHERS THEN
    -Consider recording the error and then re-raise
    LIFT;
    END spAllocationSelectAll;

    Well, I'm not really in .net (I would participate in another forum so ;)), but this might be useful?

    Value (Oracle.DataAccess.Types)      System.Data.DbType      OracleDbType
    OracleRefCursor      Object      RefCursor
    

    http://download.Oracle.com/docs/CD/B19306_01/win.102/b14307/featOraCommand.htm#g1025379
    http://download.Oracle.com/docs/CD/B19306_01/win.102/b14307/featOraCommand.htm#g1025072

    Perhaps the [forum Windows and .net | http://forums.oracle.com/forums/category.jspa?categoryID=44] is worth a try as well.

  • 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

Maybe you are looking for

  • I need to update my Safari browser, help!

    I have a desktop gateway PC running Windows 8.1. I need to update my version of Safari, because there are things that I can't do until I update my Safari browser. Currently I have 5.1.7. Whenever I have download what I think, it's a version update al

  • Password problem

    The password I use for Itunes allows access to icloud and vica versa or if it is set to diiferently. IE icloud password access to icloud and itunes password access to itunes. Because I forgot and several email addresses do not help.

  • Beta don't provide feedback.

    When I use the feedback button, I'm headed to a Firefox site telling me that I need to improve before I can provide feedback. The following link shows FFBeta is installed and I can't download anything by the download button. I have a lot of comments.

  • My new Apple TV 4 is extremely slow compared to my old Apple TV 3. Same router but worse performance. Can anyone help. Thank you.

    My new Apple TV 4 is extremely slow compared to my old Apple TV 3. Same router but worse performance. Can anyone help. Thank you.

  • FFT 1 d 2D spectral data with GPU Analysis Toolkit

    Hello world I'm trying to implement a parallel my data 2D fourier transformation using the GPU analysis tool. Given that I've never used this tool, I tried first to implement a simple transformed of Fourier of a simple real signal to an output comple