Already unlocked mutex gets unlocked again when locks are exhausted

The current (4.7.25) implementation of error handling in __lock_get_internal suffers from a deficiency described below (visible in DIAGNOSTIC mode only though).
Consider the current error-exit cleanup code (lock.c, line 1019):
err:     if (!LF_ISSET(DB_LOCK_UPGRADE | DB_LOCK_SWITCH))
          LOCK_INIT(*lock);
done:     if (newl != NULL &&
     (t_ret = __lock_freelock(lt, newl, sh_locker,
     DB_LOCK_FREE | DB_LOCK_UNLINK)) != 0 && ret == 0)
          ret = t_ret;
     OBJECT_UNLOCK(lt, region, ndx);
     return (ret);
The OBJECT_UNLOCK tries to unconditionally unlock the previously locked partition mutex. Unfortunately this mutex is not always locked.
Initially, when trying to lock, a partition mutex is correctly locked (lock.c, line 585):
          /* Allocate a shared memory new object. */
          OBJECT_LOCK(lt, region, obj, lock->ndx);
          ndx = lock->ndx;
          if ((ret = __lock_getobj(lt, obj, lock->ndx, 1, &sh_obj)) != 0)
               goto err;
But, when a new lock is allocated, the following code is used (lock.c, line 758):
          part_id = LOCK_PART(region, ndx);
          /* Allocate a new lock. */
          if ((newl = SH_TAILQ_FIRST(
          &FREE_LOCKS(lt, part_id), __db_lock)) == NULL) {
               if ((ret = __lock_alloclock(lt, part_id)) != 0)
                    goto err;
               /* Dropped the mutex start over. */
               goto again;
This one calls __lock_alloclock that MAY (but does not always do, see the partition size check, lock.c, line 477) unlock the current partition mutex.
So, when locks/partitions are exhausted in DIAGNOSTIC mode, the failure leads to an environment DB_RUNRECOVERY panic instead of a simple ENOSPC being returned. I cannot say if this does any harm in non-DIAGNOSTIC mode, but I think that unlocking the same mutex twice won't do any good.
Thanks for your attention.

Thank you for your reply.
Yes, I considered myself that relocking mutex back is the easiest solution, but did not bother implementing it since the problem arises only when locks are exhausted which is a showstopper by itself.
As for my case, I just increased locks and lock objects limit tenfold (its okay since I delete several thousands of records via one transactional cursor and this isn't used in a production application, more of a test), so even DIAGNOSTIC build works properly.
Also, I think I have a small suggestion not related to the original topic. When upgrading to 4.7.25 from 4.5.20, I was very happy to discover that environments (region structures I think) are now properly distinguished between platforms (different binary layouts, probably a hash of some internal data or structure size check), so the x64 binary trying to open x86-created environment (or vice versa) doesn't just crash with an assert or an access violation (yes, I run BDB on Win32/Win64 and happy with it) -- it checks some sort of region structure hash and bails out with proper error message about incompatibility.
Unfortunately, the DIAGNOSTIC vs non-DIAGNOSTIC builds still suffer from the aforementioned problem -- they crash/assert when opening incompatible environments (i.e. DIAGNOSTIC environment tries to open non-DIAGNOSTIC one or vice versa). I fully understand that different builds are not intended to be binary compatible, but adding something like you did for region structures to differentiate DIAGNOSTIC and non-DIAGNOSTIC environment formats would be a very good idea.
Thank you for your time.
Message was edited by:
onyXMaster

Similar Messages

  • My tel Goes after 10 minutes offline, apears à enige Apple, and i have to unlock again. People are not able to call me while THE Apple apears. Question what can be THE solution ?? It is à 3GS tel iOS 4.2.1

    My tel Goes after 10 minutes offline, apears à enige Apple, and i have to unlock again. People are not able to call me while THE Apple apears. Question what can be THE solution ?? It is à 3GS tel iOS 4.2.1

    Hi Richard,
    You mentioned that 'Apple put the AirPrint spec out there for all printer makers'. I've been looking around but I haven't found any spec. Where did you find it?
    Do printer makers have to buy a license in order to be able to advertise that they've implemented the AirPrint protocol? Is there maybe an Apple review process in place?
    TIA
    Geert

  • My tel Goes after 10 minutes offline, apears à white Apple, and i have to unlock again. People are not able to call me while THE Apple apears. Question what can be THE solution ?? It is à 3GS tel iOS 4.2.1

    My tel Goes after 10 minutes offline, apears à white Apple, and i have to unlock again. People are not able to call me while THE Apple apears. Question what can be THE solution ?? It is à 3GS tel iOS 4.2.1

    Hi Richard,
    You mentioned that 'Apple put the AirPrint spec out there for all printer makers'. I've been looking around but I haven't found any spec. Where did you find it?
    Do printer makers have to buy a license in order to be able to advertise that they've implemented the AirPrint protocol? Is there maybe an Apple review process in place?
    TIA
    Geert

  • Will re-install of System Solve "Getting "try again" when installing..."

    Have yet to solve "Getting "try again" when installing software..." posted yesterday. Also note inability to perform Safe Boot. Will re-installation of System software (Tiger) restore the functions lost?
    If I'm obliged to do this, any tips on how to: 1) preserve my Internet settings, including Bookmarks; 2)saved (not yet deleted) emails; and (3) my Address book? Where are they? how do I identify these files? Can I do some sort of backup before I go to Install?

    For the convenience of others, here is the list to the other topic:
    http://discussions.apple.com/message.jspa?messageID=9414774#9414774
    The basic problem appears to be disk directory corruption. It is very unlikely reinstalling the OS will cure that since you also appear to want to preserve all your files. In fact, reinstalling the OS might create more damage to your files since the computer has lost track of some of them and might just overwrite them not knowing they are there.
    You either need to try to repair the directory using Diskwarrior (since DU apparently failed), or you need to wipe the drive (and all your files) then reinstall your OS. If doing the second option you should, of course, back up your data files first. However I can't help but feel when people mention backing up a damaged directory that your backups may be incomplete since, again, the computer has lost track of some parts of the files and may not make a complete copy. If I was in your situation, and could afford it, I'd go for getting a copy of Diskwarrior so you can actually repair your drive. If I couldn't afford it I would back up my data files, wipe the drive, then reinstall everything again from scratch, then copy the data files back on and keep my fingers crossed that none of them was part of the corruption.

  • Why does the IPhone 4 get really hot, when you are making a phone call??

    I can't seem to find the answer to this riddle . why does the iPhone 4 get really hot when you are making phone calls or when using face Time ??

    It doesn't.
    There must be an issue with your iphone.
    Have you tried reset?  Restore?
    Have you made an appointment at the genius bar to have them look at it?

  • Why the oldest recorded track get recorded again when making new track?

    1. I play my guitar and record it (track1)
    2. I play track1 and recording my vocal
    3. The track1 get recorded again on my vocal track
    How to set off that? So i dont have double sound of the oldest track on the new track

    Kaibe008 wrote:
    3. The track1 get recorded again on my vocal track
    How to set off that?
    use headphones

  • Getting "try again" when installing software

    I'm suspecting problem originated when installing (unsuccessfully) update MS Office; all was good before that. When reinstalling, gets to "installing files" then stalls, saying 'try again'. Also tried new installation of iWork, not previously installed. Same thing.
    Tried Safe Boot and computer "went dark" and crashed. +Disk Utility+ confirms problems (e.g., "incorrect number of thread records") but cannot complete either permissions evaluation/repair or disk evaluation/repair.
    Computer's "working" but I need to restore my copy of Office and other software as well. Help!

    Boot from your install disk by holding down the c key. Get past the language screen and choose Disk Utility from the menu bar and hit the First Aid button. Highlight your volume in the left panel and then hit Repair Disk. If their are unrepaired errors then run again. If DU can't repair your disk then you will need a repair utility such as DiskWarrior.
    http://www.alsoft.com/DiskWarrior/index.html

  • Problem getting from server when there are large attachments

    Hello,
    Using mail I have problems downloading pop mail from the server if there are messages with "large" (10MB) attachments. To solve the problem I have to login via webmail and delete the messages,. This has happened twice already. Using outlook via windows I have no such problems.
    During these blocks no mail gets through, it's like the mail app does not see mail on the server.
    Any solutions?
    Thank you,
    Fred

    "String to IP" can be configured to return multiple (all) addresses. Just right-click the primitive and select "Multiple Output". You can then use IP to String to get the IP addresses in a more readable form.
    To know which of the 2 is the connection to your server you need to have some knowledge. If you know it starts with "10." you can just pick the IP address that matches this pattern.

  • How do you go about getting charges reversed when you are double billed?

    The first download didn't work so I downloaded a second time and was charged twice.  This doesn't usually happen but I loaded a whole album rather than specific cuts and was charged double.  Is there an address you can send particulars?  Frustrating trying the phone nonsense.
    gs

    http://www.apple.com/support/contact/

  • HT5622 i lsot all my contact when i update new version .can i get it again?

    i lost all my contact when i update new version .can i get it again?

    Contacts are designed to be synced to a supported application on the computer or a cloud service.
    Simply sync them back.

  • Does The Query get Fired Again

    Does the query get fired again when i query a existing view
    1. create view abc as select name from Table
    2. select name from abc
    Table is a really large table wid many columns and many rows
    Lookin for a better performance coz i need names in one procedure and again need the same names for deletion in another procedure
    I dont want to fire the same query twice dats y.

    > there are like 20000 rows out of wch i need 2 retrieve 9000 or 10000 rows dependin on
    the constraints
    Go slow on the I'M SPEAK please... much better to deal with technical issues when using proper English.
    A 20,000 rows table is tiny and running a SQL that returns 10,000 or so rows, should be execute in seconds.. the slowest part of the operation should be shipping that 10,000 rows to the client (across the network) in case of a remote client.
    Maybe if you can describe the physical structure of the table (heap, index, partitioned?) and pinpoint just where the performance problem is (execution plan or an SQL*Plus autotrace), we could comment on why the performance seems (or maybe truly is) slow.

  • IW52 + Get link data  when stored via 'Store the business document'

    Hi,
    For  Notification change - IW52:
    FM BDS_GOS_CONNECTIONS_GET is used to get the information when attachment are stored via 'Create attachment' .
    CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
        EXPORTING
          classname             =  'BUS2080'
          objkey                   =  The notification number
        TABLES
          gos_connections          = w_connections
    EXCEPTIONS
       NO_OBJECTS_FOUND         = 1
       INTERNAL_ERROR           = 2
       INTERNAL_GOS_ERROR       = 3
      OTHERS                   = 4.
    Can any one please let me know FM or Method that should be used to retrieve the link data when attachment are stored via 'Store the business document'.?
    Regards,
    Himanshu

    Hi,
    Try with FM ARCHIVOBJECT_GET_URI or ARCHIV_GET_CONNECTIONS. With this FM you get the business documents attached to an object. You have to fill the object type and the object id.
    Regards,
    Edited by: Jose Vaquero Polonio on Jan 5, 2011 10:42 AM

  • Getting Error:500 when trying to "Reset Client" Under setting tab in Mobile

    Hi All,
    We are getting following error when we are trying to Reset Client Under settings tab in the Mobile Device.
    Anyhelp would be highly appreciated.
    Client Details: MI70 SP15 0
    Application: MAM LAPTOP3.0 with SR04.
    DB2e: 9.1.2.
    Error: 500
    Location: /me/servlet/com.sap.ip.me.apps.jsp.ControllerServlet
    Internal Servlet Error:
    java.lang.RuntimeException: nested transaction not supported by TransactionManager
         at com.sap.ip.me.persist.core.IPersistenceManagerTXWrapper.beginTransaction(IPersistenceManagerTXWrapper.java:183)
         at com.sap.ip.me.smartsync.persadp.Transaction.beginTransaction(Transaction.java:69)
         at com.sap.ip.me.smartsync.persadp.PersistenceAdapterImpl.beginTransaction(PersistenceAdapterImpl.java:197)
         at com.sap.ip.me.smartsync.persadp.PersistenceAdapterImpl.beginTransaction(PersistenceAdapterImpl.java:130)
         at com.sap.ip.me.core.ResetClientData.performReset(ResetClientData.java:119)
         at com.sap.ip.me.apps.jsp.ControllerServlet.doHandleEvent(ControllerServlet.java:128)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetNotThreadSafe(AbstractMEHttpServlet.java:347)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:689)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doPost(AbstractMEHttpServlet.java:706)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:313)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:534)
    Regards,
    Ameer.

    Hi Alberto,
    I have thought that you are also in NW70.Thats why I have mentioned that note.
    Now correct SAP note for you is 1163707.
    Regards,
    Ameer Baba.

  • Getting ORA-01403:, when it shouldn't

    Greetings, i apologize beforehand for my spelling, name(takes 6 hours to change) and the headache you migth get, however,
    i bring you the following code, and test results:
    ------Procedure wich throws the error-------
    create or replace
    procedure P_COLEGAS(x in number) as
    ctipo varchar2(20);
    asd varchar2(20);
    cursor curnombre is
    select nombre from unidad,elemento where (elemento.id_elem=unidad.id_elem and unidad.tipo=ctipo and elemento.ciudad=asd);
    begin
    select unidad.tipo, elemento.ciudad into ctipo,asd from unidad,elemento where unidad.id_elem=x and elemento.id_elem=x;
    for blah in curnombre loop
    DBMS_OUTPUT.PUT_LINE('nombre unidad: '||blah.nombre||' ');
    end loop;
    end;
    -what i get when executing the procedure-
    Error que empieza en la línea 1 del comando:
    exec p_colegas(19)
    Informe de error:
    ORA-01403: no data found
    ORA-06512: at "BD00.P_COLEGAS", line 9
    ORA-06512: at line 1
    01403. 00000 - "no data found"
    *Cause:
    *Action:-----------------------------------------------------------
    -----------------the real problem--------------------
    if in that procedure i were to write
    (1)
    select unidad.tipo into ctipo from unidad where unidad.id_elem=x;(2)
    select elemento.ciudad into asd from elemento where elemento.id_elem=x;instead the single query i wrote, we get the following:
    (1) works wonderfull, only gets the error when there are no matches for x.
    (2) throws the error i showed before.
    however when i do the following query in the worksheet and execute it:
    (3)
    select elemento.ciudad from elemento where elemento.id_elem=x;i get what i expected to get 1 row 1 column.(yes it has data)
    note: in (3) the only difference is that i remove the into clause, and x is the same number i used when i execute the procedure.
    --------------------the question------------------------
    why in the procedure, the query (2) fail to fetch the data, the same data wich the query(3) does not fail to fetch?
    i'm getting ORA-01403, when i shouldn't?
    is there a work around to this problem?
    --------------------what i try------------------------------
    nested the query with it's own error handle exception, getting the same results, just catches the error with a different handling.
    tool used: sql developer
    -Example data--
    tested the procedure with the following example data in a brand new workspace getting the same error.
    --  DDL for Table ELEMENTO
      CREATE TABLE "ELEMENTO"
       (     "ID_ELEM" NUMBER,
         "CIUDAD" VARCHAR2(20),
         "TIPO" CHAR(1),
         "X" NUMBER,
         "Y" NUMBER,
         "FECHAHORA_CREACION" TIMESTAMP (6)
    --  DDL for Table UNIDAD
      CREATE TABLE "UNIDAD"
       (     "ID_ELEM" NUMBER,
         "PORCENTAJE_SALUD" NUMBER,
         "NOMBRE" VARCHAR2(20),
         "TIPO" VARCHAR2(20)
    REM INSERTING into ELEMENTO
    SET DEFINE OFF;
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (12,'Infernalia','U',10,10,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (15,'Infernalia','U',10,7,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (19,'Infernalia','U',15,9,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (23,'Infernalia','U',16,8,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (27,'Infernalia','C',15,10,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (52,'Humania','U',26,10,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (58,'Humania','U',24,9,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (62,'Humania','U',27,11,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (64,'Humania','C',25,8,to_timestamp('22-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (78,'GruntVille','U',47,32,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (84,'GruntVille','U',42,28,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (89,'GruntVille','U',43,29,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (91,'GruntVille','C',44,37,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (29,'Infernalia','C',16,7,to_timestamp('12-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into ELEMENTO (ID_ELEM,CIUDAD,TIPO,X,Y,FECHAHORA_CREACION) values (90,'GruntVille','U',49,36,to_timestamp('29-NOV-20 12.00.00.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    REM INSERTING into UNIDAD
    SET DEFINE OFF;
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (12,100,'Grang','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (15,100,'Krout','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (19,100,'Warf','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (23,100,'Puaj','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (52,100,'Marcelus','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (58,100,'Claudius','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (62,100,'Arturius','Obrero');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (78,100,'Klaknot','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (84,100,'Staisht','Médico');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (89,100,'Bjorkson','Soldado');
    Insert into UNIDAD (ID_ELEM,PORCENTAJE_SALUD,NOMBRE,TIPO) values (90,100,'Sknot','Médico');
    --  Constraints for Table ELEMENTO
      ALTER TABLE "ELEMENTO" ADD CONSTRAINT "ELEMENTO_CHK1_TIPO" CHECK (TIPO IN ('U', 'C')) ENABLE;
      ALTER TABLE "ELEMENTO" ADD CONSTRAINT "ELEMENTO_PK" PRIMARY KEY ("ID_ELEM") ENABLE;
      ALTER TABLE "ELEMENTO" MODIFY ("ID_ELEM" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("CIUDAD" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("TIPO" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("X" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("Y" NOT NULL ENABLE);
      ALTER TABLE "ELEMENTO" MODIFY ("FECHAHORA_CREACION" NOT NULL ENABLE);
    --  Constraints for Table UNIDAD
      ALTER TABLE "UNIDAD" MODIFY ("ID_ELEM" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" MODIFY ("PORCENTAJE_SALUD" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" MODIFY ("NOMBRE" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" MODIFY ("TIPO" NOT NULL ENABLE);
      ALTER TABLE "UNIDAD" ADD CONSTRAINT "UNIDAD_PK" PRIMARY KEY ("ID_ELEM") ENABLE;
    --  Ref Constraints for Table ELEMENTO
    --  Ref Constraints for Table UNIDAD
      ALTER TABLE "UNIDAD" ADD CONSTRAINT "UNIDAD_ELEMENTO_FK1" FOREIGN KEY ("ID_ELEM")
           REFERENCES "ELEMENTO" ("ID_ELEM") ENABLE;
    /Edited by: 975362 on 06-12-2012 04:47 AM
    Edited by: BluShadow on 06-Dec-2012 12:51
    added {noformat}{noformat} tags for readability of code/data.  Please read {message:id=9360002} and learn to do this yourself in future.
    Edited by: 975362 on 06-12-2012 05:44 AM
    added example data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Oops, I mi9ssed table ELEMENTO has column X. When you use:
    where unidad.id_elem=x and elemento.id_elem=x;column names take precedence over PL/SQL variables wnd X is resolved as table ELEMENTO column X. not as PL/SQL procedure parameter X. Change PL/SQL procedure parameter name:
    SQL> create or replace
      2  procedure P_COLEGAS(x in number) as
      3  ctipo varchar2(20);
      4  asd varchar2(20);
      5  
      6  cursor curnombre is
      7  select nombre from unidad,elemento where (elemento.id_elem=unidad.id_elem and unidad.tipo=ctipo
    and elemento.ciudad=asd);
      8  
      9  begin
    10  select unidad.tipo, elemento.ciudad into ctipo,asd from unidad,elemento where unidad.id_elem=x
    and elemento.id_elem=x;
    11  for blah in curnombre loop
    12  DBMS_OUTPUT.PUT_LINE('nombre unidad: '||blah.nombre||' ');
    13  end loop;
    14  end;
    15  /
    Procedure created.
    SQL> exec p_colegas(19)
    BEGIN p_colegas(19); END;
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "SCOTT.P_COLEGAS", line 9
    ORA-06512: at line 1
    SQL> create or replace
      2  procedure P_COLEGAS(p_x in number) as
      3  ctipo varchar2(20);
      4  asd varchar2(20);
      5  
      6  cursor curnombre is
      7  select nombre from unidad,elemento where (elemento.id_elem=unidad.id_elem and unidad.tipo=ctipo
    and elemento.ciudad=asd);
      8  
      9  begin
    10  select unidad.tipo, elemento.ciudad into ctipo,asd from unidad,elemento where unidad.id_elem=p_
    x and elemento.id_elem=p_x;
    11  for blah in curnombre loop
    12  DBMS_OUTPUT.PUT_LINE('nombre unidad: '||blah.nombre||' ');
    13  end loop;
    14  end;
    15  /
    Procedure created.
    SQL> exec p_colegas(19)
    PL/SQL procedure successfully completed.
    SQL> SY.

  • My iPad is disabled after entering many wrong passcodes by my kid, and is asking me now to connect to iTunes to get enabled again (unlocked), however when I connect to iTunes, it asks me to first unlock the iPad? what is the solution

    my iPad is disabled after entering many wrong passcodes by my kid, and is asking me now to connect to iTunes to get enabled again (unlocked), however when I connect to iTunes, it asks me to first unlock the iPad? what is the solution

    You need to place the device in recovery mode ...
    f you can't remember the Passcode, you need to restore the device from the computer it was last synced with.
    Instructions for putting the device in recovery mode > iOS: Unable to update or restore
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present

Maybe you are looking for

  • Sync iPhone 4S - Moving from XP to Windows 7 or 8

    I'm currently running iTunes on an old and decrepit tower desktop running Windows XP, syncing both my iPod (80gb Gen 5 Classic I think) and iPhone on it. I also have a newer laptop running Windows 7 Home Premium, with iTunes installed and kept up to

  • T430 brightness control question....

    It seems that no matter what Power Plan I choose.... the screen brightness goes to a very dim level while in battery mode. Even after a "Custom" plan, it forgets the desired brightness level after a re-boot. Any advice would be appriciated....  Thank

  • Work Center Creator List

    Hi Experts, How to find out Work Center Creator's list by std SAP Transaction (one by one or in mass) Regards, VNG

  • Error Under "Oracle Learning Management Administrator"- Catalog Administrat

    Hi, Under "Oracle Learning Management Administrator" reponsibility choose Catalog Administration, The following error appears: JSP Error: Request URI:/OA_HTML/OA.jsp Exception: java.lang.IllegalAccessError What's can i do? Thanks nownew

  • Best Practises and Lessons Learned

    Looking for XI best practices and lessons learned. Do we have standard best practices docs from sap?. Please send me those docs.......  [email protected] Looking for any support document for already implemented scenarios.