Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
is there is a way to extract the comments on a table column.
Example: I want to extract this from an Oracle table: MY_TABLE
COLUMN_NAME | DATA_TYPE | NULLABLE | COLUMN_ID | COMMENT
My_Col1| NUMBER | Yes | 1 | Comment on Col1!
My_Col2| NUMBER | Yes | 2 | Comment on Col2!
So in my Load i want to get the comment:
LIB Connect to 'DataSource';
[MY_TABLE_comments]:
SELECT "My_Col1",
"My_Col2",
"comment_My_Col1" ???
FROM "SCHEMA"."MY_TABLE";
BR
J
The normal tables contain just data. If you want to get the meta-data to them you will need to query the data-base system-tables. You may need some extra access rights for it and you should know how the system-tables are organized. I suggest you asked the data-base admins and/or the community from the data-base to get a how-to.
I don't follow your question. What do you mean by extract comments from the column?
In your SQL script, you have used "My_Col1", "My_Col2". But, in your sample table, there are no columns as "My_Col1", "My_Col2".
Can you show the sample output and a sample data?
SELECT "My_Col1",
"My_Col2",
"comment_My_Col1" ???
FROM "SCHEMA"."MY_TABLE";
The normal tables contain just data. If you want to get the meta-data to them you will need to query the data-base system-tables. You may need some extra access rights for it and you should know how the system-tables are organized. I suggest you asked the data-base admins and/or the community from the data-base to get a how-to.
I have a Oracle table and on some columns have comments.
This LOAD in Qlik:
[MY_TABLE_comments]:
SELECT "My_Col1",
"My_Col2",
FROM MY_TABLE;
This load will only give back the selected columns and the values. But i also want to get the colum comments.
Is it possible, to get: My_Col1.COMMENT and not only the value in My_Col1?
Is it more clear what i asking?
yes, i can get info from: dba_col_comments but did hope that i could do it from the normal Load.
Thanks
J
Can explain your query with sample data.. difficult to understand your query.
Hi.
connect to the schema or user that has privilige to read som dba views. Than you can Load comments like:
LIB CONNECT TO 'SCHEMA_THAT_CAN_READ_DBA_VIEWS';
[MY_TABLE_COMMENT]:
LOAD *;
SELECT table_name,
column_name,
comments
FROM dba_col_comments
WHERE table_name='MY_TABLE';
//Or if you want to get comments from all tables.
[YOUR_SCHEMA_COMMENT_ON_ALL_TABLES]:
LOAD *;
SELECT table_name,
column_name,
comments
FROM dba_col_comments
WHERE OWNER='YOUR_SCHEMA_NAME';
Is this clear?
AFAIK it's not possible against the data-tables. But the access to the wanted meta-data might be simplified respectively outsourced within n specialized queries/views within the data-base itself - and you queries then this one.
I can use above Qlik code and get response from our oracle database. Both via the Sql tool Toad and via loading in Qlik.