Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax
Message
De
26/06/2018 16:39:19
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQL syntax
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01660886
Message ID:
01660886
Vues:
65
Hi,

I am again struggling with a SQL statement, with my code I get error "Queries of this type are not supported" -
Anybody to help me with the correct syntax? I suppose the two times where are a problem. However I can't find a correct solution to get to the by me desired result.
CREATE CURSOR curNames (ID i, firstname c(10), lastname c(10))
INSERT INTO curNames values ( 1, "Koen", "Piller")
INSERT INTO curNames VALUES ( 2, "John", "Brown")
INSERT INTO curNames VALUES ( 3, "Karl", "Johnson")
INSERT INTO curNames VALUES ( 4, "Donald", "Sutterland")
INSERT INTO curNames VALUES ( 5, "Bill", "Gates")

CREATE CURSOR curGroupmember (ID i, iName i, iGroup i)
INSERT INTO curGroupmember VALUES (1, 2,1)
INSERT INTO curGroupmember VALUES (2, 3,1)
INSERT INTO curGroupmember VALUES (3, 2,2)
INSERT INTO curGroupmember VALUES (4, 1,2)

CREATE CURSOR curGroup (ID i, Name c(10)
INSERT INTO curGroup VALUES (1, "Groupa")
INSERT INTO curGroup VALUES (2, "Groupb")

- not working SQL statement: 

TEXT TO m.lcSql pretext 1+2+4+8
SELECT T1.firstname, T1.Id 
FROM curnames T1
where UPPER(T1.Firstname) like  ? m.lcLetter + '%'
and 
curnames.id in 
(SELECT distinct(curNAMES.Id ) FROM curNAMES 
INNER JOIN curGROUPMEMBER T3 ON T3.iName = T1.ID 
INNER JOIN curGROUP T4 on T4.Id = T3.iGroup where T4.Id = ? m.liGroup ) 
INTO CURSOR junk READWRITE NOFILTER
	ENDTEXT
&lcSql

lcLetter = "K"
liGroup = 2

TEXT TO lcSQL PRETEXT 1+2+4+8
I would like to have:

fullname	ID
Karl		3
Koen		1
ENDTEXT
Regards,

Koen
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform