Subject | Re: [IBO] Urgent - Bug in IBO Parameters ? |
---|---|
Author | Helen Borrie |
Post date | 2001-01-23T12:11:42Z |
At 09:58 AM 23-01-01 -0200, you wrote:
Your problem is in this section:
Replace with
AND ((TipPFJ = :TipPFJ ) or **** (TipPFJ = 'ForCli' ****
test, anyway, i.e. and TipPFJ in ('Fornec', 'Client', 'ForCli') is the same as
and ((TipPFJ='Fornec') or (TipPFJ='Client') or (TipPFJ='ForCli'))
I think you are making the mistake of treating a parameter as a variable
and expecting IB to handle it as an expression somehow.
Helen
InterBase Developer Initiative · http://www.interbase2000.org
_______________________________________________________
>The Select:This isn't a bug in IBO parameters, it is a bug in your SQL statement.
>
>SELECT * FROM CadPFJ
>WHERE (CodEmp = 1 AND CodPFJ BETWEEN :CodPFJ and :CodPFJ2 )
Your problem is in this section:
>AND ((TipPFJ = :TipPFJ ) or **** (:TipPFJ = 'ForCli' **** /* THE SQL ISN'TA parameter represents a VALUE, not a column
>VALID */
Replace with
AND ((TipPFJ = :TipPFJ ) or **** (TipPFJ = 'ForCli' ****
>and TipPFJ in ('Fornec', 'Client', 'ForCli')))Even so, you should remove it because the next subclause is doing the same
>ORDER BY CodPFJ
test, anyway, i.e. and TipPFJ in ('Fornec', 'Client', 'ForCli') is the same as
and ((TipPFJ='Fornec') or (TipPFJ='Client') or (TipPFJ='ForCli'))
I think you are making the mistake of treating a parameter as a variable
and expecting IB to handle it as an expression somehow.
Helen
>// Monitor //All for Open and Open for All
>
>SELECT * FROM CadPFJ
>WHERE (CodEmp = 1 AND CodPFJ BETWEEN ? /* CodPFJ */ and ? /* CodPFJ2 */ )
>AND ((TipPFJ = ? /* TipPFJ */ ) or (? /* TipPFJ */ = 'ForCli' and TipPFJ
>in ('Fornec', 'Client', 'ForCli')))
>ORDER BY CodPFJ ASC
>PLAN (CADPFJ ORDER RDB$PRIMARY3)
>FIELDS = [ Version 1 SQLd 21 SQLn 1
>CADPFJ.CODEMP = <NIL> ]
>----*/
>
>/*---
>[ 23/01/2001 09:44:08 ]
>EXECUTE STATEMENT
>TR_HANDLE = 17178052
>STMT_HANDLE = 17195308
>PARAMS = [ Version 1 SQLd 4 SQLn 4
>[CODPFJ] = 0
>[CODPFJ2] = 2147483647
>[TIPPFJ] = 'ForCli'
>[TIPPFJ] = <n> '' ] // ==> The problem two parameters with the
>same name
>----*/
>
>The IBO is creating two parameters with the same name.
>PHA
>
>I´m using:
>
>Interbase 6.01 Super Server
>Servidor Linux Conectiva 5.2
>
>Windows 98 SE
>Delphi 5.0
>IBO 3.6Cd
>
>PHA
>
>
>
>
>[Non-text portions of this message have been removed]
>
>
InterBase Developer Initiative · http://www.interbase2000.org
_______________________________________________________