MySQL Forums
Forum List  »  Newbie

asp.net CONCAT in MySQL SELECT Query
Posted by: Jay Banks
Date: October 29, 2009 11:39AM

This should be a pretty easy one, because for some reason I have concluded that it is not possible...but I'm not 100% sure.

In a asp.net query, using a variable like this works fine for me:

WHERE _NAME LIKE CONCAT('%',?deviceID,'%')

But using it like this, I have not been able to get anything but errors:

SELECT * FROM CONCAT('_',?NAME)

The purpose was to select table names from a drop down list and have a query run on them. With the variable inserted, it should come out something like this:

SELECT * FROM _856217;

I'm too new at this to understand why one works fine and one doesn't.

Thanks,

Options: ReplyQuote


Subject
Written By
Posted
asp.net CONCAT in MySQL SELECT Query
October 29, 2009 11:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.