|
|
 | | From: | b allesandri | | Subject: | Using multiple variables in SQL query with Databas | | Date: | Sun, 23 Jan 2005 13:44:04 -0500 |
|
|
 | When using the Database Toolbox I have the following problem. How to build a query when using more variables in my sql request. After looking at help on Matlab 7.0 I have been able to successfuly use one variable.
Here is a query that I am unable to get running.
curs = exec(conn, ['select * from market where Place = '' AND MonthName='' AND Year='' ', city,'''',month,'''',year,''''])
Thank you all very much for any suggestions.
B. A.
|
|
 | | From: | Christopher Smith | | Subject: | Re: Using multiple variables in SQL query with Databas | | Date: | Sun, 23 Jan 2005 14:25:33 -0500 |
|
|
 | b allesandri wrote: > > > When using the Database Toolbox I have the following problem. > How to build a query when using more variables in my sql request. > After looking at help on Matlab 7.0 I have been able to successfuly > use one variable. > > Here is a query that I am unable to get running. > > curs = exec(conn, ['select * from market where Place = '' AND > MonthName='' AND Year='' ', city,'''',month,'''',year,'''']) > > Thank you all very much for any suggestions. > > B. A.
try: curs = exec(conn, ['select * from market where Place = ', city ,' AND MonthName= ',month,year]);
This assumes all the above are already strings. If not, you'll need num2str() for non character variables.
C.
|
|
|