Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
mat2121
Contributor III
Contributor III

Dynamic table creation fails when using column alias

Hello,

 

I'm trying to create a table using the dynamic schema. The job looks like this :

tJDBCInput --> dynamicSchema ---> tMSSqlOutput (Create table if not exists)

 

The query in the input contains alias for duplicate column name :

 

 

Select
addressBookA.email as email1,
addressBookB.email as email2,
....
from
addressBook addressBookA,
addressBook addressBookB
where addressBookA.id = addressBookB.id .....

  

when running the job, i have the following error : 

 

java.sql.SQLException:Column names in each table must be unique

It looks like the dynamic schema does not use the alias for the table creation thus giving the error.

 

Any idea how to solve this ?

 

Thanks

Labels (4)
1 Solution

Accepted Solutions
mat2121
Contributor III
Contributor III
Author

Hi, thanks for your input.

I'am using MySQL.

 

I was able to fix the problem using this parameter in the connection string : useOldAliasMetadataBehavior=true

 

https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-installing-upgrading-5-1.html

 

 

View solution in original post

2 Replies
manodwhb
Creator III
Creator III

@mat2121,as part of testing keep the different name then email in Table B and modify the query and execute the job and let me know.

by the way which database are you using?

mat2121
Contributor III
Contributor III
Author

Hi, thanks for your input.

I'am using MySQL.

 

I was able to fix the problem using this parameter in the connection string : useOldAliasMetadataBehavior=true

 

https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-installing-upgrading-5-1.html