Return Results in 64k chunks?

  • Hi all

    Sorry for the cryptic topic, wasn't sure how to word it.

    Basically I need to write a procedure which returns the results to an application. However the applications has been limited to only accept/read 64k worth of data at a time.

    Therefore I need to break my resultset down in 64k chunks. Then return the first chunk, then the 2nd, 3rd, 4th etc.

    My question is how do I determine which rows fall into the 64k limit and how do I know where the next chunk/row will begin.

    The datatypes are all integers.

    Thx


    John Mac Pherson
    Database Administrator
    Optimal Information Systems Pty (Ltd)
    jmacpherson@ois.co.za

  • Since all datatypes are integers and one integer will take 4 bytes.

    Suppose u have 10 columns in resultset then one row will take 40 bytes and by  64*1024/40 = No. of row counts  in any resultset by ur output ...  

     

    Hope this would help u..

    Amit Choudhary

  • Thanks for the suggestion Amit.

    Turns out to be miscommunication between app developers and myself. The 64k limit affects the amount of data they can move between servers via their app.

    The actual sql side of things has been sorted with a top statement and passing in last unique identifier to proc.

    Thanks again for your time

    Regards

    John


    John Mac Pherson
    Database Administrator
    Optimal Information Systems Pty (Ltd)
    jmacpherson@ois.co.za

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply