Solved

How to pause and resume retrieve in PowerBuilder9

Posted on 2004-10-25
1,070 Views
Last Modified: 2013-12-26
Hi,

We have a problem of retrieving huge amount of rows from database ( Oracle 8i ) with PowerBuilder 9.
What we need to do is to first retrieve a batch of rows, e.g 2000 first rows and then ask from user whether to continue retrieving (in case there is more to retrieve) or not.

However after that guestion, resuming retrieve crashes the application. With PowerBuilder 7 there was never this problem.

Code is placed in user objects retrieverow -event.

Thanks in advance,
JT
0
Question by:Yenny1
    7 Comments
     
    LVL 33

    Expert Comment

    by:sajuks
    Are you working with the latest patch of powerbuilder ? Whats your current version?
    to download the patches one of the experts diasroshan has given some precise steps:

    Go to http://www.sybase.com
    ---> go to the download option
    ---> in the download page there is a link EBFs/Maintenance
    ---> u will be asked to register once u go to that link....
    ---> register onto sybase(this will help in future)
    ---> there will be a selection of time frame...select 'all'
    ---> now when u search u will find build  PowerBuilder 9.0.1 (7275) EBF Release
    ---> Download it
    Install this patch .
    0
     
    LVL 33

    Expert Comment

    by:sajuks

    Have you tried using retrieveasneeded ( note it wont work if you've sort or filter).
    0
     

    Author Comment

    by:Yenny1
    Unfortunately RetrieveAsNeeded didn't work out.

    The actual error which occurs is this, in case this tells more:

    Database error code:  999
    Database error message:
    Select error: Only cancel command is allowed when the rows are pending.
    0
     
    LVL 33

    Accepted Solution

    by:
    Did you update to the latest patch ? that didnt work ?

    Have you got any more selects ?If yes then you need to create a second transaction
    object as an instance variable, connect it to thedatabase, and use it for those other retrieves.


    0
     
    LVL 5

    Expert Comment

    by:michaelstoffel
    You could retrieve in batches, just appending to the datawindow result set instead of overwriting.  Pass in the range of records to retrieve as additional parameters and use rowid to limit the result set.  To append data return a 2 from the retrievestart event of the datawindow.  That way you avoid the retrieverow event with its performance hits.  What is the user realistically going to do with thousands of rows in a UI?

    Mike
    0
     

    Author Comment

    by:Yenny1
    Thanks sajuks!

    It seems this error occured because there was other select  running ( asking question was retrieved from database ).

    Patch didn't help.

    JT
    0
     
    LVL 33

    Expert Comment

    by:sajuks
    If my answer worked then why a C ? Please re-grade
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now