Searching for a values in all tables in a schema

Hi All,
Is there any way/logic to find a value in unknown
fileds of unknown tables in a schema.
Just out of curiosity, I am posting this question.
Thanks in advance.
Regards,
Srini

I already answered to a similar post last week.
Have a look at this site :
how do I find in a ViewTable what table has a specific column?
-- Shailender Mehta --

Similar Messages

  • Text value Search in all tables of a schema

    Hi,
    I have a schema and a lot of tables.
    Now i want to search a given value in all tables and all columns.
    Actully for e.g I have a value 'http://192.168.1.15:8080://....'
    which is to be replaced by 'http://10.15.1.16:8080://.....'
    I need information of all table name and all their respective columns having this value.
    Is their any tool, or sql script which can scan.
    I am using 10g
    Thanks
    Message was edited by:
    [email protected]

    Hi,
    it's quite easy to write a plsql-prog using dynamic sql (if tthe value you've just to
    search varchar cols). I've never heard about a tool for search and replace within a whole schema.
    Torsten

  • Need a Query to search a value from all tables.

    Hi,
    I would like to know, is there any way that we could search a string from all the tables.
    For example I need to find a STRING 'hello world', on which table it presents. I want to search it from all the tables, as there might be a situtation
    where we dont knwo which table the value gets stored.
    REgards
    Suresh

    Run this code ---this is only search for required value in VARCHAR2 column.as per ur requirement u can change it to oher dataype..
    Reply if its helpful to you
    DECLARE
    S SYS_REFCURSOR;
    CURSOR c_user_col IS
    SELECT TABLE_NAME,COLUMN_NAME,DATA_TYPE FROM USER_TAB_COLUMNS,TAB
    WHERE TABLE_NAME=TNAME AND TABTYPE='TABLE'
    ORDER BY TABLE_NAME;
    TYPE TAB_LIST
    IS
    RECORD
    TABLE_NAME VARCHAR2(1000),
    COLUMN_NAME VARCHAR2(1000),
    DATA_TYPE VARCHAR2(100));
    TYPE T_TAB_LIST
    IS
    TABLE OF TAB_LIST;
    L_TAB_LIST T_TAB_LIST := T_TAB_LIST();
    L_STMT CLOB;
    l_exists NUMBER;
    BEGIN
    FOR i IN c_user_col LOOP
    L_TAB_LIST.EXTEND;
    L_TAB_LIST(L_TAB_LIST.LAST).TABLE_NAME := I.TABLE_NAME;
    L_TAB_LIST(L_TAB_LIST.LAST).COLUMN_NAME := i.COLUMN_NAME;
    L_TAB_LIST(L_TAB_LIST.LAST).DATA_TYPE := i.DATA_TYPE;
    END LOOP;
    FOR i in 1..L_TAB_LIST.COUNT LOOP
    l_exists := NULL;
    IF L_TAB_LIST(I).DATA_TYPE = 'VARCHAR2' THEN
    L_STMT := 'SELECT 1 FROM '||L_TAB_LIST(I).TABLE_NAME||' WHERE '||L_TAB_LIST(I).COLUMN_NAME||'=''samplesdfsdfsdf''';
    OPEN S FOR L_STMT;
    FETCH S INTO l_exists;
    CLOSE S;
    IF l_exists IS NULL THEN
    NULL;
    ELSE
    DBMS_OUTPUT.PUT_LINE('Table name: '||L_TAB_LIST(I).TABLE_NAME||'--Column Name: '||L_TAB_LIST(I).COLUMN_NAME);
    DBMS_OUTPUT.PUT_LINE(L_STMT);
    END IF;
    END IF;
    END LOOP;
    END;

  • Wildcard search for numeric values using select ?

    Hi,
    I want do wildcard search for numeric fields of the table.
    For charcter/string i have used - select * from XX_TABLE where param1 like 'SS%'. But this query doesnt work when para1 is numeric. Please let me know first whether this is possible ? if yes how to achieve it ?
    Thanks in advance,
    Shrinivas

    Hi Jack,
    The numeric field is of  8 digits, so when i give search critera as '66', it should return values 66000000, 660000, 6600 etc. so i was not able to give between some range. I also tried storing all these values in internal table and the segregate the values it contains '66*'. This worked well but requires lot of coding effort.Please suggest if you guys have any better method ?
    Thanks,
    Shrinivas

  • How to search for multiple values with Bex Prompts

    Hi,
    I would like to know  if it is possible to search for multiple values at the same time with Bex Prompts instead of searching one value at a time (please see the screen shot below). I searched the forum couldn't find any relevant answers. please let me know  how  to achieve?
    Thanks,
    Charvi.

    Hi Charvi,
    You can use wild card search to ensure you get multiple similar values listed as search output.use * for multiple characters and ? for single character.
    For Example, Ravi * would result you all employees with first name as Ravi
    You can use various search formats such as * Ravi * and * Ravi and Ra?? etc.
    Thanks
    Mallik

  • How to search for a value in an iterator in Jdev 10.1.2?

    Hi!
    I need to search an iterator named "PermitYrIterator1" for a year value (e.g. 2009) that is stored in bindings.Yr in my jsp. How do I do this in my jsp's DataForwardAction Code) in Jdev 10.1.2?
    I need this in my "Create page." I need to search for this value because I want to check if I should re-execute the "PermitYrIterator1" so that it shows the newly added year in bindings.Yr or not. If bindings.Yr is found in the iterator then I do not need to re-execute the iterator. But if the newly entered year cannot be found then I need to re-execute the iterator.
    I hope you can help me immediately! Thanks!

    Hi,
    Anyone can help me on this please?

  • Search for Main Group Not all Subgroup

    Search for Main Group Not all Subgroup
    My illustrator project may have 5 main groups, which may all included 100 subgroups. I would like to search for main group without having to search through all subgroup, because too many and too long for the script.
    For the moment I have given a name to all Main group but the process is much too long.
    Marcel
    tell application "Adobe Illustrator"
                       activate
                              set groupCount to count group items in current document
                              repeat with i from 1 to groupCount
                                                    set selection of current document to {}
                                                    set groupRef to group item i of current document
                                                    set groupName to name of groupRef
                                                    if  (groupName contains "MainGroup") then
                                                                                          set selected of (groupRef) to true
                                                      display dialog groupName
                                                                        end if
                              end repeat -- with groupCounter from 1 to groupCounter
    end tell

    I don't do AS but this seems to be the culprit
    set groupCount to count group items in current document
    count your groups in the current "Layer" to narrow it down to main groups only, groups within groups will be ignored.

  • Program (PL/SQL) for count the registers of all tables in a schema

    Hi...
    I create a little program , for count the registers of all tables in the schema...
    If you need , send me your email...
    Atte
    Hector

    Hi,
    You can create a script by yourself by executing the script mentioned below:
    Connect as sys or system....
    SQL> spool test.sql
    SQL> select 'select count(*) from '||owner||'.'||table_name||';' from dba_tables;
    SQL> spool off;
    Hope this helps.
    Regards,
    -Praveen.
    http://myracle.wordpress.com

  • Can we export DATA from all tables in a schema?

    Hi,
    I have a question; Can we export all the DATA from all the tables present in the schema to any source (eigther CSV, TXT, DAt, etc..)?
    Or
    Can I have a PL/SQL procedure to display DATA from all Tables in a schema?
    With Best Regards,
    - Naveed

    Hi,
    This is pretty much what you need.
    DECLARE
    V_COUNT NUMBER;
    v_sql varchar2(1000);
    IN_OWNER_NAME VARCHAR2(100) := 'AP' ; -- SCHEMA NAME
    TYPE T_COL_NAME is table of varchar2(1000) index by binary_integer;
    v_col_tbl t_col_name;
    BEGIN
    FOR i in
    (SELECT object_name
    FROM dba_objects
         WHERE owner = IN_OWNER_NAME
         AND object_type ='TABLE'
    and rownum < 2)
    LOOP
    v_sql := 'SELECT COUNT(*) FROM ' || i.object_name ;
    EXECUTE IMMEDIATE v_sql INTO V_COUNT;
    if v_count > 0 then
    v_sql := 'SELECT * FROM ' || i.object_name ;
    select column_name
    bulk collect
    into v_col_tbl
    from DBA_TAB_COLUMNS
    WHERE TABLE_NAME = I.OBJECT_NAME
    AND OWNER = IN_OWNER_NAME;
    -- start selecting the column and exporting using the column names selected.     
    end if;
    if v_col_tbl.count > 0 then
    for i in v_col_tbl.first .. v_col_tbl.last
    loop
    DBMS_OUTPUT.PUT_lINE(v_col_tbl(i));
    end loop;
    end if;
    DBMS_OUTPUT.PUT_lINE( i.object_name || '-' || v_count);
    END LOOP;
    END;
    - Ronel

  • How to delete all rows in all tables of a schema in Oracle?

    Hi all,
    I want to delete all records of all tables of a schema and I think there should be some statement for this but I don't know how?
    may you help?
    Edited by: user8105261 on Nov 25, 2009 11:06 PM

    user8105261 wrote:
    Hi all,
    I want to delete all records of all tables of a schema and I think there should be some statement for this but I don't know how?
    may you help?
    Edited by: user8105261 on Nov 25, 2009 11:06 PMA typical way to reset a schema (e.g. to recreate a schema on the test database) is totally different.
    1) Drop the user
    2) recreate the user including table scripts from
    2a) your version control system
    2b) from a export dumpfile using the "nodata" option while importing

  • Droping all tables in a schema

    how to drop all tables in a schema with out logging in that schema and having logged in as sys user?
    Thanks in advance
    Edited by: Prasanna.N on May 17, 2010 11:48 PM

    Prasanna.N wrote:
    Hi,
    i get this error
    ERROR at line 5:
    ORA-06550: line 5, column 9:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
    following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-identifier>
    <a bind variable> << close current delete fetch lock insert
    open rollback savepoint set sql execute commit forall merge
    pipe
    when giving
    begin
    for t in (select table_name from dba_tables where owner = 'SCOTT')
    loop
    execute immediate 'drop table SCOTT.' || t.table_name || 'purge';
    end loop;
    /I just wrote for loop, of course you have to write inside begin..end block:
    begin
    for t in (select table_name from dba_tables where owner = 'SCOTT')
    loop
    execute immediate 'drop table SCOTT.' || t.table_name || '  purge';
    end loop;
    end;
    /

  • All columns of all table in one schema

    Hi
    All,
    Oralce 10.2.0.3
    I want to count all columns in all the table in one particular schema.
    How can I do that?
    which view i should use to count all cloumns of all tables in particular schema?
    Thanks

    vishal patel wrote:
    we needed for our data conversion project..I don't know how you'll use the number of columns in all a schema for data conversion. Some columns are duplicated (e.g. PK/FK), should they really count for two ?
    A data conversion means you should actually know what are the columns used for, not how many they are.
    one more question that count include hidden columns
    what is hidden column used for ? I can not see those columns in actual table.See here an example :
    Re: Difference btwn user_tab_cols & user_tab_columns
    Nicolas.

  • Need to grant DML privileges to all tables in few schemas

    Hi,
    I need to grant DML privileges to all tables in few schemas to a role. How can I achieve that?
    I thought it's below syntax but it doesn't work. Please advice.
    grant ALL ON ALL TABLES IN SCHEMA <Schema_name>  TO <role_name>;Thanks,
    Gangadhar

    GR wrote:
    Hi,
    I need to grant DML privileges to all tables in few schemas to a role. How can I achieve that?
    I thought it's below syntax but it doesn't work. Please advice.
    grant ALL ON ALL TABLES IN SCHEMA <Schema_name>  TO <role_name>;
    There is no single command to grant privileges at that level. There are either ANY privileges or privileges on an object.
    You can write a bit of code to generate and execute what you want, but you would have to rerun it if any new tables were created.

  • Grant select on all table of a schema to role

    Hi , is it possible to grant select on all table on a schema to a role?

    To grant SELECT on all tables of the current schema to particular role or user:
    SELECT 'GRANT SELECT ON '||TABLE_NAME||' TO READ_ONLY_ROLE;' COMMAND
    FROM (
    SELECT TABLE_NAME
    FROM ALL_TABLES
    WHERE OWNER = (SELECT USER FROM DUAL)
    Then copy and execute the result commands, eg:
    GRANT SELECT ON DEPT TO READ_ONLY_ROLE;
    GRANT SELECT ON EMP TO READ_ONLY_ROLE;
    GRANT SELECT ON DEMO_USERS TO READ_ONLY_ROLE;
    GRANT SELECT ON DEMO_CUSTOMERS TO READ_ONLY_ROLE;
    GRANT SELECT ON DEMO_ORDERS TO READ_ONLY_ROLE;

  • What privilege is needed to browse all tables in a schema

    I used SQLPlus to login to DB. When I clicked "table" in the left side window, no tables is shown. What privilege is needed to browse all tables in a schema?
    Thanks.

    SQL*Plus is a command-line interface. There is no side window to click on. Perhaps you're talking about SQL Programmer? Or are you talking about some other tool?
    What user are you logging in as? What user owns the objects? Do you just want to see that the tables exist? Or do you want to be able to see the data as well?
    Justin

Maybe you are looking for