?
Solved

Firebird: search fails when record exists

Posted on 2012-09-13
8
Medium Priority
?
625 Views
Last Modified: 2012-09-22
I am unable to get any rows, even tho' they exist... (see image below).  This is in a C# .NET program from one of my users.  The image is from Firebird Maestro.  If I put in a row with a numeric BookNbr, it works fine!  The program is used by many, many other users, without a problem.  What is wrong?
image that shows select statement and existing row
0
Comment
Question by:rmmarsh
  • 4
  • 2
  • 2
8 Comments
 
LVL 6

Expert Comment

by:fhlio_admin
ID: 38397413
it appears that there are trailing spaces...

Try

SELECT * from tBooks where RTRIM(LTRIM(BookNbr)) = 'ajp051'

Open in new window

0
 
LVL 19

Expert Comment

by:NickUpson
ID: 38397770
please show the table definition

do a backup & restore of the database to eliminate a corrupt index
0
 

Author Comment

by:rmmarsh
ID: 38399080
Hi Nick:  backup and restore did nothing... attached is the HTML report created by Firebird Maestro.

meta-data.html
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 6

Expert Comment

by:fhlio_admin
ID: 38400559
@rmmarsh

I saw that you have attempted the backup/restore...  Did you try the query I presented?
0
 

Author Comment

by:rmmarsh
ID: 38400571
fhlio... yes, it error'd out on RTRIM; and I had already checked for leading and trailing spaces...
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 38401326
the attachment shows the list of things but doesn't work to actually see the table

run the query through isql, this will tell you if the problem is the query vs database contents or the c#

if its the c#, check the connection parameters for the language representation (e.g. your data is ascii and the query is in unicode)
0
 

Accepted Solution

by:
rmmarsh earned 0 total points
ID: 38405699
Nick... I wound up doing an export (my program does that) and then deleted the d/b, finally re-importing the text file.  Now, all is well.

Thank you for you time...

R
0
 

Author Closing Comment

by:rmmarsh
ID: 38424358
Not on the head, but gave me plenty to think about, finally fixing the problem.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question