SunQuest
           DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 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:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 24th, 2004, 02:32 AM
kartyks kartyks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 kartyks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Rtrim at source

I have a program that uses a "Select" statement. The "Where" condition has a field Empid of length 2 char.

The variable that stores the field value is $eid.

I write the statement as

Where Empid = rtrim($eid, ' ').

only then the statement returns the value.

but the same statement with spaces is executed in the quest central works fine!

Is there a way i can do away without using that RTrim? Is there a way I can make "Where EmpID = $eid" work from the frontend?

Can i solve that updating the drivers?

Thanks in advance for the help!

-K

Reply With Quote
  #2  
Old October 1st, 2004, 06:58 AM
kartyks kartyks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 kartyks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy

is there no one to answer this???

Reply With Quote
  #3  
Old October 1st, 2004, 02:06 PM
fractalvibes fractalvibes is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Location: Waco, Texas
Posts: 632 fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 14 h 11 m 13 sec
Reputation Power: 22
in PHP:

sqlstring = "select a,b,c...etc"
. "From blah "
. "where EmpId = '" . trim($empid) . "'"

fv
__________________
...because that is the way we have always done it. We've been doing it like that for 80 Years! (How do we change that mindset?)

Reply With Quote
  #4  
Old October 12th, 2004, 09:01 AM
ajcrock ajcrock is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 18 ajcrock User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
What is the source of this data?

It can be done, it just depends on where your data source is coming from and its type (i.e. flat file, another table etc) and what langauge/platform your using to manipulate the data?

Answere these and a solution will be delivered to you in this thread.

Aj

Intrepid Developments

Reply With Quote
  #5  
Old October 25th, 2004, 07:24 AM
kartyks kartyks is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 3 kartyks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Re: Rtrim . . .

hmm! not that! i m using a language called SQR to do that!

Earlier I was using Infomix DB and there was no preoblem triming the variables that the DB rerurns coz Infomix takes care of triming the trailing spaces in a DB field. DB2 does'nt!

If there is some setting or a driver that i can use that can do away with this, i need not be modifying my programs. but now it looks that I need to be rewriting the logics most of the times!

Reply With Quote
  #6  
Old October 26th, 2004, 08:14 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,834 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 23 h 30 m 30 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
Yes, it will require either using rtrim() on the fields in the actual sql statement or using a specific language's trim function to do it once it is returned.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Rtrim at source


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 3 hosted by Hostway