baan_fun
7th April 2004, 12:48
Hi,

I'm facing the following problem in Baan 5c.

History
---------

I created a session (session A) where user insert some search criteria for a common search on 3 tables (Table X,Y,Z for ex.)

With the search results for table X I zoom to session (B) where I display the records from table W (main table) that were also found in table X,Y or Z (Table X,Y,Z,W have a common field (xyzw.field) that is index1 in table W and index2 in tables X,Y,Z)

Fact
------

I have built the logic as follws:

declaration:

extern domain tcmcs.str10 array(1000) based
extern domain

In session A : (no main table)
-----------------------

choice.def.find:
on.choice:

set.mem(array,"")
i = 0

Step 1.

select X.xyfield
by form search criteria
order by X._index1
selectdo
i = i + 1
array(1,i) = xy.field
endselect

Step 2.

... fill in array by further reading of tables Y and Z

Step 3.

export("array", array)
export("i",i)

start.session(MODAL, "SESSION B", "SESSION A", "")

In session B (main table Y)
----------------
Step.4
long j.i
extern domain
before.program:

import("array", array)
import("i",i)

for j = 1 to i
query.extend.where

baan_fun
7th April 2004, 13:00
Sorry my touchpad went mad and I accidentally posted the thread without finishing it.

So, further for Step 4:

Here I extend the WHERE query as:

string query.array(5000)
|I know the string limit is 1024 in Baan
|but seems it accepts here bigger string up to something 3000 |char.

query.array = "W._index1 = {"& quoted.string(array(1,1))&"}"
for j = 2 to i
query.array = query.array & " or W._index1 = {"&quoted.string(array(1,i))&"}"
endfor

query.extend.where(query.array, EXTEND_OVERWRITE)


MY PROBLEM
----------------
The query works fine and the desired results are shown but as it could be easily imagined in my WHERE clause I'm limited by the length of the string for the query.extend. There are cased when my array has a lot of components and the 3000 length of string is exceeded.

MY QUESTION
-----------------
Do somebody know the length limit accepted by the driver for WHERE caluse?

Is there a better way to do what I need?

I was thinking also to fill in a temp table instead of using the array and then select the tables together in query.extend.where but I'm afraid not to loose a lot in performance ( a big issue for this installation) since I have to commit transactions in the temp table to be able to see them with query.extend.

Thanks a lot in advance for the patience to read my big description and for your time.