Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Maintain: Reading a specific record

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Maintain: Reading a specific record
 Login/Join
 
Member
posted
Hello, Everyone.

My SQL table has an identity (auto-number) field that has been set up as a key.

Once I've included the new record to the table from my Maintain procedure, is there a way to efficiently pull back the value of the new identity so I can populate it into other tables? I've been able to pull all records back from the table into a stack, sort it 'by highest', and then pull the first record, but as my table grows I don't see this working efficiently.

Any suggestions would be appreciated.


Kelly
WF 7.6.6, Win 2K3 SP2, Tomcat
 
Posts: 19 | Location: SLC, UT | Registered: January 19, 2007Report This Post
Master
posted Hide Post
Kelly
Any chance of using a second key field that you can control and keep as unique? This way you could query THAT key instead of the dynamically incremended one.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
It's possible but seems like quite a lot of overhead. Where the table I'm needing to update is going to have thousands of records, I would at some point have to load in all the unique values I control anyway to ensure that the next is unique.

Using the following SQL, it does return the last identity created: SELECT IDENT_CURRENT('tablename')

Perhaps there is a way to pass this SQL directly from Maintain and store the result in a variable?


Kelly
WF 7.6.6, Win 2K3 SP2, Tomcat
 
Posts: 19 | Location: SLC, UT | Registered: January 19, 2007Report This Post
Virtuoso
posted Hide Post
Kelly

Could you use SYS_MGR, I've never used it, but there may be something in there, look at your 761 course or help for the syntax.

Otherwise, why not EXEC a focexec with your SQL in and return the answer into a stack. I have often found that quicker when retrieving single values for a known index, or similar circumstances.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Member
posted Hide Post
Good idea, Alan. I'll give it a shot. I'll let you know the results.


Kelly
WF 7.6.6, Win 2K3 SP2, Tomcat
 
Posts: 19 | Location: SLC, UT | Registered: January 19, 2007Report This Post
Virtuoso
posted Hide Post
Kelly

It occurred to me that if this is a multi-user system, the approach is flawed.

If a second user adds an item before you retrieve the ident_current then your data will be out of line. You will need to ensure that the value you retrieve belongs to the correct user not someone else.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
As far as I know SYSMGR will not return values just error codes, successful or not.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Alan,

A couple of things: 1) pulling the 'ident_current' via a WF procedure worked just fine. I never could get the sys_mgr working correctly. 2) You're absolutely correct about the multi-user system. For part of this app it should be ok, for another part I will be accomodating for this and using a different unique identifier. I appreciate the thought.


Kelly
WF 7.6.6, Win 2K3 SP2, Tomcat
 
Posts: 19 | Location: SLC, UT | Registered: January 19, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Maintain: Reading a specific record

Copyright © 1996-2020 Information Builders