Someone had already posted the solution earlier:

SELECT col1 FROM dba.table2 WHERE col2 IN (SELECT id FROM dba.table);

There is no point in building an array if this is what you are trying to
accomplish. If the subquery does not include a dynamic WHERE clause
dependant on a field in the main query, the result set should be static and
would accomplish, with much more efficiency, what you are trying to do with
an array.


----- Original Message -----
From: "Marc-Olivier Meunier" <[EMAIL PROTECTED]>
To: "Sapdb. General" <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 9:05 AM
Subject: Using arrays as variable


> Hi all
>
> I'd like to know if it is possible to use arrays in dbproc
> For example, i'd like to put the result of a query in an array in order
> to use it in my where clause of the next query
>
> This is my array -> @array
> SELECT id FROM dba.table ;
> Fetch-array INTO @array ;
> SELECT col1 FROM dba.table2 WHERE col2 IN @array
>
> Can i do that ? Or do i have to build a dynamic query with a while loop
> to create my WHERE clause ?
>
> Thanx for your help !
>
> --
> Marc-Olivier Meunier
> Ing�nieur Projet BKLINK
> MVH-IRIS
> 14, rue Rougemont
> 75009 Paris
>
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to