Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Arjun/Sangeeta Yadav
  Where is Arjun/Sangeeta Yadav?
 kolkata
 India
 Arjun/Sangeeta Yadav
 To: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 Tags
Subject: RE: how to select more than one tables
Thread ID: 395955 Message ID: 396065 # Views: 26 # Ratings: 0
Version: Visual FoxPro 9 Category: Web Applications
Date: Wednesday, January 22, 2014 4:37:11 PM         
   


> > Hi Experts,
> >
> > this is the content of conn.prg
> >
> > CONNECTION_VAR = SQLSTRINGCONNECT("Driver={MySQL ODBC 5.1 Driver};Server=sql4.xxxxxxxxxx.net;Database=sql??????;User=sql??????; Password=dQ9%vJ9*;Option=3;")
> > -----------------------------------------------------------------------------------------------------------
> >
> >
> >
> > This is how i fetch data from the remote server into my local machine for entry,edit and delete.
> >
> >
> > DO CONN
> > SQL_COMMAND="SELECT * FROM agentmast WHERE ACTIVE='YE'"
> > IF SQLEXEC(CONNECTION_VAR,SQL_COMMAND,"MYSQLAGENTMAST")>0
> > SELECT MYSQLAGENTMAST
> > ENDIF
> >
> >
> > SQL_COMMAND="SELECT * FROM agentlevel"
> > IF SQLEXEC(CONNECTION_VAR,SQL_COMMAND,"MYSQLAGENTLEVEL")>0
> > SELECT MYSQLAGENTLEVEL
> > ENDIF
> >
> >
> > SQL_COMMAND="SELECT * FROM statemast"
> > IF SQLEXEC(CONNECTION_VAR,SQL_COMMAND,"MYSQLSTATEMAST")>0
> > SELECT MYSQLSTATEMAST
> > ENDIF
> >
> >
> > SQL_COMMAND="SELECT * FROM citymast"
> > IF SQLEXEC(CONNECTION_VAR,SQL_COMMAND,"MYSQLCITYMAST")>0
> > SELECT MYSQLCITYMAST
> > ENDIF
> >
> >
> > Now my Question: Is there any better and compact way of fetching remote data into local machine together ?
> > i.e, fetching all data from agentmast,agentlevel,statemast and citymast together.
> >
> > if we can do so it will reduce the fetching time of data and enhance the speed of the application users will appreciate this.
> >
> >
> > my second question is a related one, what if we forget to closed the connection once it is opened for fetching data, what will be its impact on the application.
> >
> >
> > Thanks & Regards
>
>
> Hi,
>
> QUESTION: Is there any better and compact way of fetching remote data into local machine together ?
> i.e, fetching all data from agentmast, agentlevel, statemast and citymast together.
> ANSWER: Not 100% sure of how your screen display screen logic is setup, but I normally fetch my
> tables separately unless I have a definite Parent->Child situation such as in an Invoice Header
> table and Invoice Details table.
> I definitely seldom select * and seldom if never select from any remote tables without a WHERE condition
> to narrow the recordset.
>
> QUESTION: What if we forget to closed the connection once it is opened for fetching data, what will be
> its impact on the application.
> ANSWER: None really. I generally close the connection when I exit the application.
>
> There are cases using MySQL where there is a connection timeout that you may need to change the value of
> so the connection does not close itself down.
>
> Pete "the IceMan", from the Great White North of Canada.
> www.marathongriffincomputers.com


Thanks for your prompt reply

ENTIRE THREAD

how to select more than one tables Posted by sangeeta yadav @ 1/21/2014 8:20:58 PM
RE: how to select more than one tables Posted by Borislav Borissov @ 1/21/2014 8:31:45 PM
RE: how to select more than one tables Posted by sangeeta yadav @ 1/21/2014 8:42:52 PM
RE: how to select more than one tables Posted by Borislav Borissov @ 1/21/2014 8:56:46 PM
RE: how to select more than one tables Posted by sangeeta yadav @ 1/21/2014 10:58:50 PM
RE: how to select more than one tables Posted by Borislav Borissov @ 1/22/2014 12:08:33 AM
RE: how to select more than one tables Posted by sangeeta yadav @ 1/22/2014 4:38:09 PM
RE: how to select more than one tables Posted by David Mustakim @ 1/22/2014 12:22:27 AM
RE: how to select more than one tables Posted by Pete Sass @ 1/22/2014 1:22:28 AM
RE: how to select more than one tables Posted by sangeeta yadav @ 1/22/2014 4:37:11 PM