trafodion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xu, Kai-Hua (Kevin)" <kaihua...@esgyn.cn>
Subject RE: trafodion jdbc metadata related question
Date Thu, 02 Mar 2017 09:59:40 GMT
Hi Eric,

As you see, it's true that some columns are hidden. Another way is to retrieve metadata table
directly as follows:
--retrieve all columns
select c.* from "_MD_".objects o left join "_MD_".columns c on o.object_uid=c.object_uid where
o.schema_name='ERIC' and o.object_name='TBL';
--retrieve all clustering key columns
select k.* from "_MD_".objects o left join "_MD_".keys k on o.object_uid=k.object_uid where
o.schema_name=' ERIC' and o.object_name='TBL';


Best Regards,
Kevin Xu

From: Eric Owhadi [mailto:eric.owhadi@esgyn.com]
Sent: Thursday, March 02, 2017 3:24 AM
To: user@trafodion.incubator.apache.org; dev@trafodion.incubator.apache.org
Subject: trafodion jdbc metadata related question

Hello trafodioneers,
I am trying to use jdbc metadata api to retrieve the equivalent of what a showddl or invoke
would provide in sqlci or trafci.

If I use

                                                DatabaseMetaData metadata = conn.getMetaData();
                                                ResultSet rs = metadata.getColumns("TRAFODION",
"ERIC","TBL", "%");

The resulting resultset does not provide hidden columns. For example the "_SALT_" and "_DIVISION_1_".

And when doing a
rs = metadata.getPrimaryKeys("TRAFODION",primarySchema, primaryTable);

the "_DIVISION_1_" column is returned, but not the _SALT_.

Any idea if it is possible to use jdbc to get same level of info I would get with showddl
or invoke in SQLCI/trafci?

Thanks in advance for the help,
Eric

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message