Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
sql query-passing variable error
Posted:
Feb 20, 2013 2:55 AM
|
|
I'm taking input from user on Command Window and storing that input in a variable (UserInput). After this I'm trying to pass this information to the sql query to select the data from database:
query2 = strcat(strcat('select Column1 from Table where Column2=''', UserInput), '''') curs1 = exec(conn,query2) final = fetch(curs1) final1 = fetch(conn,query2)
The following error comes:
Error using database/fetch (line 37) Second argument must be either a query string or object of type sqlOutput
Error in recipe (line 23) final1 = fetch(conn,query2)
What I understand is that the query2 that its taking, it is taking as a string instead of sql query. What should I do to make it recognize as an sql query instead of a string.
|
|
|
|