Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Arjun/Sangeeta Yadav
  Where is Arjun/Sangeeta Yadav?
 kolkata
 India
 Arjun/Sangeeta Yadav
 Tags
Subject: RE: how to get multiple record set
Thread ID: 396237 Message ID: 396239 # Views: 37 # Ratings: 0
Version: Visual FoxPro 9 Category: Projects and Design
Date: Thursday, January 23, 2014 10:34:34 PM         
   


> Hi, Experts
>
> I need a method to get multiple recordset from remote mysql database using a single SQLEXEC()
>
> like
> ? SQLEXEC(nConnectionHandle,'select * from register where deedno='009' ;
> select * from moujamast where moujacode='010' ;
> select * from agents where active="ye" ;
> select * from agentlevel where levelcode >3 and <=5)
>
> i try out with some examples but fail to acheive the result.
>
> Please help
>
> Thanks & Regards


Hi,
You need to review what fields are common between all 4 tables you outlined
above and please read up on the JOIN command and how it is used with SQL Select.
You need also to review when to use a JOIN and other forms of the JOIN command
like OUTER JOIN or INNER JOIN.

Without knowing your table field structures it is impossible to show you the
code.

Also for optimization you need to consider indexes on your main WHERE conditions
and as well consider indexes if they do not exist on the JOIN conditions as well.

When dealing with multiple tables an example of multiple joins could be something
like this:
SELECT TableA.*, TableB.*, TableC.*, TableD.*
FROM TableA
    JOIN TableB
        ON TableB.aID = TableA.aID
    JOIN TableC
        ON TableC.cID = TableB.cID
    JOIN TableD
        ON TableD.dID = TableA.dID
WHERE DATE(TableC.date)=date(now()) 


Above is a very simplistic example where 4 tables are involved
and only one WHERE condition.
You can see from the above example I need a common shared field between
the 4 tables above in order to achieve my joins.

Pete "the IceMan", from the Great White North of Canada.
www.marathongriffincomputers.com

ENTIRE THREAD

how to get multiple record set Posted by sangeeta yadav @ 1/23/2014 10:12:06 PM
RE: how to get multiple record set Posted by Pete Sass @ 1/23/2014 10:34:34 PM
RE: how to get multiple record set Posted by sangeeta yadav @ 1/24/2014 8:19:59 AM
RE: how to get multiple record set Posted by Raju Shrestha @ 1/24/2014 2:38:27 AM
RE: how to get multiple record set Posted by sangeeta yadav @ 1/24/2014 8:10:27 AM
RE: how to get multiple record set Posted by Tore Bleken @ 1/24/2014 8:15:10 AM
RE: how to get multiple record set Posted by Cetin Basoz @ 1/24/2014 1:12:57 PM