Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I don't know if this is possible or if there may be another solution to this.
I want a variable to contain all id's in one field. In the example below i want all the car_id's from the sybase_table. If the field contains 3 ids, it would look like this: '123','321','546'. Reason i want this is because i will use this variable in a later SQL.
SQL Select "'" + car_id + "'" + "," as car_id
from Sybase_database;
SET vCar_id = 'All car_id's in on e string'
I the want to use this variable in SQL-query in a oracle_table:
select * from oracle_database
where car_id in (vCar_id)
You could use something like this:
FilterTable:
SQL Select "'" + car_id + "'" + "," as car_id
from Sybase_database;
FilterTablerConcat:
load concat(car_id, ',') as car_id_concat resident FilterTable;
SET vCar_id = peek('car_id_concat', 0, 'FilterTableConcat');
drop tables FilterTable, FilterTableConcat;
- Marcus
CarIDs:
Load
concat(car_id , '+') as CarIDList
SQL Select Distinct car_id
from Sybase_database;
Set vCarIDs = peek('CarIDList',0,'CarIDs');