How to import table definitions from SQL query?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Palermo
Participant
Posts: 24
Joined: Fri Dec 12, 2014 2:05 pm
Location: Belarus
Contact:

How to import table definitions from SQL query?

Post by Palermo »

Hi,

I have a SQL query. The SQL query consists of several types of join operations and tables. I need to import table definitions from the SQL query, for example, for Netezza connector and DB2 connector. Is it possible?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You need to import table definitions from the tables accessed by the query. There is no mechanism for importing from the query itself; it contains no other useful metadata than the column names (and even some of those can be generated "on the fly" using AS keyword).

Perhaps you could create a table using some construct that uses the result of the query, then import the metadata from that. However, I am not sure that the databases mentioned in your question support doing that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Palermo
Participant
Posts: 24
Joined: Fri Dec 12, 2014 2:05 pm
Location: Belarus
Contact:

Post by Palermo »

ray.wurlod wrote:You need to import table definitions from the tables accessed by the query. There is no mechanism for importing from the query itself; it contains no other useful metadata than the column names (and e ...
Thanks. Maybe you know Netezza and DB2 tools help to describe data type from a SQL query? For example, DbVisualizer works with DB2 database correctly but with Netezza database incorrectly (cannot identify nullable column when a SQL query contains LEFT JOIN).
Timato
Participant
Posts: 24
Joined: Tue Sep 30, 2014 10:51 pm

Post by Timato »

Maybe try wrapping the SQL query into a database view and import that view via the import > table definitions > odbc table definitions option in the DS Client?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... and Information Server metadata importers have (currently, at least) no mechanisms for interacting with tools such as DbVisualizer.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Palermo
Participant
Posts: 24
Joined: Fri Dec 12, 2014 2:05 pm
Location: Belarus
Contact:

Post by Palermo »

Timato wrote:Maybe try wrapping the SQL query into a database view and import that view via the import > table definitions > odbc table definitions option in the DS Client?
I thought about it but I have no access to create and delete views directly and it's slow.
ray.wurlod wrote:... and Information Server metadata importers have (currently, at least) no mechanisms for interacting with tools such as DbVisualizer
I understand it. I want to say that I need tools in order to see return data types from a SQL query and then I will choose data types, sizes and nullable properties in DataStage manually.
Post Reply