Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To create a sql select statement
Message
De
24/06/2018 16:07:13
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
To create a sql select statement
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01660847
Message ID:
01660847
Vues:
84
Hi,

A few days ago I requested help to make a sql select statement combining five tables. I received a workable and correct answer and also the remark my database design was not correct, I should combine three tables into one. I am convinced and have changed the design. However now again I have to ask for help to create the cursor.
CREATE CURSOR curNames (ID i, fullname c(10))
INSERT INTO curNames values ( 1, "Koen")
INSERT INTO curNames VALUES ( 2, "John")
INSERT INTO curNames VALUES ( 3, "Pete")
INSERT INTO curNames VALUES ( 4, "Donald")
INSERT INTO curNames VALUES ( 5, "Bill")

CREATE CURSOR curEmailcontent (Id i, iname i, content m, sendstatus i,iEmailmngr i)
** sendstatus 1 = sender, 2, = receiver, 3 = cc, 4 = bcc
INSERT INTO curEmailcontent VALUES( 1, 2, "The first",1,1) 
INSERT INTO curEmailcontent values( 2, 1, "This is an Email", 1, 2)
INSERT INTO curEmailcontent values( 3, 3, "This is an Email", 2, 2)
INSERT INTO curEmailcontent values( 4, 4, "This is an Email", 2, 2)
INSERT INTO curEmailcontent values( 5, 5, "This is an Email", 3, 2)
INSERT INTO curEmailcontent values( 6, 2, "This is an Email", 4, 2)


CREATE CURSOR curEmailmngr (id i)
INSERT INTO curEmailmngr values ( 1)
INSERT INTO curEmailmngr values ( 2)

*!*	SELECT curNames
*!*	BROWSE normal
*!*	SELECT curEmailcontent
*!*	BROWSE normal
*!*	SELECT curEmailmngr
*!*	BROWSE normal

clea
TEXT TO lcText PRETEXT 1

I would like to have for Where EmailID = 2

fullnamefrom	fullnameto	fullnamecc	fullnamebcc	content 
Koen												This is an Email
				Pete								This is an Email
				FDonald								This is an Email
							Bill					This is an Email
									John			This is an Email
ENDTEXT

? lcText

return
	
Someone to assist me with this?

Regards,

Koen
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform