SELECT TOP 1 equivalent on AS400

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kh

    SELECT TOP 1 equivalent on AS400

    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:

    *-----------------------*
  • Rob T

    #2
    Re: SELECT TOP 1 equivalent on AS400

    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....exc ept
    where we copied the tables to a SQL server first. ;-)

    "kh" <karen_hill@s wn-dot-com.no-spam.invalid> wrote in message
    news:4198d21e$1 _4@Usenet.com.. .[color=blue]
    >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
    > *-----------------------*[/color]


    Comment

    • bruce barker

      #3
      Re: SELECT TOP 1 equivalent on AS400

      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)


      "Rob T" <RTorcellini@DO NTwalchemSPAM.c om> wrote in message
      news:eAcgt3X0EH A.1264@TK2MSFTN GP12.phx.gbl...
      | 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....exc ept
      | where we copied the tables to a SQL server first. ;-)
      |
      | "kh" <karen_hill@s wn-dot-com.no-spam.invalid> wrote in message
      | news:4198d21e$1 _4@Usenet.com.. .
      | >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
      | > *-----------------------*
      |
      |


      Comment

      Working...