Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

lijolawrance
2011-03-07 11:34:24

Hi Face,

You can change to what kzone has told.

In what i have told earlier will fail, if there is any null value (Sorry, i missed it).

But i still feel that u need to have a null check.

dgarrigan
2011-03-07 10:54:38

In reply to your question though LijoLawrance, I am reading in just the one row does this help my cause in making it easier. The value that is being read in is a dynamically changing filename that is created in postgresql.

regards,


Face

FACE
2011-03-07 10:47:55

Cheers for getting back to me on it guys.

I'll try using the global variables and will let you know how I get on.


Face

kzone
2011-03-05 21:19:22

hi,

If you are using context variable to store some value from flow is not a 'best practices' even if it can work wink
as lijolawrance said in fact the only value that you have is the lasted one into your context

For that use globalMap and a flowToIterate to catch value from the flow (have a look into codeViewer to be sure about the name (key map) of globalMap var).
It's always 'rowName.fieldName' (ex : row1.firstName)

hope it help

lijolawrance
2011-03-04 13:48:53

Hi Dave

how many records are fetched from your DB select query?

If its more than 1, check if the last record gives a null or blank values.

The reason is that you are assigning the values to context in a flow. So for each record processed, the values of context changes.

Hope it helps you.

It will be better if you put a screen shot.

FACE
2011-03-04 12:55:08

Hi all,

Just wondering if you can help me.

I have a DB with 2 columns in it, "filename" & "sql_statement".

I am reading one row from this DB and I want to assign the output to context variables I have created "con_filename" & "con_contents".

I want to then create a file using the value I have stored in "con_filename" and the file being created should be populated with "con_contents".

At the moment I'm selecting the data from the DB fine using a tPostgresqlInput
I am trying to assign the output to context variables here too using a tJavaRow. tJavaRow contains the following.
//Code generated according to input schema and output schema
output_row.filename = input_row.filename;
output_row.sql_statement = input_row.sql_statement;
context.filename = input_row.filename;
context.sql_statement = input_row.sql_statement;

I am then outputting directly to a tFileOutput but I'm getting both values into the file and a null file name. It appears that the context variables never get set.

How do you assign values to context variables.

Thanks in advance,


Dave

Board footer

Powered by FluxBB