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.M
2 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.
Similar Messages
-
How to fix the column length and table length?
Hi Experts/Gurus,
I want to fix the column lenght so that if data exceeds it should be in the same colum. But the size of the table should not get changed.. I used the width property of both table and column. But its not working..
Regards,
YugeshHi Yugesh,
For column wrapping you can use the SET_WRAPPING of cl_salv_wd_header and the data.....you have got cell editor for that column right...then using the cell edtior reference you can get the specific cell tyep(like cl_salv_wd_text_view type check this)
this is object reference and you can use the set_wrapping of this class. using this you can get the wrapping functionality for the data also....
DATA: lr_column TYPE REF TO cl_salv_wd_column,
lr_column_header type ref to cl_salv_wd_header,
lr_editor type ref to cl_salv_wd_uie,
lr_textview type ref to cl_salv_wd_uie_text_view.
wd_this->alv_value->if_salv_wd_table_settings~set_fixed_table_layout( ABAP_TRUE ).
lr_column = wd_this->alv_value->if_salv_wd_column_settings~get_column( 'EDITION' ).
lr_column->set_width( '55' ).
lr_column_header = lr_column->get_header( ).
lr_column_header->set_wrapping( abap_true).
lr_editor = lr_column->get_cell_editor( ).
lr_textview ?= lr_editor.
lr_textview->set_wrapping( abap_true ).
Now for the column and it's data the wrapping is set...
Regards,
Lekha.
Edited by: Lekha on Nov 16, 2009 2:12 PM -
How to find function module's and tables used for the particulat screen or TCODE?
Hello Nation,
I would like to know how to find the function modules and tables used for the particular screen or TCODE or program.
Example : I would like know the function module used in the program RDBGFT?
How can i find that?
Thanks in advance ,Awaiting your reply.Make use of Find function with the keyword "CALL FUNCTION".
Make use of the same find function with the keyword "Select" to know the database tables used.
Regards,
Philip. -
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 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 get the column names of the table into the Dashboard prompt
how to get the column names of the table into the Dashboard prompt
Thanks & Regards
Kishore PHey john,
My requirement is as follows
I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
My pivot table looks like this
COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
---------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK REGION DOLLARS DOLLARS DOLLARS DOLLARS
1 CENTRAL 10 20 30 40
2 SOUTHERN 10 30 30 70
3 EASTERN 20 20 20 60
4 WESTERN 10 20 30 40
When i select the District in column selector
Report has to display rank based on Total Sales by District. i.e
------------------------------------------------- JAN 2009 FEB 2009 MAR 2009
RANK DISTRICT DOLLARS DOLLARS DOLLARS DOLLARS
for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
do you have any solution for this?
http://rapidshare.com/files/402337112/Presentation1.jpg.html
Thanks & Regards
Edited by: Kishore P on Jun 24, 2010 7:24 PM
Edited by: Kishore P on Jun 24, 2010 7:28 PM -
How to change the column name as bold in adf table
Hi,
How can I change the column name with bolder style and blue colour in adf Table?
I changed the color and font weight in af:column properties, but its effecting the data in that column but not with the column Header Text property.(i have given column name in header text).
can any one have any idea how to do this?
and I have taken panel tabbed layout and in that i'm displaying this table.
but this table has scroll beneath of it to show all columns.
but i want to display all columns (for this, page should have scroll at the bottom side).
how can I achieve this???Hi,
Add the following CSS Code to the custom skin css file that is to be created as per the suggestions above.
*af|column::column-header-cell{*
color:Blue;
font-weight:bold;
This would ensure that all the table column headers are blue in color and bolder font style through-out the application.
By the way, what version of JDeveloper are you using?
Thanks,
Navaneeth -
How to use the column names generated from Dynamic SQL
Hi,
I have a problem with Dynamic SQL.
I have written an SQL which will dynamically generate the Select statement with from and where clause in it.
But that select statement when executed will get me hundreds of rows and i want to insert each row separately into one more table.
For that i have used a ref cursor to open and insert the table.
In the select list the column names will also be as follows: COLUMN1, COLUMN2, COLUMN3,....COLUMNn
Please find below the sample code:
TYPE ref_csr IS REF CURSOR;
insert_csr ref_csr;
v_select VARCHAR2 (4000) := NULL;
v_table VARCHAR2 (4000) := NULL;
v_where VARCHAR2 (4000) := NULL;
v_ins_tab VARCHAR2 (4000) := NULL;
v_insert VARCHAR2 (4000) := NULL;
v_ins_query VARCHAR2 (4000) := NULL;
OPEN insert_csr FOR CASE
WHEN v_where IS NOT NULL
THEN 'SELECT '
|| v_select
|| ' FROM '
|| v_table
|| v_where
|| ';'
ELSE 'SELECT ' || v_select || ' FROM ' || v_table || ';'
END;
LOOP
v_ins_query :=
'INSERT INTO '
|| v_ins_tab
|| '('
|| v_insert
|| ') VALUES ('
|| How to fetch the column names here
|| ');';
EXECUTE IMMEDIATE v_ins_query;
END LOOP;
Please help me out with the above problem.
Edited by: kumar0828 on Feb 7, 2013 10:40 PM
Edited by: kumar0828 on Feb 7, 2013 10:42 PM>
I Built the statement as required but i need the column list because the first column value of each row should be inserted into one more table.
So i was asking how to fetch the column list in a ref cursor so that value can be inserted in one more table.
>
Then add a RETURNING INTO clause to the query to have Oracle return the first column values into a collection.
See the PL/SQL Language doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/returninginto_clause.htm#sthref2307 -
Find the column name for a constraint
Hi Guru,
I know the constraint name, now i need the column name and table name for the constraint?
ThanksQuery the USER_CONS_COLUMNS then you will find the column name and table Name
SQL> Select * from USER_CONS_COLUMNS where Constraint_Name='<Your_constraint_Name>'; -
How to find the program name of the smart form?
How to find the program name of the smart form if output type is not known?
thanks in advance...How to find the program name of the smart form if output type is not known?
thanks in advance...
T-code SE16
Enter table name: TNAPR -> Press enter key
Enter smartform name in input field(SFORM): Z_your_smartform_name
Execute
you can find program name under the column PGNAM/Program name.
Regards
sudheer -
How to find the program name of the created sap query ?
how to find the program name of the created sap query ?
Hi avinash,
Try in this way..
Go to SE16 and then go to table TSTC.
in that give program name as <b>*followed by your query name</b>
(for example *TESTQUERY)
and run , that will give progname======queryname.
this way you can find program name.
vijay -
Hi,
I am using OCCI to interact with DB through code, which means I am writing a vc++ file to interact with Data Base and execute the Stored Procedure which I am calling from the C++ Code. And also displaying the output of the Stored Procedures to the Front End. I am succeeded in this, but now I should be able to display the Column names of the output to Front End. Can any one help me on this.
Example:
Sno | Sname
------- |-------------
1 ABC
2 DEF
I am getting (1,ABC) and (2,DEF) as the output of the Stored Procedure but I need the Column names also to display. How to get them.
Thanks in Advance..:)Look at Re: exporting csv via pl/sql - select statement?
It has an example how to extract the column name from a cursor. You have to check, whether you can use DBMS_SQL.DESCRIBE_COLUMNS
Your procedure might need another out parameter, that returns the column names , e.g. as comma separated list or as varray. -
How to rename the column name in oracle 8i?
hi,
Does anyone know how to rename the column name in oracle 8i?My method was drop the relationship key first then delete the old column,finally add the new column.
Thanks for your replay.
jingThere is no facilty to rename a column name in Oracle 8i. This is possible from Oracle 9.2 version onwards.
For you task one example given below.
Example:-
Already existed table is ITEMS
columns in ITEMS are ITID, ITEMNAME.
But instead of ITID I want ITEMID.
Solution:-
step 1 :- create table items_dup
as select itid itemid, itemname from items;
step 2 :- drop table items;
step 3 :- rename items_dup to items;
Result:-
ITEMS table contains columns ITEMID, ITEMNAME -
How to find the File name using the FTP Adapter
hi all,
how to find the File name using the FTP Adapter with BPEL.
RegardsFound the solution for this.
First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
Thanks for the posts -
How to find the form name from VA02 T.code
how to find the form name from VA02 T.code
Hi Rajyam,
I guess you are looking out for the formname which prints sales related documents.
If this is what you want,then go to the T-code NACE and select the option K1Sales activities and click on the Output Types button on the top.The new window has all the types of Output types listed.Select the most appropriate and double click on the Processing routines button in the left side screen.
The new window lists the program names and the forms associated with that output type.
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari.
Maybe you are looking for
-
Calculations on customer exit using input variable
hi, suppose i have a date input variable on my query, and i want to use the input value as an input for a calculation to be done in a different characteristic variable whose value is derived via a customer exit. how could this be done? as an example
-
My iphoto has disappeared, very upset as I dont want to have to pay for it agian
My iphoto has disappered and i am so upset, im not very computer savey and still getting used to the mac, and really close to going back to a pc. Can someone help me find my iphoto without having to spend any more money...
-
IDoc parallel posting for message type of DESADV
The DESADV (Delivery Advice) logic is complex and it takes long time than expected. We want to improve its performance by posting DESADV IDocs in parallel. Currently, the "Input type" of DESADV's function module is 1, which means parallel run is not
-
MULTI VIDEO HELP!!!!!!!
OKAY!! So I'm a super noob to premiere pro CS4. I'm trying to sync two videos and both their audio. I can sync 2 videos because when I drag the videos into the time line, they show on different time lines. However - the audio overlaps on the same tim
-
Play button on captivate when on mobile
I have played about with it for a few hours but I dont know what the problem is. I keep getting this play button throughout the project when I upload my file to the web and look at it on the mobile. Image attached