Retrieve/o when primary keys aren't known

Author: jroberson@canberra.com (Joanne Roberson)

Is there a way in Uniface to "re-locate" a record that has been retrieved if you do not know all of the primary keys? I have a partial key, but that doesn't seem to work. There must be some "efficient" way to go back to a record to get additional information when it is needed?   TIA

5 Comments

  1. retrieve/a will retrieve based on partial key (or non key) information, but won't necessarily limit itself to one record.  It behaves subtly differently from retrieve/x where there are no records found (retrieve/x will leave the retrieve profile record in place, retrieve/a will not). 


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  2. Although that will add records from the database to the hitlist. We've not found a good answer to retrieve/o, no. 


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  3. Hi Joanne, it could be I am not fully understanding your question: if you have retrieved it already from DBMS and supposing PK is mandatory as usual how can be possible you do NOT know the PK? Anyhow...main option could be: - saving current record content with putlistitems/occ - use "reload" instruction to reload record from dbms Other options are the ones already mentioned from Iain... Hope it helps... Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  4. I presuming the requirement is actually something like  "Set the current occurrence to the first record which matches this retrieve profile which is already loaded from the DBMS."  As such it would be useful for navigating larger hitlists already loaded. 


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  5. Joanne Roberson said Is there a way in Uniface to "re-locate" a record that has been retrieved if you do not know all of the primary keys? I have a partial key, but that doesn't seem to work. There must be some "efficient" way to go back to a record to get additional information when it is needed?   TIA  

    I'm reading your use case as: "I already retrieved a record, based on primary key, but didn't get all the fields of the records in the first transaction. In the second transaction, I want to retrieve the missing fields, based on part of the 'compound' (or 'composite') primary key (i.e. a primary key that consists of multiple fields). How can this be done in Uniface?" If my understanding of the case is correct, I'd say by not knowing the complete primary key, you would never be sure if you're retrieving the exact same record (in any programming language or SQL). Only knowing a valid alternate key (an alternativete unique key, apart from the primary key) could help here. Would it be possible for you to set your field listing of the entity to 'All fields'? That way you would be retrieving all fields of the record in your earlier transaction, only to use some of the fields later on. This would of course slightly impact the performance of your first transaction, because you're retrieving more fields.


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)