Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi Cecil,
try
The SQL code in the local view is as follows:
=============================================
SELECT Projects.project_no, Projects.proj_name;
FROM projects;
WHERE Projects.project_no = ?m.lcProject_No
which enables you to run the view unchanged in the command
window if m.lcProject_No is defined,
and on a very large table is definitely faster.
The code in the form:
==============================================
WITH ThisForm.PgfProject.Page1
IF NOT(EMPTY(This.Value)) AND ;
(LEN(ALLTRIM(This.Value)) = ThisForm.nProjectNoLength OR ;
LEN(ALLTRIM(This.Value))= 1 )
*-- assuming projects is already open
asse ThisForm.nProjectNoLength=1 mess "ThisForm.nProjectNoLength # 1"
asse inlist(fsize("project_no", "projects"), 1, ThisForm.nProjectNoLength) ;
mess "check fieldsize"
local lcProject_No
m.lcProject_No = ALLTRIM(This.Value)
*the alltrim here feels bad!
*if project_no is a key to check against, why not reformat and query with ==
*m.lcProject_No = PadR(ALLTRIM(This.Value), fsize("project_no", "projects"))
=REQUERY("V_ProjectsPI")
===============================================================
>The =REQUERY("V_ProjectsPI") code generates the above SQL code.
Does it run the code or generate it to the dbc ?
HTH
thomas
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement