[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ulysse::rdb_vms_competition

Title:DEC Rdb against the World
Moderator:HERON::GODFRIND
Created:Fri Jun 12 1987
Last Modified:Thu Feb 23 1995
Last Successful Update:Fri Jun 06 1997
Number of topics:1348
Total number of notes:5438

612.0. "SYSBASE Transelect n from table" by HENRYY::NEWMAN_SA () Sat Apr 07 1990 01:40

    I have seen a SYBASE extension to allow SQL to select one or more
    rows of a table similar to RDO's "FOR FIRST n" syntax.
    
    I have a customer who uses both Sybase and Rdb.  The have thousands
    of free palettes in the warehouse and just want to find one of them.
     
    
    This apprears to be impossible with SQL unless you make a collection
    and then do a singleton select (which of course fails if two rows
    match the selection criteria.)
    
    Any ideas would be most appreciated.
    
    Thanks,
    Sandy Newman
    
T.RTitleUserPersonal
Name
DateLines
612.1Contact Rdb/VMS Product ManagementCOOKIE::BERENSONWords are a deadly weaponSat Apr 07 1990 01:454
they may have an interesting answer for you.

If you want a technical answer on this, I would imagine asking in the SQL or
Rdb/VMS conference would garner more interest.
612.2How About Project?BANZAI::BOOTHWhat am I?...An Oracle?Sat Apr 07 1990 23:598
    If the object is to just find one empty pallate, couldn't they do a
    PROJECT for pallete status. That would show only one instance of
    "empty". It seems like this would be an easy fix.
    
    If the object is to find a particular pallette, they need some kind of
    identifier on the rows.
    
    ---- Michael Booth
612.3FETCH on a cursor?LACKEY::HIGGSSQL is a camel in disguiseMon Apr 09 1990 17:163
You can always define a cursor, OPEN it, do a single FETCH and then close the
cursor.  Do you think this is too much overhead?  It certainly is not impossible.
Cursors (and not SELECT statements) are what you normally do in SQL programs.
612.4Sql isn't really sql if you are sybaseHENRYY::NEWMAN_SAWed May 02 1990 10:0914
    Let's assume there are 50,000 palettes that are not in use, ie free.
     Now since you really don't care which one you get, Try the open
    cursor, fetch, and then close versus Sybase Transelect set to one.
     Sybase open cursor completes as soon as the first free palette
    is found.  Rdb creates a collection of 50,000 which qualify.
    
    I will try the SQL notes file.
    
    I agree with Michael, what good are standards if you (sybase) have
    your own set.
    
    Cheers,
    Sandy
    
612.5Correction to .4WIBBIN::NOYCEBill Noyce, FORTRAN/PARALLELWed May 02 1990 15:249
    Typically, Rdb's open cursor for such a collection will also be
    quick.  Rdb does not "create a collection of 50,000" unless the
    query or retrieval strategy involve a sort (since that may mean
    the last record encountered needs to be the first one returned).
    Rather, it does enough work to get the first result, and the work
    for later results will be done as needed -- or never done if you
    close the cursor.  What Rdb/VMS *is* missing is the ability to modify
    its retrieval strategy to avoid sorting if you only need a few of
    the qualifying records.