• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Drop table with the names from a query

#1 2012-05-04 10:11:54

Khor
Member
Company: Hound Line
Registered: 2012-01-11
Posts: 69

[resolved] Drop table with the names from a query

Hi,

I have a query in a tOracleInput that returns all the tables in the database like 'XXX_' and I have to delete this tables from the database. Can anyone tell me how to achieve this?

Thanks,
Khor

Offline

#2 2012-05-04 10:19:32

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] Drop table with the names from a query

Hi Khor

You might use tOracleTableList to retrieve tablename, tOracleRow to delete them.
The job should be as follow.
tOracleTable--iterate-->tOracleRow

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-05-04 10:22:57

Khor
Member
Company: Hound Line
Registered: 2012-01-11
Posts: 69

Re: [resolved] Drop table with the names from a query

Thank you pedro, I'll try what you said.

Offline

#4 2012-05-04 10:49:48

Khor
Member
Company: Hound Line
Registered: 2012-01-11
Posts: 69

Re: [resolved] Drop table with the names from a query

Pedro,

I have two problems:
I get a nullPointerException in the tOracleTableList component.
And how can I get the table name from tOracleTableList in the tOraclerow component?

Regards,
Khor

Offline

#5 2012-05-04 10:53:13

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: [resolved] Drop table with the names from a query

Hi Khor

The NPE exception means you didn't put a tOracleConnection component in your job.

You might use this expression to get table name.
((String)globalMap.get("tOracleTableList_1_CURRENT_TABLE"))

Regards,
Pedro


Only Paranoid Survive.

Offline

#6 2012-05-04 10:58:37

Khor
Member
Company: Hound Line
Registered: 2012-01-11
Posts: 69

Re: [resolved] Drop table with the names from a query

Hi pedro,

Thank you, it worked perfectly.

Best regards,
Khor

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Drop table with the names from a query

Board footer

Powered by FluxBB