Select statement returns no data

Last post 04-29-2011 12:54 AM by hagen681. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-28-2011 4:35 AM

    Select statement returns no data

    Hi!

    My ddf for the table has two fields i use as parameters for a selection. Both fields are separatly not uniqe, in field one is a object-number und field two is a option number. Each object can have various  options. The sum of both fields is uniqe. The data definition is from the original software manufdacturer, i can not ask him for help, and now my problem:

    the select statement: 

    select * from "TEST.BTR" where (option=1 and ObjID=88809)

    but there are definitivly two records with the ObjectID 88809 one with the option=1 and one with the option 2. If i replace the option=1 by option>1 then the result contains both records, but i think option>1 is logical false for the first roe (option=1). I have no idea how to solve this. Is it possible that the ddf-declaration for the option-field is wrong?

    best regards

    Hagen Schloemer

  • 04-28-2011 6:59 AM In reply to

    Re: Select statement returns no data

     What are the data types for "option" and "ObjID"?  If they are simple numbers, the query should work just fine. 

  • 04-29-2011 12:54 AM In reply to

    Re: Select statement returns no data

    Thanks i have found it. There was a single index only on one field, and this index was set to uniqe. I thin that is reason enougth for the reaction of the engine. Now i have set a compound index over both fields and set this to uniqe. Everything is now ok.

    Thanks

    Hagen Schloemer 

Page 1 of 1 (3 items)