473,795 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i use wild cards in this select statement

1 New Member
Hi,

could any one help me with this select statement. i am using as part of JSP page.
i want to use wild cards as part of this select. i am getting error when i use % along with the name.


rs = statement.execu teQuery("SELECT * FROM lessons WHERE fname='"+ name+ "'");

Thanks
Oct 11 '06 #1
1 2765
ronverdonk
4,258 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. WHERE fname LIKE '%"+name+ "%'");
Ronald :cool:
Oct 11 '06 #2

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

Similar topics

1
1727
by: Steve T | last post by:
I have just contracted with a firm that is using a front-end web interface to access our sales data. They developed it with Microsoft Dotnet, and it uses Microsoft SQL as the database. When I search test/note fields, they say I have to do a wild card search *word* to pull up any records with "word" in that field. With our previous vendor, and with many other web accessable data bases I search you usually do not need the wild cards,...
2
1999
by: gssstuff | last post by:
I have a piece of code I use to compare two identically structured tables. There are 15+ sets of tables I am comparing. I am looking to see what has changed between the "old" and "new" versions of the table. Any changes get reported to an audit file which contains the index, field name and field value of the records that have changed. I have the changes nailed for modifications, but cannot seem to get a handle on adds/deletes. Due to...
3
2395
by: topmind | last post by:
I need to search for database text with underlines in it. However, underlines are interpreted as wild-cards in LIKE clause text . I need to know how to escape the underlines so as to be able to search them. Some DB's use an "Escape" keyword and others use a back-slash to escape wild-cards. However, Jet does not seem to support either of these. Note that I am accessing Access files via ODBC and ADO (or is it DAO?) and not through Access...
2
2453
by: Esteban404 | last post by:
My WinForm application is activating menus based on the user's roles in AD. I've created the groups to use the same 3 letter abbreviation. Is there a way to do something like this: mnuPlanning.Enabled = wp.IsInRole(@"domain\ibb*"); or mnuPlanning.Enabled = wp.IsInRole(@"domain\ibb%"); I'm using all possible groups in an if statement now, but would like to consolidate it as much as possible.
6
6220
by: CaseyB | last post by:
If I wanted to create a game like Solitaire that would first randomly shuffle a deck of cards, I figured out that all I had to use is the Random() class or rnd and make sure I use the Randomize function so as not to get the same card twice. BUT I noticed that some Solitaire games allow you to select one of the 4,294,967,296 possibilities in a 52 card deck. I want to do something similar, after I shuffle the deck I want to show the number...
4
5201
by: MattWilson.6185 | last post by:
Hi, I was wondering if there is any type of way to specify a generic type for a list. I basicaly have class shape { } class circle: public shape { }; class triangle: public shape {
1
1394
by: =?Utf-8?B?UGxheWE=?= | last post by:
I am trying to use a wild character in the LIKE part of my select statement for connecting to an AS400 database table and can't get it to work properly. I can get it to work when I hard code the value in. See below... strSelectStr = New IBM.Data.DB2.iSeries.iDB2Command("select * from LIBRARY.CKTIMEFLK5 where TICONO=1 and TIEMPN= 1710 and TIRTIM LIKE '20070207%'", cn) However when I try to use a variable that is holding the value I...
1
1876
by: Nitinkcv | last post by:
Hi, I have a textbox and a button. In my textbox i have to enter the query string(say shoes) and on clicking the button takes me to a page show all item related to the search string( in this case shoes). But on mixing the search string with wildcards it displays that no items could be found. For eg: for search string s@h^o$e@s it would go to the error page. So is there ant way i could like extract the wildcards out of my search string...
7
9261
by: W. eWatson | last post by:
Is it possible to do a search for a wild card string in another string. For example, I'd like to find "v*.dat" in a string called bingo. v must be matched against only the first character in bingo, and not simply found somewhere in bingo, as might be the case for "*v*.dat". -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10448
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10167
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9046
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.