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 August 18th, 2004, 10:16 AM
jccorner jccorner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 45 jccorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m
Reputation Power: 5
Select statement issue

I just found something interesting, but a problem none the less. Here's the select statement:

Select * From "MstrNames" Where "COLastName" > 'b'

I was performing this select in my app but not returning any records. So, I tried the same SQL statement in the db (I am using IBExpert's sql editor) and still no records in the results. So, on a whim, I tried this select statement:

Select * From "MstrNames" Where "COLastName" > 'B'

And wouldn't you know it, it found the five records I was looking for. The interesting thing is if I fill the dataset on the form load with all the records (Select * from "MstrNames") and then perform a rowfilter on a dataview of the ds with:

dv.Table = ds.Tables("""MstrNames""")
dv.rowfilter = "COLastName > 'b'"

It will return the five records in the dv. The problem is, when I fill the dataset on the form load I may be loading upwards of 5000 records when the user may only be looking for three or five records, so I just perform the SQL on the dataset fill each time they perform a search.

My problem is, how can I get the dataset to fill with the desired records without having to have the user put in the name in Proper format ie. James, John instead of james, john.

I can't be sure that the user will always input the information in proper format when inserting a new record. Thank you for the help.

Reply With Quote
  #2  
Old August 20th, 2004, 06:49 PM
jccorner jccorner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 45 jccorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m
Reputation Power: 5
So, no one else has run into this problem??

Reply With Quote
  #3  
Old August 21st, 2004, 04:47 AM
shammat shammat is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,007 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 13 h 7 m 13 sec
Reputation Power: 67
Why is it that you put the table and column names in double quotes. This is not necessary.

Regarding your question:

You could try

Select * From MstrNames Where upper(COLastName) > Upper('B')

This way the comparison works on upper case values only, "ignoring" the case the user entered.

This will probably prohibit any index to be used though

Reply With Quote
  #4  
Old August 25th, 2004, 03:54 PM
jccorner jccorner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 45 jccorner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m
Reputation Power: 5
Thanks. I didn't realize there was an upper function able to run in a sql statement.

Reply With Quote
  #5  
Old February 9th, 2005, 10:00 PM
ferdna ferdna is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 15 ferdna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 9 m 25 sec
Reputation Power: 0
SELECT * FROM USERS WHERE USER_NAME =: test1
i did try the upper no success...

any ideas!??


thank you!

Reply With Quote
  #6  
Old February 10th, 2005, 03:17 AM
SilverDB's Avatar
SilverDB SilverDB is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Romania
Posts: 173 SilverDB User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 45 m 53 sec
Reputation Power: 5
Send a message via Yahoo to SilverDB
Try using:
"WHERE XXXX STARTING WITH UPPER(:PARAMETER)"

Reply With Quote
  #7  
Old February 10th, 2005, 08:21 AM
ferdna ferdna is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 15 ferdna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 9 m 25 sec
Reputation Power: 0
SELECT * FROM USERS WHERE UPPER(USER_NAME) = 'TEST1' and UPPER(USER_PASSWORD) = 'PASSWORDTEST';

it works this way thanks...
i'm posting it cuz it may help some other ppl..

Thank you!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Select statement issue


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 1 hosted by Hostway
Stay green...Green IT