Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How to insert or update a record in mySQL table if sourse db table name X and destination db table name Y using UpdateAttribute processor

avatar
Contributor

Hi,

How to insert or update a record in mySQL table if sourse db table name X and destination db table name Y using UpdateAttribute processor. 

I am able to achieve this if source and destination has single table but I have multiple table where source db table's names A,B and destination table's names Y,Z . I tried below condition but getting a error.

schema.name : ${${databaseName}:equalsIgnoreCase(nrpsubscriptiondb2306):and(${tableName}:equalsIgnoreCase(status)):ifElse(subscription_status,${tableName})}  

 

Error log: due to Unexpected token ':' at line 1, column 76. Query: ${${databaseName}:equalsIgnoreCase(nrpsubscriptiondb2306):and(${tableName}:equalsIgnoreCase(status)):ifElse(subscription_status,${tableName})}

 

Screenshot from 2022-07-11 17-22-43.png

 

 

 

1 ACCEPTED SOLUTION

avatar
Contributor

I got solution for this.

TableName : ${databaseName:equalsIgnoreCase("nrpsubscriptiondb2306"):and(${tableName:equalsIgnoreCase("status")}):ifElse("subscription_status",${databaseName:equalsIgnoreCase("nrpuserorgdb2306"):and(${tableName:equalsIgnoreCase("status")}):ifElse("user_org_status",${tableName})})}

View solution in original post

1 REPLY 1

avatar
Contributor

I got solution for this.

TableName : ${databaseName:equalsIgnoreCase("nrpsubscriptiondb2306"):and(${tableName:equalsIgnoreCase("status")}):ifElse("subscription_status",${databaseName:equalsIgnoreCase("nrpuserorgdb2306"):and(${tableName:equalsIgnoreCase("status")}):ifElse("user_org_status",${tableName})})}