Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to share a temporary table across jobs?

Hi,

I want to create a temporary table (in Postgres) that I want to share across two jobs (see screenshot). However when I create a database connection, it's not recognized by any of the jobs (see second screenshot) as the component list is empty. In another forum, I found out that you can add the connection in the dynamic settings as an item (see 3rd screenshot), but this still lead to an error (4th screenshot). Anyone have any suggestions?

 

As an alternative, if it's not possible through a temp table, but rather through a permanent table, how can I drop the table later on as I didn't see any database command components for that either (only create table components)?

 

Roland

 

0683p000009MaYk.png0683p000009Ma7z.pngcomponent list empty0683p000009MaQF.pngadding db connection as item0683p000009MaYp.pngerror when running job and adding connection as item

Labels (2)
1 Solution

Accepted Solutions
vapukov
Master II
Master II

Hi,

 

to use a shared connection between subjobs, and parent and each child must contain tDBConnection (with the same Shared name)

 

btw, for delete table, you can always use tDBRow with a simple

DROP TABLE xxx;

command

View solution in original post

16 Replies
vapukov
Master II
Master II

Hi,

 

to use a shared connection between subjobs, and parent and each child must contain tDBConnection (with the same Shared name)

 

btw, for delete table, you can always use tDBRow with a simple

DROP TABLE xxx;

command

vapukov
Master II
Master II

Hi,

 

to use a shared connection between subjobs, and parent and each child must contain tDBConnection (with the same Shared name)

 

btw, for delete table, you can always use tDBRow with a simple

DROP TABLE xxx;

command

JohnRMK
Creator II
Creator II

Hello,

In order to share the connection between jobs, you must have the tDBConnection component in each of the father and child jobs.

 

In the child jobs, no need to put the server and the idenfiants. You just add the same name of the connection.
When you trace the logs, you can see the message "existing connection detected with the key = connection name of the father job"

tDBRow to delete the created table (I advise you to put it in a tpostjob of the father job before closing the connection)

JohnRMK
Creator II
Creator II

Hello,

In order to share the connection between jobs, you must have the tDBConnection component in each of the father and child jobs.

 

In the child jobs, no need to put the server and the idenfiants. You just add the same name of the connection.
When you trace the logs, you can see the message "existing connection detected with the key = connection name of the father job"

tDBRow to delete the created table (I advise you to put it in a tpostjob of the father job before closing the connection)

Anonymous
Not applicable
Author

Thanks. it worked.

Anonymous
Not applicable
Author

Thanks. it worked.

Anonymous
Not applicable
Author

Thanks for the reply. Where can you exactly see in the log that it uses the same connection. When I run the parent job, the only log I see is in the display (see screenshot). Also why is it better to drop the table in a postjob instead of the main parent job as displayed here?

0683p000009MaZY.png

Anonymous
Not applicable
Author

Thanks for the reply. Where can you exactly see in the log that it uses the same connection. When I run the parent job, the only log I see is in the display (see screenshot). Also why is it better to drop the table in a postjob instead of the main parent job as displayed here?

0683p000009MaZY.png

JohnRMK
Creator II
Creator II

In Run View ->Advanced Settings -> Log4j-->trace 

you will have first tDBconnection_1 (parent job) Create a shared connection "name"

then tDBConnection_2 (child job) fin a shared connection with key "name"

 

If you do not see the de log, it's disable by default, you can enable them in preferences log4j ou project settings (i dont remember lol)

the trace log is only for dev environnement and for prod, you can lunch warn ou error