Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I am in a setup with a Microsoft SQL Server on one side and trying to SELECT and UPDATE / INSERT data based on different databases on this server.
With the tDBConnection I can specifiy the Database but it seems like it is not considering that specification:
But how do I prevent 1.?
I am getting errors when trying to specify the table for the update / insert-action via [db_name].[dbo].[tablename]. " > INVALID OBJECT NAME
Any suggestions why the database-context for the connection is not working and how to specify the correct database for both querys to DBInput and DBOutput?
I am using Talend Open Studio 7.1 at the moment.
Hi @Kerstin Vanselow
Yes, the tDBConnection lets you specify the database, as you showed in the screen shot, but once you select the tDBConnection_1 as the connection to use in the tDBOutput_2 component, the only thing you can specify there is the table name.
Suggestions:
Thanks
David
could you specify db name and table name please ? and the value of context.db_name ?
But why is it not using this database but rather another one on the same host ? Is this a bug ? I am still confused @David Beaty .
Both databases have the same setup, meaning tables and fields. One is rather the Test-Database [db_name_test] and the other the database with production data [db_name]. But both have the table [Protocol] but when I use the dbconnection on database [db_name] it is inserting the change into [db_name_test].[Protocol]
Hi,
I suspect then, that the context variable for the database is not getting updated from the test database to the live database when its run.
Thanks
David
You have to Check Your context value and when you launch the job, be sure you use the good context, context group have multiple configuration like : dev,preprod, prod.
This is the funny thing, @guenneguez jeremy : my context-variables are fine - the process was working perfectly with three other tables and selects so far until now, when I introduced a new table on the SQL Server ...
So the context is definitely correct.
Hi KVanselow, you can do one thing to ensure you have the good value in your context :
in your job put a tJava component with the folowing syntax :
System.out.println(context.db_host);
System.out.println(context.db_name);
and you'll see in the console if you really use the good values.
Finally I got the reason: I was working with a subjob and forgot the small checkbox: "transmit whole context". Aaargh.