
Anonymous
Not applicable
2012-02-21
09:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unable to check if table exists
Hello,
I am new to Talend and I would like to create a job that checks if a table exists in Postgres, and if it does retrieve a certain max() value and place it in a variable X, if it doesn`t set the X variable to 0.
Could someone please help me out?
Thank you,
Andras
I am new to Talend and I would like to create a job that checks if a table exists in Postgres, and if it does retrieve a certain max() value and place it in a variable X, if it doesn`t set the X variable to 0.
Could someone please help me out?
Thank you,
Andras
480 Views
6 Replies

Anonymous
Not applicable
2012-02-21
09:58 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andras
Welcome to Talend Community!
According to your requirement, you can create job as follows. If this is the first time using TOS, maybe it's a little complex.
tPostgreSQLInput-->main-->tJavaRow
|
OnSubjobError
|
tJava
Regards,
Pedro
Welcome to Talend Community!
According to your requirement, you can create job as follows. If this is the first time using TOS, maybe it's a little complex.
tPostgreSQLInput-->main-->tJavaRow
|
OnSubjobError
|
tJava
Regards,
Pedro
480 Views

Anonymous
Not applicable
2012-02-22
04:28 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your answer.
Instead of using tJava can I do this If/Else in tMap? I know that tMap does not support If/Else, but is there a way of coding the tMap to do a check like:
if(row1.X==null){
row1.X = 1;
} else{
row1.X++;
}
Instead of using tJava can I do this If/Else in tMap? I know that tMap does not support If/Else, but is there a way of coding the tMap to do a check like:
if(row1.X==null){
row1.X = 1;
} else{
row1.X++;
}
480 Views

Anonymous
Not applicable
2012-02-22
04:29 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Try this expression.
Regards,
Pedro
Try this expression.
row1.X==null?1;row1.X++
Regards,
Pedro
480 Views

Anonymous
Not applicable
2012-02-22
11:11 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It works perfectly!
Thanks a lot!
Thanks a lot!
480 Views

Anonymous
Not applicable
2012-02-22
04:05 PM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually ++ doesn`t work for increment in Talend, I had to use Variable+=1 in stead of Variable++.
480 Views

Anonymous
Not applicable
2013-06-06
09:40 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess it works, it's just the post increment effect, use ++X (pre increment)
480 Views
