You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
Hi all
Hope someone can help me with this ..........head is wrecked.
I have a process running in PostgreSQL and for each run it dynamically creates a new table with a new dynamic table name. I need to create a new output FILE and the name of this file needs to be the same as the table name.
In order to do this I am trying the following
1. I can get the value back from Postgresql (1 column, 1 row.........just 1 value).
2. I assign this value to a context variable using a tJavaRow (and it does get assigned as I've output to a tLogRow). See image 1 below to see tJavaRow settings - I have disabled the output schema as I'm not looking to pass the value on anywhere. The File I'm trying to produce should just be an empty file.
3. I then tried to just create a tFileOutputDelimited with this context variable entering "/home/Dave/Desktop/"+context.f_filename+".txt" where f_filename is the context variable containing the value. See image 2
4. For some reason the file name output ALWAYS has the default context variables value.
Can anyone explain why this is?
thanks in advance,
Dave
Offline

The output file is created at the beginning of the subjob, before the flow starts i.e. you can only use the contents of the source for the destination file name if you read that as a separate subjob and store it in the globalMap before reading the actual data.
Offline
Cheers for the tips guys.
Interesting to know that the tOputputFileDelimited gets created at the start of the process. Just put it into two separate queries
1. gets the file name and assigns it to the context variable
2. gets the content of the file and inserts it into the outputDelimited (calling the context variable which was set in step 1).
Both jobs are joined by a on sub job ok and it works fine.
Cheers for help/tips.
Dave
Offline
Pages: 1