Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Sakura
Contributor

Join table from one SQL connection to other SQL connection

I want to join one table from one sql connection to other.

What I did is like :

---------------------------------------

Plant:

sql select Plantcode, Keyid from plants

ODBC CONNECT 32 TO SQLConnection2

Right join(Plant)

query2:

select Keyid, * from table1

---------------------------------

I have to get plantcode from plants to query2. This code is not working. Please help!!

1 Solution

Accepted Solutions

Re: Join table from one SQL connection to other SQL connection

What if you load second connection into first one

ODBC CONNECT 32 TO SQLConnection2;

ODBC CONNECT 32 TO SQLConnection1;

query2:

select Keyid, * from table1;

Right join(Plant)

Plant:

sql select Plantcode, Keyid from plants

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

3 Replies

Re: Join table from one SQL connection to other SQL connection

Where is the first connection, And cnnection always shold start from first line (I meant you have to declare before SELECT statement) or else please post full script

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Sakura
Contributor

Re: Join table from one SQL connection to other SQL connection

Apologies Anil but I cannot post the qvw. The script is really big and the connection is defined above the 1st query.

---------------------------------------

ODBC CONNECT 32 TO SQLConnection1

Plant:

sql select Plantcode, Keyid from plants

ODBC CONNECT 32 TO SQLConnection2

Right join(Plant)

query2:

select Keyid, * from table1

---------------------------------

Re: Join table from one SQL connection to other SQL connection

What if you load second connection into first one

ODBC CONNECT 32 TO SQLConnection2;

ODBC CONNECT 32 TO SQLConnection1;

query2:

select Keyid, * from table1;

Right join(Plant)

Plant:

sql select Plantcode, Keyid from plants

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post