[Zope-DB] Statement in cursor.execute (DCOracle2)
Matthew T. Kromer
matt@zope.com
Thu, 07 Nov 2002 15:21:11 -0500
Gilberto Pereira wrote:
> Hi,
>
> I would like to know if there's a limit in size for the statement used=20
> in cursor.execute ?
>
> I=B4m planning to use it in a possible large select statement, where i'=
m=20
> probably going to enumerate perhaps hundreds or thousands foreign keys=20
> in where clauses... So i would like to know if i'm going to face some=20
> problems in the future with this and decide to use a diferent=20
> approach, while i still can :)
>
> Thanks, Gil
The SQL statement processor in Oracle can handle up to about a 2K=20
statement, I think. If you were planning on doing a huge "where x is A=20
or x is B or x is C ..." I would re-think that logic.
One way to handle it is to use a PL/SQL TABLE OF type, where you are=20
essentially able to pass in up to 32K elements in a column to a stored=20
procedure. The procedure could then use that "table" to do a join.
--=20
Matt Kromer
Zope Corporation http://www.zope.com/=20