Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

SQL: how to embed parameter inside quotes for wildcard %

Guest
Nov 04, 2008 Nov 04, 2008
I would like to know how to modify a SQL statement to embed a parameter inside quotes. I want to use the parameter inside of a statement such as: SELECT * from table WHERE col LIKE '%@parm'

I can get the query to work without the parameter, just not with it?? Is there a CS3 workaround?

Thanks

TOPICS
Server side applications
301
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Nov 04, 2008 Nov 04, 2008
Well, after plenty of trial and error, it appears I had to edit the parameter itself.

and go from this
Request.Form["TextBox1"] : ""

to this
"%" + Request.Form["TextBox1"] + "%" : ""

yay!


Translate
Guest
Nov 04, 2008 Nov 04, 2008
LATEST
Well, after plenty of trial and error, it appears I had to edit the parameter itself.

and go from this
Request.Form["TextBox1"] : ""

to this
"%" + Request.Form["TextBox1"] + "%" : ""

yay!


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines