Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have 2 tables as Table A and Table B with similar columns.
[Full Name],
[First Name],
[Last Name],
[User ID],
Office,
City,
State,
Country,
[Country Code],
Company,
[Region]
We can use Resident like below.
Load
[Full Name],
[First Name],
[Last Name],
[User ID],
Office,
City,
State,
Country,
[Country Code],
Company,
[Region]
Resident Table A;
But is it possible to include Table B to the above Resident call?
Hi,
Try like this, you can use concatenate for merging two tables (similar to Union All in SQL)
Data:
SELECT
*,
'TableA' AS Source
FROM TableA;
Concatenate(Data)
SELECT
*,
'TableB' AS Source
FROM TableB;
Hope this helps you.
Regards,
Jagan.
Vijay,
If both the tables have similar columns, then concatenate them and use one resident load.
Two tables can't be loaded with one Resident call.
Cheers,
Naresh
Is the below correct?
Table ABC
Load....
From...Table A;
CONCATENATE
Load....
From...Table B;
NewResident:
Load
[Full Name],
[First Name],
[Last Name],
[User ID],
Office,
City,
State,
Country,
[Country Code],
Company,
[Region]
Resident Table ABC;
Hi,
Try like this, you can use concatenate for merging two tables (similar to Union All in SQL)
Data:
SELECT
*,
'TableA' AS Source
FROM TableA;
Concatenate(Data)
SELECT
*,
'TableB' AS Source
FROM TableB;
Hope this helps you.
Regards,
Jagan.
An automatic concatenation will occur if the fields are the same. If you dont want to concatenate, you can force so. by using no concatenate. Keep in mind that this will cause the two tables to associate on more than one field as they hold the same name. for table B use The qualify or rename fields as desired.
so your resident call will be like the below:
Qualify *;
Unqualify [User ID]; (if you think the two tables would be associated by the user id field)
TableB:
no concatenate Load
[Full Name],
[First Name],
[Last Name],
[User ID],
Office,
City,
State,
Country,
[Country Code],
Company,
[Region]
Resident Table A;
Yes. It is correct.
But add one more field as Jagan suggested so that it'll be easy for you to classify the data.
TableABC:
Load....,
'TableA' as TableName
From...Table A;
CONCATENATE
Load....
'TableB' as TableName
From...Table B;
NewResident:
Load
[Full Name],
[First Name],
[Last Name],
[User ID],
Office,
City,
State,
Country,
[Country Code],
Company,
[Region]
Resident Table ABC;
Cheers,
Naresh
we can't take resident of a table with same no. of field.
Thanks friends..