Retrieve/o when primary keys aren't known | Uniface Development | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

—  Results per page  —








— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters
For a group of consecutive words like 'end of support' use Match phrase

sp_Feed Topic RSS sp_TopicIcon
Retrieve/o when primary keys aren't known
21 Nov 2017
2:05 pm
Avatar
Joanne Roberson
Member
Forum Posts: 11
Member Since:
24 Jan 2017
sp_UserOfflineSmall Offline

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

21 Nov 2017
3:28 pm
Avatar
Iain Sharp
Member
Forum Posts: 623
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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). 

21 Nov 2017
6:14 pm
Avatar
Iain Sharp
Member
Forum Posts: 623
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Although that will add records from the database to the hitlist. We’ve not found a good answer to retrieve/o, no. 

21 Nov 2017
7:14 pm
Avatar
gianni
Member
Forum Posts: 264
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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

22 Nov 2017
10:09 am
Avatar
Iain Sharp
Member
Forum Posts: 623
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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. 

22 Nov 2017
11:33 am
Avatar
Arjen van Vliet
Member
Forum Posts: 170
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 131

Currently Online: Amarildo Ribeiro, Henk van der Veer
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ulrich-merkel: 1710

Iain Sharp: 623

Theo Neeskens: 345

gianni: 264

rogerw: 232

istiller: 201

lalitpct: 197

Knut: 179

-GHAN-: 171

Arjen van Vliet: 170

Member Stats:

Guest Posters: 3

Members: 7038

Moderators: 0

Admins: 8

Forum Stats:

Groups: 1

Forums: 62

Topics: 2058

Posts: 8862

Newest Members:

Arabellaquife, ArthurEffit, RubenKip, MarinaGOVunse, Olpbtsj, Richardglums, Hellbladequife, RobertCab, Kcrdhlq, Kennethsherm

Administrators: admin: 23, Adrian Gosbell: 286, diseli: 836, Bob Maier: 3, Nico Peereboom: 65, Michael Rabone: 4, richiet: 406, JanCees: 28