Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesOracle 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 September 15th, 2003, 03:53 PM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 10
Problems with SQL Query and a partial search - PLEASE HELP !

First of all I would like to say HI to everyone here ! and I hope I can get my little stupid problem solved. I also want to appologize for all my many mistake and bad written. I am not good in english cause I live in Montreal and my first language is french, but I still think I can be understanded and people can help me and that I might could help some people.

Here is my problem. I am in stage in a company where I need to solve the problems there and addapt t he code to be bettet and faster and help the users to work easier. I am not that good with SQL that much and I always make some little mistake some time stupid some time worse probably. ok I think the introduction is enough long.

I don't really understand why I can use the "%" and the "_" on a query string and that on another one I just can't.

If I don't use the special caracters I will get the answer but in my program, the users need to be able to use the * and ? options. It's work fines for the city and road name but doesn't work at all when you are searching for the VPM number (code projet). soo it's kinda weird.

-------------------------------------------------------------------------------

select count(releve.noReleve) FROM Ville INNER JOIN (Rue INNER JOIN
((Compagnie INNER JOIN Releve ON Compagnie.noCie = Releve.noCie)
INNER JOIN Adresse ON Releve.noReleve = Adresse.noReleve)
ON Rue.noRue = Adresse.noRue) ON Ville.noVille = Rue.noVille
where codeProjet = 'vpm%';


on this query I am trying to know how many project name start with VPM but my result is 0 and I know I have some.

cause if I do the same thing but I use VPM1364 has my query I will get 2 answer. like here.

select count(releve.noReleve) FROM Ville INNER JOIN (Rue INNER JOIN
((Compagnie INNER JOIN Releve ON Compagnie.noCie = Releve.noCie)
INNER JOIN Adresse ON Releve.noReleve = Adresse.noReleve)
ON Rue.noRue = Adresse.noRue) ON Ville.noVille = Rue.noVille
where codeProjet = 'vpm1364';


and if I try to use VPM1364% (added the %) it won't find me any results either.

I really don't understand that error. Cause I am doing something really similar with city and roads name and it's work fine. I can use the "%" and "_" caracters and it will find my answer like I want to. It's only with CodeProjet that it doesn't work. Even if it's not a primary key and it's attribute is a string shouldn't be a problem.



I would appreciate if someone could tell me the problem or how to by-pass it ! I just don,t know ! I never got something like that before. May be it's just because I am tired I don't know.

thank you for all your time and help.
__________________

Reply With Quote
  #2  
Old September 15th, 2003, 04:52 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 13
Send a message via AIM to bricker42
try LIKE instead of =. As in codeProject LIKE 'vpm%'.

Reply With Quote
  #3  
Old September 15th, 2003, 07:17 PM
Watever Watever is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Montreal, Canada
Posts: 486 Watever User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 20 sec
Reputation Power: 10
Quote:
Originally posted by bricker42
try LIKE instead of =. As in codeProject LIKE 'vpm%'.


thank you man ! I can't try it now cause I am at home but I am sure it will work ! it's just plain stupid ! I can't understand why I haven'T see it before !

that's what happens when you need to correct others people script and work them better doh !

Reply With Quote
  #4  
Old September 15th, 2003, 07:19 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 13
Send a message via AIM to bricker42
Hehe. Ya, it's always the small ones that bite you .

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Problems with SQL Query and a partial search - PLEASE HELP !

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap