Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine 5 tables to 1 cursor
Message
From
12/06/2018 11:24:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Combine 5 tables to 1 cursor
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01660692
Message ID:
01660692
Views:
86
Hi,

I am struggling to construct one cursor from 5 tables

Table with content

create cursor curnames (id i, name c(10), email c(10))
insert into curNames values (1,"koen","koen@gmail.com")
insert into curNames values (2,"john","john@gmail.com")
insert into curNames values (3,"rob","rob@gmail.com")
insert into curNames values (4,"bill","bill@gmail.com")
insert into curNames values (5, "annet", "annet@gmail.com")
insert into curNames values (6, "maria", "maria@gmail.com")

create cursor curEmail ( id i, content c(10))
insert into curEmail values (11,"test")

create cursor curSendTo ( id i, iemail i, iname i)
insert into curSendTo values (1,11,2)
insert into curSendTo values (2,11,1)

create cursor curSendCC ( id i, iemail i, iname i)
insert into curSendTo values (1,11,3)
insert into curSendTo values (2,11,6)

create cursor curSendBCC ( id i, iemail i, iname i)
insert into curSendTo values (1,11,4)

would like to have a cursor showing:

cursendEmail
either
((fields: Name,email,content,send))
John,john@gmail.com,test,sendto
Koen,koen@gmail.com,sendto
Rob,rob@gmail.com,test,sendcc
Maria,maria@gmail.com,sendcc
Bill,bill@gmail.com,sendbcc

or

(( fields: Name, iemail, content, sendto, sendcc, sendbcc))
John,11,Test,.t.,.f.,.f.
Koen,11,Test,.t.,.f.,.f.
Rob,11,Test,.f.,.t.,.f.
Maria,11,Test,.f.,.t.,.f.
Bill,11,Test,.f.,.f.,.t.
Somebody to assist me?

Regards,

Koen
Next
Reply
Map
View

Click here to load this message in the networking platform