Kbase P59760: How to change the WHERE clause in a dynamic query.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/12/2003 |
|
Status: Unverified
GOAL:
How to change the WHERE clause in a dynamic query.
FIX:
This sample work against SPORT2000 DB:
DEF VAR hQuery AS HANDLE NO-UNDO.
DEF VAR hBrowse AS HANDLE NO-UNDO.
DEF VAR hf AS HANDLE NO-UNDO.
DEF VAR hc1 AS HANDLE NO-UNDO.
DEF VAR hc2 AS HANDLE NO-UNDO.
CREATE FRAME hf
ASSIGN HEIGHT-CHARS = 20
WIDTH-CHARS = 78
VISIBLE = TRUE
SENSITIVE = TRUE.
CREATE BROWSE hBrowse
ASSIGN FRAME = hf
REFRESHABLE = TRUE
SENSITIVE = TRUE
VISIBLE = FALSE
HEIGHT-CHARS = 10
WIDTH-CHARS = 50
EXPANDABLE = TRUE.
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(BUFFER customer:HANDLE).
hBrowse:QUERY = hQuery.
hQuery:QUERY-PREPARE("for each customer no-lock by name").
hc1 = hBrowse:ADD-LIKE-COLUMN("customer.custnum").
hc2 = hBrowse:ADD-LIKE-COLUMN("customer.name").
hBrowse:VISIBLE = TRUE.
hQuery:QUERY-OPEN().
MESSAGE "Now we change the order"
VIEW-AS ALERT-BOX INFO BUTTONS OK.
hQuery:QUERY-CLOSE().
hQuery:QUERY-PREPARE("for each customer no-lock by custnum").
hBrowse:VISIBLE = TRUE.
hQuery:QUERY-OPEN().
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.