473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How to replace string with variable in substring?

59
How to replace string with variable in substring? btw im using vb

I have a below query that work fine but I just want to replace "ra*" with a variable. How can I do this?

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT a.[rank], b.Description
  2.     FROM CONTAINSTABLE(myTable, *, '"ra*'") AS a
  3.         INNER JOIN myTable AS b ON a[key] = b.ID
  4.              ORDER BY a.rank desc;
Below is what I tried so far but it doesnt work. it treat as '"ra"' and not '"ra*"'. Any idea how can I fix this?

Expand|Select|Wrap|Line Numbers
  1. Dim mkey As String = "ra"
  2. Dim query As String = "SELECT DISTINCT a.[rank], b.Description
  3.         FROM CONTAINSTABLE(myTable, *, '" & mKey & "*') AS a
  4.             INNER JOIN myTable AS b ON a[key] = b.ID
  5.                 ORDER BY a.rank desc;"
Nov 9 '15 #1
0 1341

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: ajikoe | last post by:
Hello, I would like to replace string with different values, For example : source = 'kode1 bla bla kode1 bla kode1' I have a list with each member will replace each of kode1. L = So the new...
2
by: Jordan Richard | last post by:
Put another way, is there any way I can tell ASP.NET to convert a path (imbedded in a string variable, "~/images/some_image.gif") to a root-relative path, that the client will understand, for the...
4
by: weirdstuff | last post by:
Hi. I have this simple code: =========================================== ->Database query here (.. some code) $row=mysql_fetch_array($res); (...)
0
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
0
by: shaikm | last post by:
Hi, I have problem passing variable in a FOR LOOP. Following is my code. Any help much appreciated. ZS -- Procedure teta has two parameters l and q , l is the feature table and q is the...
4
by: Jason | last post by:
I have a string that looks like this? ihelloworld_zzz_yyy In a single vb.net line, I want to remove the frist character and anything after and including the first "_" resulting in : ...
8
by: varsha.gadekar | last post by:
what is the easy way to check if the given string is substring of other string only using c++?
3
by: Hvid Hat | last post by:
Hi I want to highlight (make it bold) a word in some text I'm getting in XML format. My plan was to replace the word with a bold (or span) tag with the word within the tag. I've found the code...
3
by: Matthew Kennedy | last post by:
I'm not quite a noob, but I'm self taught and so I have some holes in my coding skills. I know that this should be possible but i cannot figure out what the syntax is. this is my first post to any...
13
by: Elizabeth H | last post by:
Hi, I had a few questions regarding searching for a string and replacing it using perl scripts. I have 100's of files written in Unix shell scripts and I need to edit them all. Its like ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.