Finding column and table name
Hi,
I need to find out that '101c_0000000018' value is which column and table of database.
Is there a way to find it? I am looking for table and column which is storing this data.
Thanks
Sandy
It's possible but performance is going to be horrible.
Assuming the data is stored in a CHAR or VARCHAR2 column, something like
DECLARE
l_value VARCHAR2(100) := '101c_0000000018' ;
l_cnt PLS_INTEGER;
l_sql VARCHAR2(1000);
BEGIN
FOR x IN (
SELECT table_name, column_name
FROM dba_tab_cols
WHERE owner = <<name of schema>>
AND data_type IN ('CHAR', 'VARCHAR2' )
LOOP
l_sql := 'SELECT COUNT(*) FROM ' || x.owner || '.' || x.table_name || ' WHERE ' || x.column_name || ' = :1';
EXECUTE IMMEDIATE l_sql
INTO l_cnt
USING l_value;
IF( l_cnt > 0 )
THEN
dbms_output.put_line( 'Found the value ' || l_value || ' in owner = ' || x.owner || ' table name = ' || x.table_name || ' column name = ' || x.column_name );
END IF;
END LOOP;
END;Justin
Edited by: Justin Cave on Dec 8, 2011 12:20 PM
Similar Messages
-
How to know columns and table name whose column size are modified
Hi guys
I want to know which all columns in the tables are modify
i.e. list of columns and table name whose column size are modified
Step1 :
CREATE TABLE employees
( employee_number number(5) ,
employee_name varchar2(50) ,
department_id number(10)
CREATE TABLE Supplier
( Supplier_number number(5) ,
Supplier_name varchar2(50) ,
CREATE TABLE customers
( customer_id number(10) not null,
customer_name varchar2(50),
address varchar2(50),
city varchar2(50),
state varchar2(25),
zip_code varchar2(10),
Step2 :
Alter table employees
MODIFY employee_number number(10)
ALTER TABLE supplier
MODIFY supplier_name varchar2(100)
step3
query to dispaly
columnname table name
employee_number employees
supplier_name supplier
How to know columns and table name whose column size are modified
could you please provide query
Thanks in Advance09:35:50 SQL> desc dba_objects
Name Null? Type
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
NAMESPACE NUMBER
EDITION_NAME VARCHAR2(30)LAST_DDL_TIME can be utilized -
Translation of Columns and Table Names
Hi,
We are starting a large migration project and we have a mix of dutch and english developers.
I was wondering if there is any clever ways to translate column names and table names.
Not physically translate the text but store the english column name against the dutch column name?
I know I could write a view which overlays the table with the english version but I was wondering if there was something a bit cleverer?
Anyway to store multiple meta data against a physical table?
Thanks
RichardI'd tend to agree with Nicolas that you'd generally want all the developers to agree on what a particular object was called rather than having half of them think of it in Dutch and half in English.
On the other hand, it would make sense to me that the comments you create on your objects and tables should be multilingual, i.e.
SQL> create table my_emp (
2 name varchar2(100)
3 );
Table created.
SQL> comment on table my_emp is 'Table containing employee information.
2 Lijst die werknemersinformatie bevat.';
Comment created.(The translation is from babelfish.yahoo so I apologize if it butchers the Dutch).
The developers should be able to see the table and column comments in their IDE of choice and should be able to see what the object represents in their language.
Justin -
JKM DB2 400 column and table name 10 character limit
I am trying to set up CDC on an iSeries. I have successfully loaded data with the LKM SQL to Oracle, and now I want to set up CDC for the table and am trying to use "JKM DB2 400" . I get invalid token errors when I try to start journalizing, and it appears to be the table and column names, used to set up CDC, which are more than the 10 character limit. Tables like SNP_JRN_SUBSCRIBER seem to come from the getJrnInfo function and other table and column names are hard coded. I want to copy the JKM and reduce all of the names to less than 10 characters.
Where else are these names used? How does the interface know which table names to use when set to use only journalized data and how can I change it to use the new shorter names? Is there a better solution?Thanks to all for assistance. It turns out that the 10 character limit, about which the server people warned me, isn't an issue with my ODBC connection. The invalid token error was being caused by some missing qualifiers in the generated sql which caused appearances of ".tablename" rather than "tablename" and other similar. I was able to modify the knowledge module to eliminate this issue and the CDC worked correctly on my first test.
-
Hi Experts,
I just want to ask is there any procedure to know the table name and the corrosponding column name when you have only data with you.
Suppose you have a string say "India". Now i want to know the name of the column and corrosponding tablename
which holds the value "India".
Thanks
RajatSolutions previously provided by michaels...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
SQL> select table_name,
column_name,
:search_string search_string,
result
from cols,
xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME ES RESEARCH
DEPT DNAME ES SALES
EMP ENAME ES JONES
EMP ENAME ES JAMES
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES PRESIDENT
EMP JOB ES SALESMAN
9 rows selected. -
'Exists in Hierarchy' column and table name
Hi All
In Position hierarchy form .we all find exists in hierarchy flag ..when checking for
hierarchies , can any one help me ..what is the table and column name which will tell whether position exists in hierarchy or notHi,
I doubt where the exists flag is stored.
But you can derive it very easily by checking the position_id exists in (SUBORDINATE_POSITION_IS or PARENT_POSITION_ID) in table PER_POS_STRUCTURE_ELEMENTS for given structure_id.
Hope it helps.
Thanks,
Sanjay -
Blanks, spetial characters in column and table names
Is there any posibility, which i have overseen to change the sugested table and column names to something with mixed case, blanks, spetial characters, which often occurs in the MS World. It's uggly but 1000 times better then rewriting code, or changing create table scrips like this:
CREATE TABLE "BDProjection"
"ID" NUMBER(11) DEFAULT 0 NOT NULL,
"Name" VARCHAR2(4000),
"Semi-major axis" NUMBER(20,5) DEFAULT 0,
"Semi-minor axis" NUMBER(20,5) DEFAULT 0,
"Latitude origin" NUMBER(20,5) DEFAULT 0,
"Longitude" NUMBER(20,5) DEFAULT 0,
"False easting" NUMBER(20,5) DEFAULT 0,
"False northing" NUMBER(20,5) DEFAULT 0,
"Scale factor at origin" NUMBER(20,5) DEFAULT 0,
"scale Coords" NUMBER(11) DEFAULT 0,
"default" NUMBER(1) DEFAULT 0,
"MinEasting" NUMBER(20,5) DEFAULT 0,
"MaxEasting" NUMBER(20,5) DEFAULT 0,
"MinNorthing" NUMBER(20,5) DEFAULT 0,
"MaxNorthing" NUMBER(20,5) DEFAULT 0
This may be a sugestion for a future relaese.
UweTo query your table, as is:
SQL> SELECT *
2 FROM cst_customer
3 WHERE "#_CUST" = 10030;
To get rid of the #'s in the column names of your table:
SQL> CREATE TABLE new_cst_customer
2 AS
3 SELECT "#_CUST" no_cust,
4 "#_PH_BUS" no_ph_bus,
5 "#_PH_HOME" no_ph_home,
6 n_cust_surname
7 FROM cst_customer;
Table created.
SQL> DROP TABLE cst_customer;
Table dropped.
SQL> CREATE TABLE cst_customer
2 AS
3 SELECT *
4 FROM new_cst_customer;
Table created.
Then, you can query your table as follows:
SQL> SELECT *
2 FROM cst_customer
3 WHERE no_cust = 10030;
You will need to recreate any constraints associated with the table and recompile any procedures, functions, triggers, and packages associated with the table, and change any code to use the new column names. It would be a good idea to make a list of all the changes to be made and make a backup copy of the table before you start. In your code, just replace all #_ with no_. If you are just getting started, it would be worth your while to make the changes now and save a lot of hassles later. If you have a lot of dependencies, it might be better just to use the quotes everywhere. I have seen posts by someone else with a similar situation and everything he tries to do has to be done specially because of it; Creating a simple procedure becomes "procedure agony".
null -
How to find the column name and table name with a value
Hi All
How to find the column name and table name with "Value".
For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
Any help is highly appricatable
Thanks & Regards
Srikkanth.M2 solutions by Michaels (the latter is 11g upwards only)...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
SQL> select table_name,
column_name,
:search_string search_string,
result
from cols,
xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME ES RESEARCH
DEPT DNAME ES SALES
EMP ENAME ES JONES
EMP ENAME ES JAMES
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES PRESIDENT
EMP JOB ES SALESMAN
9 rows selected. -
Query to find out the table name and column name..
Hi Experts,
I have an Oracle DB in which has more than 50 tables and 100,000 records. I want to get the record which contains *"ITxtVarValue references a non existing text"* the text.
Is there any query there to find out the table name and column name of this particular record where it reside?
Please help. Any help will be rewarded.
Thanks,
GUsing this forum's search function, I found a thread that should give you an idea: How to find out a tablename
C. -
How to get the column name and table name with value
Hi All
I have one difficult requirement
I have some column values and they have given some alias column names but i need to find the correct column name and table name from the database.
For example value is "SRI" and i dont know the table and exact column name so is there any possibilities to find the column name and table name for the given value
Thanks & Regards
Srikkanth.MSearching all the database for a word...
Courtesy of michaels...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
11g upwards
SQL> select table_name,
column_name,
:search_string search_string,
result
from (select column_name,
table_name,
'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
from cols
where table_name in ('EMP', 'DEPT')),
xmltable (str columns result varchar2(10) path '.')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME es RESEARCH
EMP ENAME es JAMES
EMP JOB es SALESMAN
EMP JOB es SALESMAN
4 rows selected. -
How to find the columns and tables used in a stored procedure?
Hi,
Can someone suggest how to find the columns and tables used within a stored procedure?
Thanks
VBKFor example:
SQL> create or replace
2 procedure p1
3 is
4 cnt number;
5 begin
6 select count(*) into cnt from emp;
7 end;
8 /
Procedure created.
SQL> select referenced_owner,
2 referenced_name
3 from dba_dependencies
4 where owner = 'SCOTT'
5 and name = 'P1'
6 and referenced_type = 'TABLE'
7 /
REFERENCED_OWNER REFERENCED_NAME
SCOTT EMP
SQL> SY. -
How to Find what are tables and "Table Name" in particular "Data File"
hi Team,
I have one database that database 300 gb size , this database having 6 ndf files ,
here How to Find what are the tables and "Table Name" in particular "Data File"[.ndf]Hi,
In addition to Prashanth’s suggestion, you can also use the following Transact-SQL statements to get more detailed information including all objects and indexes per Filegroup / Partition and allocated data size of databases.
The script can work with Microsoft SQL Server 2005 and higher version in all Editions. For more details, please review this article:
List all Objects and Indexes per Filegroup / Partition.
-- List all Objects and Indexes
-- per Filegroup / Partition and Allocation Type
-- including the allocated data size
SELECT DS.name AS DataSpaceName
,AU.type_desc AS AllocationDesc
,AU.total_pages / 128 AS TotalSizeMB
,AU.used_pages / 128 AS UsedSizeMB
,AU.data_pages / 128 AS DataSizeMB
,SCH.name AS SchemaName
,OBJ.type_desc AS ObjectType
,OBJ.name AS ObjectName
,IDX.type_desc AS IndexType
,IDX.name AS IndexName
FROM sys.data_spaces AS DS
INNER JOIN sys.allocation_units AS AU
ON DS.data_space_id = AU.data_space_id
INNER JOIN sys.partitions AS PA
ON (AU.type IN (1, 3)
AND AU.container_id = PA.hobt_id)
OR
(AU.type = 2
AND AU.container_id = PA.partition_id)
INNER JOIN sys.objects AS OBJ
ON PA.object_id = OBJ.object_id
INNER JOIN sys.schemas AS SCH
ON OBJ.schema_id = SCH.schema_id
LEFT JOIN sys.indexes AS IDX
ON PA.object_id = IDX.object_id
AND PA.index_id = IDX.index_id
WHERE OBJ.type_desc='USER_TABLE'-- add this WHERE clause to display the information of user tables
ORDER BY DS.name
,SCH.name
,OBJ.name
,IDX.name
Thanks,
Lydia Zhang -
Table names to find Program names and Table names
Hi All,
I want to find Program names and Tables names where Transaction codes are not been created.
If TCodes are created I can find from TSTC.
But programs and tables which does not have tcodes.
How can I find them?Hi Praveen Kumar
You know the program name go to se38 and find out if u know table name go to se11 and find out .if you want to see both where there are used in which program go to se80 it would be easy.
How to trace in se80 . select programe and down give programe name you will gte it. -
How to find Field Name and Table Name
Hi All,
I got some output values from the legacy system with me but need to know whats the actual field name and table name to which i need to transfer these values. How can i do it, since which theres is not field name or despcription given for the data.
Is there any way i can do it.
Points will be rewarded for all useful answers.
Regards
ABHi All,
I got some output values from the legacy system with me but need to know whats the actual field name and table name to which i need to transfer these values. How can i do it, since which theres is not field name or despcription given for the data.
Is there any way i can do it.
Points will be rewarded for all useful answers.
Regards
AB
Hi Abuser,
now u have legacy data. now u want to do upload this data from legacy to r/3 by using one sap transaction. yes ok na..
first of all u want to know the data is relevant to the which transaction...
without knowing the transaction u cant trasfer the data..
then open transaction put cursor on i/p field and click on f1
and find out the field name & table..
this is one method to find the field name and table name. -
Cost Component structure field and table names
Hey all,
i need to code a BADI to push value of one column in cost component structure to another column in ccs for only order settlements..
any idea how to do this??
i am very new to abap please take it easy on ur answer..
i coulndt even find in which table and fields these values are stored...
thank youI have an OSS note, it tells you step by step how to config the badi u need.. but does not mention about the logic u ll use.. it is up to you....
so i need to find the field names and tell take these and post them to these columns...
i dont know if i make any sence, but this is all i need to do...
so i have the body i have the logic but i dunno the import and export fields...
i believe the table is ckmlkeph.... and field that populate the columns are kst0XX, but i cannot see the field name and table name if i select a line in the column and F1 ????
Maybe you are looking for
-
ive got an iphone 4s which worked fine before i upgraded to ios 7. now it is stuck at the activation screen because it keeps telling me my device is unknown. i have tried activating it over wifi and through itunes but no luck, itunes tells me that th
-
Error while creating an Credit memo in AR + R12
Hi All, I am trying to create a credit memo in AR, based on the transaction i.e., an invoice of AR. But i am not able to create. I am encounter the following error "Your credit memo transaction can only credit an invoice or a debit memo line Failure
-
Need the control to change PO line items based on PO document creation date, User can change PO line items quantity only before 14 days from PO creation date & should not allow to change after 14 days from data of creation PO.This control should be a
-
Display query columns in horizontal
Hi all I'm creating a report using sql commands only(no report builder). I'd like to have my columns to be displayed in horizontal followed by its value. So far I've made it, however I can't get them to be displayed well where all the columns are in
-
ITunes does not sync all of my iPhoto pics...
Hello everyone! I have a problem to upload some of my Pictures from iPhoto to my iPad2.. about 70 of 400 pic are uploading and the rest doesn't work and itunes says "cant upload some pictures, cause the ipad isnt able to read them". Does anyone has t