How to look for a certain value in a database using sql

Hello everyone. How do you do this in SQL? Or, is there a way to look for a certain value in a database? What I'm trying to do is this:
I want to look for the exact value "abcdefg" in the database so that oracle will return me details on the following that contains the said value:
1. the name of the table(s)
2. the column/field name(s)
Note: "abcdefg" could exist in different tables with different column names with different data types.
Any help is much appreciated. Thanks.
UPDATE: What about if I just want to check those fields/columns with string data types?
Message was edited by:
dongzky
Message was edited by:
dongzky

Just a teeny tweek
DECLARE
   l_dummy   VARCHAR2 (4000);
BEGIN
   FOR rec IN (SELECT table_name
                 FROM all_tables)
   LOOP
      FOR rec2 IN (SELECT column_name
                     FROM user_tab_cols
                    WHERE table_name = rec.table_name)
      LOOP
         BEGIN
            EXECUTE IMMEDIATE    'select 1 from '
                              || rec.table_name
                        || ' where to_char('
|| rec2.column_name
|| ') = ''CAS'' and rownum = 1'
                         INTO l_dummy;
            DBMS_OUTPUT.PUT_LINE (rec.table_name || ' ' || rec2.column_name);
         EXCEPTION
            WHEN NO_DATA_FOUND
            THEN
               NULL;
         END;
      END LOOP;
   END LOOP;
END;

Similar Messages

  • How to get Operating System Space Info from Oracle database using SQL

    Our oracle databases are installed on Unix operating system. Currently our DBA wrote a view to get space info of table spaces and He is requesting me to add Operating system level(file system) drive space info to the same report.
    Can you please let me know the easiest way to get this information to sql table so that it can be used for reporting purposes?

    You should be able to create a shell script with the OS commands to generate the information for the mount points that you want to access in Oracle, then read it in as an external table using the preprocessor feature of external tables:
    http://download.oracle.com/otndocs/products/database/enterprise_edition/utilities/pdf/xtables_preproc11g_1009.pdf

  • How to look for the Table Name

    Hi Friends,
    Sometimes we need to download the table for the desired information if the same is not available from a particular report. How to look for the table name? Is there a report or a particular feild, where we can find the name of the particular table?
    Thanks for the assistance.
    Regards

    Hi Friend,
    If you want to see the structures then go to SE11. Sometimes it happens that you cannot find the table names but only fields. In such case, if you want to find the Table names which is not available, then go to SE90.
    Abap Dictionary > Fields > Table Fields.
    Now Enter the Field name in Right Hand Side of the screen then Execute. You will see the all tables by which that Fields are used.
    Regards,
    Jigar

  • How  to  look for  fi doc  number in cj88

    HI  expert:
          when I  run cj88.   the system generate FI  doc number.   how to look for FI doc number.
    can you tell me !
    thank you !!!!

    Hi,
    You can see the FI Doc. thru' given instruction
    Go to T-code CJI3 then fillup the WBS no. in which you want to see the Settlement document.
    Execute then filter up document type AA  double click on this & click on FI document.
    Hope it will solve your problem.
    Regards,
    Vishal Kr. Sharma

  • How to look for kMAT material in Testing client?

    Hi PP members:
    How to look for KMAT material in Test client,
    Note: I went to mm60 and entered material type: KMAT it did not populate any
    materials
    Is there any way where I can find the materials, If yes please let me know
    thanks
    Suren

    Hi Saritha:
    When I went to SE16, and entered MTART as KMAT it giving the following
    It is replying me back "No table entries found for specified key"
    Also want to bring to your kind attention I left MATNR field blank as I donot know
    the VC materials
    thanks

  • How to look for business partner number in GTS

    Hi Experts,
    How to look for the business partner number in GTS when we have the Customer Id number in r/3?
    Please let me know the path in GTS.
    Edited by: Anurag87 on Dec 9, 2010 2:17 PM

    Hello,
    just simple in GTS in transaction BP find by "3 External number" (which is yours R/3 number).
    Or in se16 table /SAPSLL/PNTBP type in field BPVSY you external number from R/3 system.
    Cheers,
    Gabriel.

  • How to look for a keyword in SAP MaxDB Library 7.6

    Hi,
    how to look for a keyword in SAP MaxDB Library 7.6 ( http://maxdb.sap.com/doc/7_6/7e/c3fb0e72fcf84580f7ee9fcec672b7/frameset.htm)
    Thank you.

    http://maxdb.sap.com/documentation/
    =>
    Section u201CDownloadu201D - HTMLHelp file < 7.8 or 7.7 version >
    HTMLHelp file
    .chm, full text search, print-optimized, 6.3 MB
    < download it or open it >
    < If downloaded, Then start on your server:
           maxdb-chmdoc-en-78_740.chm   >
    and type a keyword in field u201CType in the keyword find:u201D and search.
    Itu2019s working fine.
    Regards, Natalia Khlopina

  • How to look for sales order number if I know outbound delivery number?

    How to look for sales order number if I know outbound delivery number?

    Hi ,
        If you want to see the Sales order Number from Outbound delivery or invoice,go to their respective T-codes,say for example,
    for delivery,Goto Tcode: VL02N / VL03N.There you will find Document Flow Icon,click on that,or press F7.
    You will get a window,there you can see the Sales order Number before your outbound delivery Number
    With Thanks and Regards,
    Priya

  • How to search for a certain cross reference using its name in FM 11?

    How to search for a certain cross reference using its name in FM 11?

    Well, thank you. I am only using Find dialog box. By "name", I'd like to give an example. The background is FM 11 structured. I have an element "xref" which is used to make cross reference. Now In Chapter 1, there is a sentence like "This is an ODU for ...". I made a cross ref of the word "ODU" to its full name "outdoor unit" in Chapter 2 (in the same book). After this, the word "ODU" in the sentence in Chapter 1 will no longer be a plain text. So I no longer can use the find dialog box to search for "ODU" because it is already an xref rather than text. I am not if it's clear.

  • How to eliminate # for empty date value in BEx Analyser

    Hi Gurus,
    Can any one please let me know how to eliminate # for empty date value in BEx Analyser.
    Thanks in advance
    peter

    Hi
    add the following macro to your workbook (template workbook):
    Sub SAPBexonrefresh(qstring As String, resultArea As Range)
    For Each c In resultArea
    If LCase(c.Value) = "not assigned" Then c.Value = ""
    Next
    End Sub

  • How to look for spaces in an extract file in order to trigger a MOVE_IT rule

    In studio I am defining a variable field on a section and I want to pull information from my extract file using a simple MOVE_IT rule. 
    I am trying to pull information from a record that has spaces in columns 10-14.  How do I enter the information required in the DATA field to request this? 
    For example, if I was pulling the information from a record that had "XXXXX" in column 10-14 I know the DATA field would be 10,XXXXX
    I cant seem to figure out how to look for spaces at a particular offset.
    Thanks.

    Using XPath to locate the elements you are after is very easy.
    Try something like this:
    import java.io.File;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.xpath.XPath;
    import javax.xml.xpath.XPathConstants;
    import javax.xml.xpath.XPathFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.NodeList;
    import org.xml.sax.InputSource;
    public class BasicXMLReplaceWithDOM4J {
         static String inputFile = "C:/student.xml";
         static String outputFile = "C:/studentRenamed.xml";
         public static void main(String[] args) throws Exception {
              // Read xml and build a DOM document
              Document doc = DocumentBuilderFactory.newInstance()
                        .newDocumentBuilder().parse(new InputSource(inputFile));
              // Use XPath to find all nodes where student is named 'Suresh'
              XPath xpath = XPathFactory.newInstance().newXPath();
              NodeList nodes = (NodeList)xpath
                   .evaluate("//stud_name[text()='Suresh']", doc, XPathConstants.NODESET);
              // Rename these nodes
              for (int idx = 0; idx < nodes.getLength(); idx++) {
                   nodes.item(idx).setTextContent("Suresh-Renamed");
              // Write the DOM document to the file
              Transformer xformer = TransformerFactory.newInstance().newTransformer();
              xformer.transform(new DOMSource(doc), new StreamResult(new File(outputFile)));
    }- Roy

  • How to search for the list of portal components that use a certain LOV?

    hi,
    does anyone know how to search for all of those portal components which use a certain other component?
    let's make it specific. how can i know which of the portal components (portal reports and forms, content folders, etc) are using any certain LOV?
    will really appreciate any hints.
    naqvi

    Please ask this question in the Oracle Text forum (formerly interMedia text). You will get the experts that work with it every day there.

  • I am looking for a movie app that i can use that is free and i that i can just download the movie and watch it

    i am looking for a movie app that i can use thats free i just want to download some movies and just watch them thats all  can somone plz help me

    iTunes Store app is free
    No movies are free, unless you pirate them. Discussing that isn't allowed here.
    You can get movies for near-free with apps like Netflix and some others.

  • I am looking for a way to automate index creation using Adobe Reader Pro without having to use the screen user interface, as the indexing has to be run by a batch process.

    I am looking for a way to automate index creation using Adobe Reader Pro without having to use the screen user interface, as the indexing has to be run by a batch process.

    [discussion moved to Creating, Editing & Exporting PDFs forum.]

  • Do i have to charge my replacement macbook pro batter for a certain amount of time before using the computer?

    do i have to charge my replacement macbook pro batter for a certain amount of time before using the computer?

    First, if you have a Late 2008 or older MacBook Pro, you should calibrate the battery, as the battery for these MacBooks don't come precalibrated > http://support.apple.com/kb/HT1490?viewlocale=en_US&locale=en_US
    Then, the battery should come charged, so use it until the battery percentage is low, and then, charge it. You can use your Mac while your battery is being charged, and your MacBook will stop charging the battery when your battery is full, so you can unplug it at any moment

Maybe you are looking for

  • How to fix file system error 56635 in windows 8.1

    heelo pls help me to fix this problem i cant install any on my laptop. file system error 56635 is showing  up wen i install my kaspersky 2015

  • Can I use GarageBand to record live from an external soundboard?

    My Church Band uses a sound board to play, and have asked me to do a video of the next performance. I want to capture the sound, using the band's soundboard. I can hook that up to my MacBook Air via USB cable. But then what do I do? How do I pipe the

  • Can't print a PS file from FM8 in Windows 7 (64-bit)---Help!

    Hi, can someone help with this? I recently got a new laptop with Windows 7 (64-bit) & I use FrameMaker 8. I cannot install my previous PS driver as it says it's not compatible with this version, so I downloaded both the Xerox Global & HP Universal PS

  • Save multiple data independen​t

    Hello, Can you tell me if it is possible to save data from multiple channels, each channel with a different save trigger? I have a cycIing machine and I need to record data from 6 channels, (that are not synchronized - different part of cycling for e

  • I can't turn my IPad on

    I can't turn my IPad on. I have tried restarting it and the Apple Icon will show up but it is still not working. What should I do?