473,388 Members | 1,524 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,388 software developers and data experts.

using contains clause

Hello - I'm using the following syntax:

WHERE pages.ParentID=0 AND CONTAINS(pages.regionID,'#request.thisRegion#')

....and I get the folowing error:

[SQLServer JDBC Driver][SQLServer]Execution of a full-text operation failed.
A clause of the query contained only ignored words.

I'm trying to see if a simple column which contains comma delimited numbers
contains the variable passed as request.thisRegion. Can anyone tell me what
I'm doing wrong? I appreciate your assistance!

TIA - Rob
Jul 20 '05 #1
4 11460

"Rob Wahmann" <ro*@dotcomstudio.biz> wrote in message
news:E8******************@newssvr26.news.prodigy.c om...
Hello - I'm using the following syntax:

WHERE pages.ParentID=0 AND CONTAINS(pages.regionID,'#request.thisRegion#')

...and I get the folowing error:

[SQLServer JDBC Driver][SQLServer]Execution of a full-text operation failed. A clause of the query contained only ignored words.

I'm trying to see if a simple column which contains comma delimited numbers contains the variable passed as request.thisRegion. Can anyone tell me what I'm doing wrong? I appreciate your assistance!

TIA - Rob


Assuming that your parameter substitution is working correctly, are you
sending a query like this to the database?

WHERE pages.ParentID=0 AND CONTAINS(pages.regionID,'1')

The digits 1 to 9 are in the ignored words file for full-text (noise.enu,
assuming you're using US English), so you may be able to get the result you
want by removing them from the file. If this doesn't help, you may want to
post in microsoft.public.sqlserver.fulltext for help.

However, if you're trying to match '1' to column values such as '1,2,3,4',
then you have a fundamental design issue. You should not have multiple
values in a single column, as this goes against basic relational design
principles. It would be better to avoid full-text searching, and instead
normalize your data model, which will be easier to work with and faster.
Although since you haven't given much background information, you may of
course have a good reason for this approach.

Simon
Jul 20 '05 #2
Thanks for the quick reply. I was trying to take a shortcut by allowing the
insert of values (1,2,3,4,5, etc. from a multiple select on a site) of
region ID's into a field. I know this is probably not the best way to handle
such a task but this code will rarely be used and it's more of a 'behind the
scenes' script for building a dhtml menu. I guess I'll have to create a
relational table and insert the numbers properly. Thought it would be easy
to see if a region ID was contained within a group of numbers quickly and
easily. I appreciate the explanation.

Thanks!!!

Rob
"Simon Hayes" <sq*@hayes.ch> wrote in message
news:40**********@news.bluewin.ch...

"Rob Wahmann" <ro*@dotcomstudio.biz> wrote in message
news:E8******************@newssvr26.news.prodigy.c om...
Hello - I'm using the following syntax:

WHERE pages.ParentID=0 AND CONTAINS(pages.regionID,'#request.thisRegion#')
...and I get the folowing error:

[SQLServer JDBC Driver][SQLServer]Execution of a full-text operation failed.
A clause of the query contained only ignored words.

I'm trying to see if a simple column which contains comma delimited

numbers
contains the variable passed as request.thisRegion. Can anyone tell me

what
I'm doing wrong? I appreciate your assistance!

TIA - Rob


Assuming that your parameter substitution is working correctly, are you
sending a query like this to the database?

WHERE pages.ParentID=0 AND CONTAINS(pages.regionID,'1')

The digits 1 to 9 are in the ignored words file for full-text (noise.enu,
assuming you're using US English), so you may be able to get the result

you want by removing them from the file. If this doesn't help, you may want to
post in microsoft.public.sqlserver.fulltext for help.

However, if you're trying to match '1' to column values such as '1,2,3,4',
then you have a fundamental design issue. You should not have multiple
values in a single column, as this goes against basic relational design
principles. It would be better to avoid full-text searching, and instead
normalize your data model, which will be easier to work with and faster.
Although since you haven't given much background information, you may of
course have a good reason for this approach.

Simon

Jul 20 '05 #3
Rob Wahmann (ro*@dotcomstudio.biz) writes:
Thanks for the quick reply. I was trying to take a shortcut by allowing
the insert of values (1,2,3,4,5, etc. from a multiple select on a site)
of region ID's into a field. I know this is probably not the best way to
handle such a task but this code will rarely be used and it's more of a
'behind the scenes' script for building a dhtml menu. I guess I'll have
to create a relational table and insert the numbers properly. Thought it
would be easy to see if a region ID was contained within a group of
numbers quickly and easily. I appreciate the explanation.


Not sure if I understand exactly what you are doing, but it is possible
that you might get some ideas from an article on my web site that
discusses how to unpack comma-separated lists as tables.
http://www.sommarskog.se/arrays-in-sql.html.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #4
Thanks for the info... there's some pretty good stuff in there. I went ahead
and normalized everything because that will probably be easier for me in the
short term. I'll have a look around your site! Thanks!

Rob

"Erland Sommarskog" <so****@algonet.se> wrote in message
news:Xn**********************@127.0.0.1...
Rob Wahmann (ro*@dotcomstudio.biz) writes:
Thanks for the quick reply. I was trying to take a shortcut by allowing
the insert of values (1,2,3,4,5, etc. from a multiple select on a site)
of region ID's into a field. I know this is probably not the best way to
handle such a task but this code will rarely be used and it's more of a
'behind the scenes' script for building a dhtml menu. I guess I'll have
to create a relational table and insert the numbers properly. Thought it
would be easy to see if a region ID was contained within a group of
numbers quickly and easily. I appreciate the explanation.


Not sure if I understand exactly what you are doing, but it is possible
that you might get some ideas from an article on my web site that
discusses how to unpack comma-separated lists as tables.
http://www.sommarskog.se/arrays-in-sql.html.
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: William Roberts | last post by:
I have created a simple select query (bound to a form in Access 2K) that calls my own public function and returns a result to an existing field in a table. I use the AS clause to reference the...
4
by: Barry Edmund Wright | last post by:
I would really appreciate your assistance. I am using Access 2000 to create a form that Lists Names and Addresses based on a number of selection criteria one of which is a combo box cboPCZip. All...
1
by: Chasing Gates | last post by:
I have created a database that brings in a new table weekly. I then made a separate query for each sales rep and a separate report for each rep. (The reports are all identical but call different...
3
by: Razzie | last post by:
Hi, I know that as a general rule, whenever your class contains members that implicitly or explicitly implement IDisposable, your class should too. However, does it count when my class uses a...
0
by: Shtirlits | last post by:
Hi, I'm use diffgarm xml (for update) which is sent with a schema with sqlxmlcommand whith sqlxml version 3 sp3. This mechanizem used ALL the parameters in the before xml as the parameters used...
3
by: gupta.harika | last post by:
Hi everyone, I am a developer working on php with oracle as backend. I am facing a problem related with the CLOB data. The problem is as follows My application uses a table which contains Clob...
1
by: djamilabouzid | last post by:
Hi, I have a question about MS SQL Server 2005: I have a table in the database that contains 70 fields. I must perform full-text search in about 60 fields. I use for that the full-text...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
6
by: Iaml | last post by:
I have an XML file and the depth of each node is unpredictable. I need to find the parent node which contains an element whose certain attribute has the given value. Then I will process that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.