The simple way would be to do the split and then query the query.

>From this...

SELECT * FROM <Table> WHERE &lcWhereClause1 AND &lcWhereClause2 INTO
CURSOR curTemp

To this...

SELECT * FROM <Table> WHERE &lcWhereClause1 INTO CURSOR curTemp_half
SELECT * FROM curTemp_half WHERE &lcWhereClause2 INTO CURSOR curTemp


Bit long winded and ugly but it should work.


Tristan



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Dominic Burford
Posted At: 24 August 2006 08:56
Posted To: Profox Archive
Conversation: Long SQL WHERE clauses
Subject: Long SQL WHERE clauses

Hi

I need some way of executing SQL statements, where the WHERE clause may
be very long.  I am trying to get the following to work:

Local lcWhereClause
lcWhereClause = <various conditions>

SELECT * FROM <Table> WHERE &lcWhereClause INTO CURSOR curTemp

Where the length of lcWhereClause exceeds 1024 it produces an error.
Even when I break the statement into two smaller statements, it still
errors:

Local lcWhereClause1, lcWhereClause2
lcWhereClause1 = <various conditions>
lcWhereClause2 = <more conditions>

SELECT * FROM <Table> WHERE &lcWhereClause1 AND &lcWhereClause2 INTO
CURSOR curTemp

How can I get round this?

Regards

Dominic Burford BSc Hons MBCS CITP
Third Party Developer Program Senior Software Engineer 

* Tel: +44 (0) 1536 495074
*   dominic.burford <BLOCKED::mailto:[EMAIL PROTECTED]>
@pegasus.co.uk 

"I conclude that there are two ways of constructing a software design:
One way is to make it so simple there are obviously no deficiencies, and
the other way is to make it so complicated that there are no obvious
deficiencies." -- Tony Hoare, Turing Award Lecture 1980



______________________________________________________________________
Pegasus Software Limited is an Infor company.

This e-mail is from Pegasus Software Limited. The e-mail and any files
transmitted with it are confidential and intended solely for the use of
the individual or entity to whom it is addressed. If you have received
this e-mail in error you must not copy, distribute or take any action in
reliance on it. Please notify the sender by e-mail or telephone.

Pegasus Software Limited utilises an anti-virus system and therefore any
files sent via e-mail will have been checked for known viruses. You are
however advised to run your own virus check before opening any
attachments received as Pegasus Software Limited will not in any event
accept any liability whatsoever once an e-mail and/or any attachment is
received.

This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to