Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Parameterized views
I have the need to access a not predermined number of records using a parameterized view, with a single REQUERY().
The simplest view could be the following:
SELECT * FROM prdatab1!orderRows WHERE orderRows.id IN (?lnIDs)
No problem if lnIDs represents a single ID (i.e. 3).
Problems begin when records to extract are 2 or more: i.e. records with ID= 3,5,7
I tried to use an array to store the IDs to download:
DIMENSION lnIDs[3]
lnIDs[1] = 3
lnIDs[2] = 5
lnIDs[3] = 7
and then requery; but only the record with ID = 3 is extracted.
With a second attempt, I've created a view like that:
SELECT *;
FROM prdatab1!pr1ordcr;
WHERE Pr1ordcr.id IN (SELECT id FROM TempCursXView)
Before the requery I fill the records of TempCursXView with:
id = 3 (record 1)
id = 5 (record 2)
id = 7 (record 3)
This works, but when I try to re-open the view with the designer I get the error "SQL expression is too complex".
Is there a way to obtain the result in a more comfortable way?
Thanks.
Suivant
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