-2

I am trying to retrieve a records from database ,how can i get in order to fetch records from customer table.

in table level without scoping

can any one help

Austin
  • 1,237
  • 1
  • 11
  • 22
  • 1
    please check out this link hope it helps http://stackoverflow.com/questions/7683533/getting-first-100-records-from-the-table-in-progress-openedge-database-e-g-sel – madroid Jan 08 '15 at 06:34

1 Answers1

1

You give very little information about what your table, fields etc look like so I'm defining a temp-table that might not look like your table but it might give you an idea.

/* Define a temp-table and create some data */
DEFINE TEMP-TABLE client NO-UNDO
  FIELD clientNo AS INTEGER
  FIELD clientName AS CHARACTER.

DEFINE VARIABLE iClient AS INTEGER     NO-UNDO.
DO iClient = 1 TO 200:

  CREATE client.
  ASSIGN client.clientNo   = iClient
         client.clientName = "Client" + STRING(client.clientNo).
END.

/* Number of rows to return */
DEFINE VARIABLE iRowsToReturn AS INTEGER     NO-UNDO.
/* Where to start */
DEFINE VARIABLE iRowToStartAt AS INTEGER     NO-UNDO.
/* Counter for rows */
DEFINE VARIABLE iRow          AS INTEGER     NO-UNDO.

/* Change these to change starting point as well as rows returned */
ASSIGN 
    iRowsToReturn = 15
    iRowToStartAt = 1.


/* Define a scrolling query */
DEFINE QUERY qClient FOR client SCROLLING.

/* Open the query */
OPEN QUERY qClient FOR EACH client NO-LOCK BY client.clientNo.

/* Reposition to first row */
REPOSITION qClient TO ROW iRowToStartAt.

/* Get the next client */
GET NEXT qClient.

/* Repeat while there is a client record available */

clientLoop:
REPEAT WHILE AVAILABLE client:

    DISPLAY client.
    /* Count rows */
    iRow = iRow + 1.
    /* Exit loop if we have displayed enough rows */
    IF iRow = iRowsToReturn THEN
        LEAVE clientLoop.

    GET NEXT qClient.
END.
Jensd
  • 7,886
  • 2
  • 28
  • 37