SELECT TOP 1 equivalent on AS400

Discussion in 'ASP .Net' started by kh, Nov 15, 2004.

  1. kh

    kh Guest

    I am developing an ASP.Net app which hits an AS400 table. I have the
    following SQL statement in ASP but get a token error when I execute:

    Select TOP 1 prodmo, prodyr FROM AS400Table WHERE prprty = '11'
    AND wlprdc = 'Product'
    ORDER BY prodyr DESC, prodmo DESC

    What is the SELECT TOP sql equivalent for AS400?

    *-----------------------*
    Posted at:
    www.GroupSrv.com
    *-----------------------*
     
    kh, Nov 15, 2004
    #1
    1. Advertisements

  2. kh

    Rob T Guest

    There's a lot of SQL commands that are limited when using the odbc
    connection/client access. You may want to try and post this in the odbcnet
    newgroup. I ran into a lot of these limitations on our interface too.
    Checking through my code, I don't see any 'select top' commands....except
    where we copied the tables to a SQL server first. ;-)
     
    Rob T, Nov 23, 2004
    #2
    1. Advertisements

  3. kh

    bruce barker Guest

    in db2 its:

    Select prodmo, prodyr
    FROM AS400Table
    WHERE prprty = '11' AND wlprdc = 'Product'
    ORDER BY prodyr DESC, prodmo DESC
    Fetch First 1 Row Only


    -- bruce (sqlwork.com)


    | There's a lot of SQL commands that are limited when using the odbc
    | connection/client access. You may want to try and post this in the
    odbcnet
    | newgroup. I ran into a lot of these limitations on our interface too.
    | Checking through my code, I don't see any 'select top' commands....except
    | where we copied the tables to a SQL server first. ;-)
    |
    | | >I am developing an ASP.Net app which hits an AS400 table. I have the
    | > following SQL statement in ASP but get a token error when I execute:
    | >
    | > Select TOP 1 prodmo, prodyr FROM AS400Table WHERE prprty = '11'
    | > AND wlprdc = 'Product'
    | > ORDER BY prodyr DESC, prodmo DESC
    | >
    | > What is the SELECT TOP sql equivalent for AS400?
    | >
    | > *-----------------------*
    | > Posted at:
    | > www.GroupSrv.com
    | > *-----------------------*
    |
    |
     
    bruce barker, Nov 23, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.