Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using <= and >= (p-sql) in two differnt Oracle databases. Diff resps.

Status
Not open for further replies.

deborahb

Programmer
Oct 2, 2000
31
US
I have two Oracle databases. I am running the same query in both:

select * from accttreedetail ad where ad.scode >= '11100000' and ad.scode <= '11100000'

In both databases I have a record in the ad table with an scode = '11100000'

In database A I find no records and in database B I find records. If I change the query in database a to

select * from accttreedetail ad where ad.scode >= '11100000' and ad.scode <= '11100001'

I find its records.

What could be different about these two databases?

Thank you,
Deborah
 
Actually I think I figured it out. The field is a varchar2(16). The length of the field in the database that works is 8 and the one that doesn't work is 16. SO the program that created the records filled one with blanks at the end and the other one not. Using a rtrim solves the problem.

Thanks,
Deborah
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top