Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Arjun/Sangeeta Yadav
  Where is Arjun/Sangeeta Yadav?
 kolkata
 India
 Arjun/Sangeeta Yadav
 Tags
Subject: RE: how to select more than one tables
Thread ID: 395955 Message ID: 395971 # Views: 37 # Ratings: 0
Version: Visual FoxPro 9 Category: Web Applications
Date: Wednesday, January 22, 2014 12:08:33 AM         
   


> >
> >
> > TEXT TO SQL_COMMAND NOSHOW
> >      SELECT * FROM agentmast WHERE ACTIVE='YE'
> >      SELECT * FROM agentlevel
> >      SELECT * FROM statemast
> >      SELECT * FROM citymast
> > ENDTEXT
> > 
> > IF SQLEXEC(CONNECTION_VAR,SQL_COMMAND) < 0
> >    AERROR(laError)
> >    MessageBox(laError[1,2])
> > ENDIF
> > 

> >
> > Check SQLEXEC() function in help to see how the get the names of the results.
> > -----------------
> > Borislav Borissov
> >
> > Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
> > The only thing normal about database guys is their tables.
>
>
>
> Hi,
>
> the below commented portion works but your suggested one gives me the attached error
>
>
> 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
>
>
>
>
> *#########################################################################
> TEXT TO SQL_COMMAND NOSHOW
> SELECT * FROM agentmast WHERE ACTIVE='YE'
> SELECT * FROM agentlevel
> SELECT * FROM statemast
> SELECT * FROM citymast
> ENDTEXT
>
> IF SQLEXEC(CONNECTION_VAR,SQL_COMMAND) < 0
> AERROR(laError)
> MessageBox(laError[1,2])
> ENDIF
> *#########################################################################
>
>
>
>
>

You should check the MySQL help to see how toe get multiple query results.
Maybe each query should end with semicolon?
I'm not sure :-)


-----------------
Borislav Borissov

Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.

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