Subject Re: [IBO] Urgent - Bug in IBO Parameters ?
Author Helen Borrie
At 09:58 AM 23-01-01 -0200, you wrote:
>The Select:
>
>SELECT * FROM CadPFJ
>WHERE (CodEmp = 1 AND CodPFJ BETWEEN :CodPFJ and :CodPFJ2 )

This isn't a bug in IBO parameters, it is a bug in your SQL statement.
Your problem is in this section:

>AND ((TipPFJ = :TipPFJ ) or **** (:TipPFJ = 'ForCli' **** /* THE SQL ISN'T
>VALID */

A parameter represents a VALUE, not a column

Replace with

AND ((TipPFJ = :TipPFJ ) or **** (TipPFJ = 'ForCli' ****

>and TipPFJ in ('Fornec', 'Client', 'ForCli')))
>ORDER BY CodPFJ

Even so, you should remove it because the next subclause is doing the same
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 //
>
>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]
>
>

All for Open and Open for All
InterBase Developer Initiative · http://www.interbase2000.org
_______________________________________________________