Subject | RE: [firebird-support] Re: Incompatible column/host variable data type. |
---|---|
Author | Svein Erling Tysvær |
Post date | 2011-02-04T12:11:27Z |
> Huh? I'd say your query does the opposite:Yes, now it is clear. Your original query should then be correct, and I don't know why it gives an error. You could try to change to (since NOMBRE and :NOMBRE has to be equal, then - from a logical perspective - it doesn't matter whether you check the field or parameter):
>
>Hi Set!! As usual, THANK YOU VERY MUCH for the detailed answer!!
>
>What I want, is to warn the user. If the query returns one or more records I should display someting like this:
>
>"Hey!, there's already one (at least) record with the same name *OR* the same address *OR* the same phone
>(etc...) are you sure, the customer you are adding isn't in the table yet??"
>
>if the user, lets say, leave the phone field empty, I don't want to test it because he/she would get a
>warning if there's already another record without phone.
>
>I hope I'm clear now!! And if my query is still wrong (or not the best way to do what I want), I'd LOVE to hear your opinion!
((NOMBRE = :NOMBRE) AND (NOMBRE <> '')) OR
((DIRECCION = :DIRECCION) AND (DIRECCION <> '')) OR
((TELEFONOS = :TELEFONOS) AND (TELEFONOS <> ''))
or - if you could make missing parameters NULL rather than empty, simply
NOMBRE = :NOMBRE OR
DIRECCION = :DIRECCION OR
TELEFONOS = :TELEFONOS
HTH,
Set