How to query table/comment information and lookup table names from PKs?
I am trying to figure out whether I can query the Oracle meta-data to look for:
a) comments on tables and fields matching a certain text pattern. If possible I would LIKE the text pattern matching not to be case-sensitive. Am I looking within the right meta tables?
SQL> desc all_col_comments
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
SQL> desc user_tab_comments
Name Null? Type
TABLE_NAME NOT NULL VARCHAR2(30)
TABLE_TYPE VARCHAR2(11)
COMMENTS VARCHAR2(4000)
See http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:233014204543.
b) I was trying to look up a text named 'PKa200030' which showed up within an application upon which we are developing. The application uses Oracle 11g Enterprise Edition. However, I could not find the name anywhere when querying all_constraints, so I am not sure how to trace back the table name / package name, by knowing what seems to be a primary key constraints, any ideas please?
select c.table_name,c.constraint_name, --c.r_constraint_name,
cc.table_name
from all_constraints c
inner join all_constraints cc on c.r_constraint_name = cc.constraint_name
See http://stackoverflow.com/questions/3210743/viewing-oracles-metadata-about-primary-foreign-key-constraints.
c) I am not sure whether it is possible to draw a database entity model, perhaps using software, assuming that the primary/foreign keys have been already defined within Oracle 11g. Is software available to do this?
Hi,
a) comments on tables and fields matching a certain text pattern. If possible I would LIKE the text pattern matching not to be case-sensitive. Am I looking within the right meta tables?
SQL> desc all_col_comments
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
SQL> desc user_tab_comments
Name Null? Type
TABLE_NAME NOT NULL VARCHAR2(30)
TABLE_TYPE VARCHAR2(11)
COMMENTS VARCHAR2(4000)
....... The dictionary views are the same . A query with regular expressions may help in identifying the matching strings in comments.
b) I was trying to look up a text named 'PKa200030' which showed up within an application upon which we are developing. The application uses Oracle 11g Enterprise Edition. However, I could not find the name anywhere when querying all_constraints, so I am not sure how to trace back the table name / package name, by knowing what seems to be a primary key constraints, any ideas please?
select c.table_name,c.constraint_name, --c.r_constraint_name,
cc.table_name
from all_constraints c
inner join all_constraints cc on c.r_constraint_name = cc.constraint_name
....... There is one more view for constraints. USER_CONS_COLUMNS may be of help.
Padma
Similar Messages
-
How get all table name from database
hi master
sir
how get all table name from databaseThe big question is 'why'.
Selecting from view 'dba_tables' will indeed give the list of all tables in the database, but that includes the dictionary tables and the internal tables, and many others that are probably not of interet to a person who needs to ask this question. Besides, the dba_tables view requires access to a DBA account.
There are several other views: "user_tables" will list all the tables in this user's schema; and "all_tables" will list all the tables this user can access in some way.
The above do not, of course, include any information about synonyms, sequences, views, indexes and so on.
The correct answer and the meaningful answer may be two different things. -
EF 5 Model First Approach- How to avoid Table names from pluralized
I'm using Entity Framewrok 5.0 Model First approach using Visual Studio 2012 express. The generated database tables are pluralized. How do I avoid this? Please advice. I'm using Model First approach (Designed the entities in the EF designer and generated
the Database.) . Please note that following technic does not apply to this scenario as it applies to code - first approach.
using System.Data.Entity.ModelConfiguration.Conventions;
protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();Hi Arasheed,
Welcome to the MSDN forum.
I tested your problem. It seems a default setting that Table names are pluralized. If you want to avoid pluralizing, you can do it manually:
Right click the empty area and select “Generate Database from Model…”.
Choose the correct connection and click “Next”.
You will see the generated DDL. Please copy all the content, then click “Cancel”.
Click “Data” on the Visual Studio bar and select “Tansact-SQL Editor”. Then click “New Query Connection…”.
Connect to the right server.
Paste the DDL we copied before.
Modify the table creation lines. Note: do not forget to change the corresponding name in constraints.
Right click the empty area and click “Execute SQL”.
In addition, you can submit your feature requests here to improve Entity Framework:
http://data.uservoice.com/forums/72025-ado-net-entity-framework-ef-feature-suggestions
Good day.
Alexander Sun [MSFT]
MSDN Community Support | Feedback to us -
Dear Sapers,
How to find table name from field name to write functional spec.Pl elaborate it for normal & zdevelopment.Points will be rewarded for useful answer.
Thanks in advance.Hi Uday,
Just for the sake of help this reply......
You can find the name of tables by using F1 button keeping cursor on the respective field that you want to bring in development. From there you have to move to Technical details through technical details button.
If that field or values are getting saved into some structure then you have to search the right database tables. According to your module many database tables are there (that you can search from sdn.sap.com directly). That totally depends on your report/development that you want to bring in......
In any development deciding the right table for start up ( I mean to say tables that will give you input fields in your FS) is critical, latter you have to search linking tables and have to give logic about how to pass values from what to what field and what to what table..... In this case Transaction code SE11 and SE16 are useful......
This all is slightly confusing and tedious too...... Closely work with you ABAPer to get into many things and have successful development....
Have nice development....
Cheers!
Abu Arbab -
How to Concatenate Table name and Where condition at runtime
I am passing parameter as User and Zone to Stored Procedure.How to concatenate Table Name
and WHERE CONDITION in SQL Statement.i have different type of users and zones.Hi !
declare
cur sys_refcursor;
r emp%rowtype;
v_sql varchar2(512);
begin
-- do your logic here
v_sql := 'select * from emp';
open cur for v_sql;
loop
fetch cur into r;
exit when cur%notfound;
dbms_output.put_line(r.ename);
end loop;
close cur;
end;In this example you can see how can be done this with cursor vars .. You should concatenate v_sql string according to your requirements.
But as in further posts has already been mentioned , be carefull at publishing such kind of procedures and think on security.
Also when you want dynamicaly change from clause , you should consider using different records to accept data ? Maybe all your tables has the same structure and then this problem will be smaller.
T
T -
I dont use the credit card i have in my account any more and I dont want to put in a new one, how can i delete that information and just download the free apps?
Changing Account Information
http://support.apple.com/kb/HT1918 -
How to find table name for the fields from Standard Extractor in CRM system
How to find table name of fields from the standard extractor in CRM system ?
e.g. We use LBWE TCode in R/3 system to find table name for the field from Extractor VCSCL(e.g.).
Likewise is there any way to find table name for the fields from Standard extractor like 0CRM_LEAD_I.Hi ,
Please find the link below for understanding BW CRM analysis.
http://help.sap.com/bp_biv135/html/bw.htm
activate the CRM DSs by scenario:
1) Activate the application component hierarchy (tcode RSA9). Changes made to the application component hierarchy in the CRM system can be transferred to the BW using the "Edit Application Component Hierarchy" (SBIW - Postprocessing of DataSources).
SAP Note 434886 must be implemented in CRM 3.0 before the application component hierarchy is activated.
2) Activate the Business Content DataSources (tcode RSA5).
Select/enter the application component and choose Execute (F8).
To compare the shipped and active versions, choose the 'Select Delta' pushbutton. If there is no active version of the DataSource, it is selected automatically.
To activate the shipped version, choose the 'Transfer DataSources' pushbutton.
3) Management of the versions of the BW-Adapter metadata (tcode BWA5). All DataSources are displayed that are managed by the BW Adapter.
As in transaction RSA5 (Service API Metadata Activation), the 'Select Delta' function can be used to select the inactive DataSources or compare shipped and active versions.
You can also go directly to the screen for maintaining DataSources that are managed by the BW Adapter.
The 'Compare Version' function makes a detailed comparison of the shipped and active versions.
All BW-Adapter metadata is considered when versions are compared:
Header information (Table SMOXHEAD)
Mapping information (Table SMOXRELP)
Global selection conditions (Table SMOXGSEL)
Attribute key fields (Table SMOXAFLD)
Hope this helps.
Regards,
csm reddy -
Getting table name from a query
Hi, I'm trying to get the table name from my sql query
My code is as follows;
ResultSetMetaData metadata = rs.getMetaData();
for (int i = 1; i < metadata.getColumnCount(); i++)
System.out.println(metadata.getTableName(i));
I just get a blank output. Yet my sql query executes and I can pull down the records, and grab the column names from the result sets.
Any ideas on how I can get the table name for the columns. The reason being is on one of my querys I'm using join statements and i need to retrieve the table name for the column i'm displaying, as some tables have similar column names.
Thanks in advance.Hi,
What db are you using?
I also get a blank output with ResultSetMetaData.getTableName because Oracle doesn't implement this method.
Why do you not know the table name anyway?
regards
Nick -
How to retreive table names ?
Hi Gurus,
Having query using DatabaseMetaData..
I am trying to get Tables names from my database using code below..
try{
String[] type = {"TABLE"};
con2 = MyConnection.getConnection();
DatabaseMetaData metaData = con2.getMetaData();
ResultSet rs = metaData.getTables(null, null, "%", type);
System.out.println("Table Names:");
while (rs.next())
ResultSetMetaData rm = rs.getMetaData();
String s = rs.getString("TABLE_NAME");
System.out.println(s);
This code works fine and it gives me table names.. BUT my que is it retreives ALL table names including some system tables. (it gives me tables, for example, like: DR$NUMBER_SEQUENCE).
I just want to retreive ONLY table-names that I have created.
Is there any other override available for getTable() I can use ? OR any other solution ?
Thanks in advance!You see where you have this?
ResultSet rs = metaData.getTables(null, null, "%", type);Specifically where you have the nulls and the %?
You can pass actually useful things in there if you wanted and that might help. Consult the Javadoc API for more information on this. -
How to find Table names for PO & Invoices in SRM Standalnoe system SRM 7.0?
Hi,
How to find Table names for PO & Invoices in SRM Standalnoe system SRM 7.0? Please let me know.
Thanks,
MonicaHi,
In SRM for all objects like SC ( BUS21210),BID,PO(BUS22010),Confirmation (BUS2203),invoice etc all the data stored
in BBP_PDHGP and BBP_PDBEI tables only, These is no separate tables..
for your reference below are the few SRM tables
BBP_PDACC Account Assignment
BBP_PDATT Document Attachment
BBP_PDBEH Backend Specific Header Data
BBP_PDBEI Backend Specific Item Data
BBP_PDBGP Partner Extension Gen. Purchasing Data
BBP_PDBINREL Transaction Object Linkage (EBP)
BBP_PDHCF Set for Tabular Customer and Solution Fields on Hdr
BBP_PDHGP Business Transaction Purchasing Information
BBP_PDHSB Bid Invitation
BBP_PDHSC Header Extension for Customer Fields
BBP_PDHSS Hdr Extension for SAP Internal Enhancements (IBUs and so on)
BBP_PDICF Set for Tabluar Customer and Solution Fields on Itm
BBP_PDIGP Business Transaction Item-Purchasing Information
BBP_PDISB Bid Invitation/Bid-Specific Item Data
BBP_PDISC Item Extension for Customer Fields
BBP_PDISS Item Ext. for SAP Internal Enhancements (IBUs and so on)
BBP_PDLIM Value Limit
BBP_PDORG Purchasing Organizational Unit
BBP_PDPSET Further Procurement Information
BBP_PDTAX Tax
CDCLS Cluster structure for change documents
CDHDR Change document header
CDPOS_STR Additional Change Document - Table for STRINGs
CDPOS_UID Additional Table for Inclusion of TABKEY>70 Characters
CRM_JCDO Change Documents for Status Object (Table JSTO)
CRM_JCDS Change Documents for System/User Statuses (Table JEST)
CRM_JEST Individual Object Status
CRM_JSTO Status Object Information
CRMD_LINK Transaction - Set - Link
CRMD_ORDERADM_H Business Transaction
CRMD_ORDERADM_I Business Transaction Item
CRMD_PARTNER Partners
SROBLROLB Persistent Roles of BOR Objects
SROBLROLC Persistent Roles of Business Classes
SRRELROLES Object Relationship Service: Roles
Thanks & Regards,
Prasad S -
Table name from which to extract bank name and swift code by key field as vendor code
Please help with the table name from which we can extract the bank name and swift code of vendors with the key input as vendor numbers
Hello Subhadra, I'm sorry, I should've said join of LFBK and BNKA. The fields for the join will be the bank country(BANKS) and bank key (BANKL).
If you have not found a docu on SQVI already, you can refer to this:
How to create Report by using SQVI
This is how your join should look in BASIS mode, your selection parameter should be vendor code LIFNR; output fields with be bank name BANKA and swift code SWIFT. -
How to retrive table names with Java?
Hello!
If I connect to my Oracle Database 10g Express Edition Instance with some Java code and I run the following code:
ResultSet resultSet = databaseMetaData.getTables(null, null, "%", types);
while( resultSet.next() )
String tableName = resultSet.getString(3);
System.out.println(tableName);
I get loads of different names of tables beside those that belongs to my user like:
DR$NUMBER_SEQUENCE
DR$OBJECT_ATTRIBUTE
DR$POLICY_TAB
ARTICLES
BIN$tQZXQ0iGufbgQAB/AQELFg==$0
BIN$tQZXQ0iLufbgQAB/AQELFg==$0
But when I log in to http://127.0.0.1:9090/apex I get a perfect list of the tables belonging to the user:
ARTICLES
CUSTOMERS
DATATYPES
ORDERROWS
ORDERS
REQUESTROWS
REQUESTS
SUPPLIERROWS
SUPPLIERS
Does any one understand how to access just these table names that is created with my user?
Best regards
FredrikHello Adrian!
Yes you are right I now understand that this is the wrong forum.
So I posted the "same question" at:
How to retrive table names belonging only to a user?
How ever I seems to have problem with the schema name parameter any way.
Best regards
Fredrik -
How to transfer table data from one client to another client?
How to transfer table data from one client to another client?
Hi,
Look at the Blog
/people/community.user/blog/2007/01/07/transport-table-entries
Regards
Sudheer -
How can I transfer a game and game files (Minecraft) from my iphone to my grandson's new ipod touch. Do I have to restore the ipod from my iphone or can I just transfer this one game (plus files).
Back your device via icloud and restore on other ipod via icloud.
-
Table name from structure name
Hi experts
can anyone tell me how to find the table name if structure name is known.
when i press F1 in table field ,it give me struct name and field name.
how can i find table name from this struct.
Thanks in advanceHi ,
You can Check the where used list from your structure,
or
From SE84 transaction in abap dictionary ,give your
structure name and execute it will show where it has
been used.
Hope it helps
Regards
Mansi
Maybe you are looking for
-
Safari Crashes / Closes every time I open it
Everytime I open Safari, it opens the tab I was last on when I was using Safari, hangs for two seconds and then closes. This is the code that came with the error report. Please help! Process: WebProcess [546] Path: /System/Library/
-
How to create a swatch library from multiple png files?
Illustrator CC I am having a difficult time trying to create a new swatch libray of patterns from multiple png files. The way I am doing this is very slow and repetitive and seems silly for a tool as advanced as the latest CC suite including illustra
-
Hi everyone, i have a question about HA Licensing... 1. I already have an installation of UCCX 7.0 Premium, with the needed Seats. 2. I'm buying ESW and UCSS to upgrade the software to an early version. 3. I'm buying another MCS 7816-I5 to have HA. 4
-
Problem in finding image resources upon deployment
hi. im put used some images in my buttons and everything works smoothly if i run it through netbeans. however, once i try to run the application independently (running the jar file in the dist folder) the image resources cant be found. could anyone p
-
Hi all, User is getting above error while trying to submit the expenses on ESS. "The estimated travel amounts could not be determined." "Entry not found in T706p" Can anybody help urgently. Thanks Deepali