0

I am using SQLManager Lite for firebird and it was impossible so far to write a query which would do an operation on char/varchar columns. Character set is win1252.

A query like

select * from Person where name = 'John' 

won't return any results despite the fact that the record exists in the database. A similar query on a numerical column works just fine. AM I am missing anything here?

Also, this query runs fine from my application. The only issue is that I would like to be able to run it within SQLManager Lite too. As a side note, values for char and varchar columns are not displayed properly within the same SQLManager Lite.

Dan
  • 77
  • 6
  • 1
    `char` columns are padded with spaces to the defined length (as required by the SQL standard). `varchar` is not. I can hardly see any reason to use `char` instead of `varchar`. –  Jan 21 '13 at 17:36
  • Even if the column is defined as char(1) the result will be the same. – Dan Jan 21 '13 at 17:43
  • What you mean by "not displayed properly"? What is shown if you select * from table for the record where the name is 'John'? – jachguate Jan 21 '13 at 17:49
  • try this(select * from Person where name like 'John') – dataol Jan 21 '13 at 17:49
  • check out http://ms-sql-to-firebird.sharewarecentral.com/ – Rachel Gallen Jan 21 '13 at 18:10
  • A `char(1)` column cannot hold the value `'John'` –  Jan 21 '13 at 18:27
  • @jachguate: If I look at the data in the table I will see only the first character of that char/varchar field – Dan Jan 21 '13 at 18:47
  • @a_horse_with_no_name: my point was that it did not matter the length of the field. Be it varchar or char with length of 2048 or 1 the result is the same – Dan Jan 21 '13 at 18:48
  • Are you sure character set is win1252 (ansi) and not a unicode charset? – jachguate Jan 21 '13 at 18:50
  • Please post a script with `create table`, `insert` and `select` statements that show the problem. –  Jan 21 '13 at 18:50

1 Answers1

2

change to like

select * from Person where name like 'John'
dataol
  • 999
  • 3
  • 19
  • 42