Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 4th, 2007, 11:14 PM
studiomaxer studiomaxer is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 1 studiomaxer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 35 sec
Reputation Power: 0
Text blob problem

Hi,
I've got a text blob field and in it im storing file paths. I have an sql statement with a WHERE that selects rows based on if a string matches the text blob field. The problem is, its returning the row if the string is Contained in the text blob, not if it is an exact match. any help would be great. It is working fine in my MySql clone of the db.

SELECT row FROM paths WHERE path = 'thepath/thisdirectory'

if the text blob contains any part of that string it returns a value.

Reply With Quote
  #2  
Old January 5th, 2007, 01:27 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 810 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 5 h 46 m 49 sec
Reputation Power: 19
Quote:
Originally Posted by studiomaxer
Hi,
I've got a text blob field and in it im storing file paths. I have an sql statement with a WHERE that selects rows based on if a string matches the text blob field. The problem is, its returning the row if the string is Contained in the text blob, not if it is an exact match. any help would be great. It is working fine in my MySql clone of the db.

SELECT row FROM paths WHERE path = 'thepath/thisdirectory'

if the text blob contains any part of that string it returns a value.

First, lets eliminate the obvious.
If you are only storing file paths, do you really need a BLOB field?
Can you change to a VARCHAR field?

If not, then you could compare the returned BLOB contents with the original string before accepting it.
You could also wrap the logic into a stored procedure if you want to minimize the network traffic.

Also, I did not think that using "=" for a BLOB field was supported in Firebird:
WHERE path = 'thepath/thisdirectory'
I thought you had to use CONTAINS.

Clive.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Text blob problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT