Analysis of query and get the list of used tables

Hi all

I need to parse the sql query (simple & complex as well) and for a list of the tables used in the query.

And need to validate the fact that list the tables against a whitelist that is kept in the file.

I tried to write my own parser, because there are many ways to write complex queries, I'm unable to cover all scenarios.

I need help, is there other ways to get the list of tables used in a query?

Thank you

Manon...

In general you would add a condition 1 = 2 just to restrict the display of the entire table. Then should not be causing any noticeable performance degradation. You can even use ROWNUM< 2.="" that="" will="" do="" a="" count="" stopkey.="" which="" could="" be="">

SQL > select * from emp where rownum<>

no selected line

SQL > select * from table (dbms_xplan.display_cursor);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
SQL_ID, 97f4bd002xfy0, number of children 0
-------------------------------------
Select * from emp where rownum<>

Hash value of plan: 4269703525

---------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
---------------------------------------------------------------------------
|   0 | SELECT STATEMENT |      |       |       |     2 (100) |          |
|*  1 |  COUNT STOPKEY |      |       |       |            |          |
|   2.   TABLE ACCESS FULL | EMP |     1.    38.     2 (0) | 00:00:01 |
---------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):
---------------------------------------------------

1 Filter (ROWNUM<>

19 selected lines.

But its always good to bench mark it yourself.

Tags: Database

Similar Questions

  • Find ' [' and get the substring entered using regexp_substr()]

    Hello

    Select regexp_substr ("what a great day for (I YOU [ME] and HIM ',' [: ALNUM:] * [^ \ ()] *') double;")
    As a result:
    SQL > what a great day for

    [but why this model does not work for ']' when I replace ' ([' with ']'?)
    Select regexp_substr ("what a great day for (I YOU [ME] and HIM ',' [: ALNUM:] * [^ \]] *') double;")
    As a result:
    SQL > W

    ' {[I need to get a substring before or ' (',' [',' {', '}])', ']', or '}' in a string to give, this model works for '(',') ', ' {', '}' but not ' [' or ']'
    What should be the boss? If ' [: ALNUM:] * [^ \ ()] *' is not correct?

    Can anyone help?

    Thank you
    Fiona

    Hi, Fiona,

    Have you seen this part of my last post?

    Frank Kulash wrote:
    ... If you want to use a literal hook closing ('] ') then it must be the first thing in the list attached hook (not counting the ^, if you use it, you are)

    In a regular expression, if you want to say: "the set of all characters * except * ' {' and '}'", so it does not matter if you say

    [^{}]
    

    or

    [^}{]
    

    Most of the people (you and me included) seem to like the first better way, but the results are the same. It deosn to matter if the ' {' is listed before the '}', or if they are in reverse order. The Analyzer don't think you want to say something else anyway.

    However, the parser will treat this expression

    [^[]]
    

    different than

    [^][]
    

    The first:

    [^[]]
    

    is interpreted as

    '['          ||     -- Any character from this set:
       '^'          ||     --     all characters except
       '['          ||     --     left-bracket
    ']'          ||     -- (end of set description)
    ']'               -- followed immediately by a right-bracket
    

    You want to support the right to part of the whole. The only way that the parser will know that the right-braket marks not the end of the game is to put the right first overall support, in other words, it must be the first character inside the pair of brackets that delimited the game, immediately after the ' ^' character, like this:

    '['          ||     -- Any character from this set:
       '^'          ||     --     all characters except
       ']'          ||     --     right-bracket or
       '['          ||     --     left-bracket
    ']'               -- (end of set description)
    

    or, as you're more likely to write it:

    select      'What a good day for (YOU [ME] and {HIM}) and others'     AS orig_txt
    ,     REGEXP_REPLACE ( 'What a good day for (YOU [ME] and {HIM}) and others'
                     , '\[[^][]*\]'
                     )                         AS new_txt
    from      dual
    ;
    

    Output:

    ORIG_TXT
    ---------------------------------------------------
    NEW_TXT
    -----------------------------------------------
    What a good day for (YOU [ME] and {HIM}) and others
    What a good day for (YOU  and {HIM}) and others
    
  • How to operate the user enter value query and get the result on the text element

    Hello

    I'm really beginning to JDeveloper and ADF, I want to execute the query below, before with forms, I just add: TEXT_NAME to enhance the users entries, what should I do now with ADF, really unclear question and I would be grateful all help with that.

    Select
    NVL (min (substr (a.StartTime, 1, 8)), 0) Service_Start_Time, nvl (sum (a.sessionvolume), 0) Total_Traffic_KB
    Of
    aaa_bill one
    where
    msid =: TEXT_ITEM
    and starttime > = (select max (fee) FROM aaa_bill
    where msid =: TEXT_ITEM and accountreason = 5);

    You can use a form of parameter ADF for this requirement.
    https://blogs.Oracle.com/Shay/entry/combining_multiple_queries_and

  • How to make httpconnection and get the xml response using httpconnection in post method.

    Hello

    I am new to the blackberry web work,

    I want to make httpconnection using the post method and also pass a parameter related to my url.

    This function returns xml data.

    How can I perform this task.

    Please help me if anyone has a solution...

    I have soved that problem myself.

  • Is there a way to get the list of hosts and its groups of belonging to the vCenter folder level in 5.5 web vsphere client plugin development?

    Hello

    I need to get the list of all hosts and its groups of belonging to the vcenter folder level.

    1. I created a view giving the extension point: vsphere.core.folder.monitorViews.

    2. After this step, I wrote the constraint as in my class of mediator,

    var ListConstraint:Constraint =

    QuerySpecUtil.createConstraintForRelationship ( _contextObject, 'childEntity');

    I was expecting a list of all child entities such as hosts, dc, cluster... But I have only the immediate child object which is only the Datacenter as my result.

    Is it possible to get all hosts and vCenter folder level Clusters because I need the entire list to vCenter (highest level).

    Other info:

    Object file has only two properties:

    1 childEntity - list of entities

    2 childType in-kind folder ('Virtual Machine', 'Data center'...)

    Is it possible to write a constraint specifying which list of childEntities I need using childType in.

    Example: Make Me childEntities that has a 'Host' and 'Cluster' childType but childType in doesn't have these two types.

    In addition, at this level, I could see the 'Associated objects' tab which has all the information I need, such as Clusters and Cluster tab hosts and host tab respectively.

    So, I think its possible to get this list to vCenter folder level.

    I have attached a screenshot representing the need. Kindly ignore the Conventions of naming in there since I edited the example comes with the sdk program.


    Query:

    1. How can I get the host and Cluster (table of relationship) list to vCenter folder level or even at the level of the vise.global.view?

    2. once I get this list, is it possible for me to manipulate that list and send the new list to IU?

    3. is there another way to do the same thing without the help of model classes and mediator?


    Pointers to this will be very useful.

    It is not possible to obtain all hosts a folder specific vCenter from a single query Data Manager.  You need to get the list of centers of data first and then get a list of data center hosts.

    It is best to make these repeated requests to the java level and return only the list that you want to the user interface.

    You can get all the objects in the host of the system with a simple query using a constraint with targetType = 'HostSystem', but you will need to eliminate those from other vCenter servers.  See how this chassis example queries all hosts the Java later in the getHosts() method: samples/chassis-app/chassisRackVSphere-service/src/main/java/com/vmware/samples/chassisRackVSphere/ChassisRackVSphereDataAdapter.java

    Another option is to use the vSphere Web Services SDK to browse vCenter. See the vSphere management forum for help on these APIs.  See this plugin of the sample using this SDK

    samples/vsphereviews/vsphere-wssdk-provider/src/main/java/com/vmware/samples/wssdkprovider/VmDataProviderImpl.java

  • Try to use casStubs.jar classes and get the parameters of the analysis

    I went into class files available in casStubs.jar and was trying to come up with a script in the AppConfig.xml to connect to the CAS server and get the State of analysis and measures. I tried this option because the com.endeca.eac.toolkit.component.cas.ContentAcquisitionServerComponent class gives me these features.

    + < id script = "CheckCrawlStatus" > +.
    + < bean-shell-script > <! [CDATA [+]

    Import javax.xml.namespace.QName;
    com.endeca.cas.wsdl import. *;


    final String wsdlUrl = "http://" "${cas.host} '+': ' + ' ${cas.port} ' + ' / case? WSDL "; +
    final name of QName = new QName ("http://endeca.com/itl/cas/2010-07", "CasCrawlerService");
    CasCrawlerServiceLocator service = new CasCrawlerServiceLocator (wsdlUrl, name);
    CasCrawler robot = service.getCasCrawlerPort ();

    String crawlName = "myFirstCrawl";
    CrawlId crawlId = new CrawlId (crawlName);

    Metric [] metricArray = crawler.getMetrics (crawlId);
    + / / rest of the code to retrieve the crawl settings.

    +] > < / bean-shell-script > +.
    + < /script > +.

    Unfortunately, I still get connection refused to exception: ' java.net.ConnectException: connection refused ". My wsdl case load properly in my browser.
    Any ideas on gaps in the code or the missing configuration in the CASE or DT or platformservices?

    Thank you
    Dev

    Try to explicitly set endpoint to service before obtaining the port. So, if you connect to localhost:8500:

    service.setCasCrawlerPortEndpointAddress ("http://localhost:8500/AR"); ")

    You can substitute your host/port settings. This call is normally done through the box tool component wrappers, but since you are directly using the stubs of service, you will need to set the end point. Without this, the stubs use a test port that do not match your.

    Best
    Brett

  • Query to get the data of the column and the metadata in the same set of results.

    Is it possible to build a query to get the values of the columns in a table and also be able to get some metadata (data type, data_length, data_precision, data_scale) for columns in the same set of results.

    If I use a join, have a common value to join on the two tables?

    you use a cross join, not requiring common values.

    create table T (n number, d date, v varchar2(30));
    insert into T values (1,sysdate,'ABC');
    commit;
    
    select C.column_name, c.data_type, c.data_length,
    case c.column_id
     when 1 then to_char(T.N)
     when 2 then to_char(T.D)
     when 3 then T.V
    end VALUE
    from USER_TAB_COLUMNS C, T
    where C.table_name='T'
    order by c.column_id;
    
  • Analysis of chain to get the Timestamp, LV 2012 problem

    I have a VI I wrote in 2013 LV where it works very well.  But with the same VI in LV 2012SP1, analysis of string to get a Timestamp does not work.  Attached is the VI recorded in LV2012 SP1.

    Background:

    I work with an FPGA where I am synchronizing pulses using the clock of 40 MHz.  I connect these impulses in a file on my host PXI. To correlate the clock on the FPGA with a log file and real life someday, I named the file with a timestamp, and the meter 64-bit encoded hexadecimal string.  Now, I have a pretty good correlation between when the 64-bit against him and the time of day to facilitate the search of the data file.

    Now, I try to analyse the file name, so in my analysis of code I can reassociate the value 64 bits with the time of day using the string functions to separate the file name.  With a few regexes (which I've never used in real life before), I've broken down the chain and got the base time as a timestamp, and the counter value as a 64-bit integer.  The VI works very well in 2013 LV.

    But when I saved it to the LV 2012, analysis of string to get the timestamp fails.  No error, but the timestamp shows 19:00 12/31/1599 (I am GMT - 5).  I have no idea why.  A bug in the parsing of the string that was set in 2013 LV?

    Please run the attached VI in LV 2012.  Confirm if it fails for you.  Then open it in 2013 LV and see if it works for you.

    I am trying to make it work in LV 2012 because this project is locked in this version of LV for now.  I can probably do something to reorganize the time string to get something that will scan a digital time stamp if I have to.

    Hi Bill,

    Sorry to be a bit late on this point, I just came across this thread after the hunt for the CAR for a separate issue. The fix for 300375 CAR is what causes the difference in behavior between versions of LabVIEW. It appears on the list of known issues of LabVIEW 2013, although the description focuses more on the fixed number than other possible differences between the versions.

    The thoughts in this thread died on what happened in the difficulty. LabVIEW 2013 now pick up the string of year 2 or 4-digit number when you use the %y or %Y tags, respectively. Previously, the behavior was more forgiving in the year format, leading to incorrect behavior that you have observed strings of 4 digits in the year the %y tag. The original problem, you pointed out (2012 incorrectly string manipulation of tagged %y (2 digits) 2-digit year is precisely what has been fixed in the CAR.

    Regarding your strange result over the years with the tag %Y-2 digit, this is a limitation of the type of data Time Stamp itself. The year will always be converted to between 1600 and 3000. So no time extreme travel journaling. Yet.

    See you soon,.

  • Query to get the flex field values description.

    Hello

    Entering invoices-> all the Distributions screen 'Special Mentions for the India' is here. Here we enter the value for the field TDS - tax. I want to get the list of values for TDS - tax in a query.

    Can you please help me.

    Thank you

    Nanga.

    where 'jtc.tax_type =' TDS

    and jtc.section_type = 'TDS_SECTION. '

    and org_id =: inv_sum_folder.org_id

    and jtc.section_code in

    (

    Select section_code

    of jai_ap_tds_th_vsite_v

    where vendor_id =: inv_sum_folder.vendor_id

    and vendor_site_id =: inv_sum_folder.vendor_site_id

    )

    order of jtc.tax_id

  • Get the list of the names of cache

    I use this code to get a list of all the names of my cluster cache:
    ------

    Cluster cluster = CacheFactory.ensureCluster ();
    for (enumeration < String > = cluster.getServiceNames services (); services.hasMoreElements () ;))
    {
    String sName = (String) services.nextElement ();
    System.out.println("service:"+sName);
    Service service = cluster.getService (sName);
    If (service instanceof CacheService) {}
    CService CacheService = service (CacheService);
    Caches of list < String > = cService.getCacheNames ();
    for (caches = cService.getCacheNames (); caches.hasMoreElements () ;){)
    Add caches.nextElement () in a list
    }
    }
    }

    ------

    It works fine, but in order to access multiple clusters, I have to use proxy/extend coherence.

    When I use the proxy/extend, the code above no longer works. I explain: when you use proxy/extend, cluster.getServiceNames () returns the Management and Cluster but does not return the Cache Services more.

    I tried to get a group in a different way object:

    . GetCluster (CacheFactory.getConfigurableCacheFactory () .ensureService ("ExtendTcpInvocationService") (InvocationService));

    where ExtendTcpInvocationService is defined with < remote-invocation-diet > but the result is the same.


    To summarize : I would like to get the list of all my names of cache in an application of several cluster; is this possible?

    Hello

    Yes, your invoked must be on the classpath of the server and you use POF, it must also be in the configuration of the server POF file.

    The best way to find the names of cache on the server without needing to code on the cluster must use JMX - assuming that you have enabled JMX on the cluster. You can easily run a JMX to Java code query or use something ike JConsole of VisualVM...

    JK

  • Is there a way to get the list of open URL of file (.dmp) incident, mdmp [NOT BE]

    Hello

    My Firefox session crashed, which was little in private meetings. I have the mdmp (.dmp file) dump file saved. Is there anyway that I can get the list of URLS open in private in windows.

    If so, how to read the file OR open it for debugging.

    Kind regards
    bnrsubs

    All data are kept in memory during the session in incognito mode and will never be saved on the hard disk, so these data are available for normal use and things like restore closed tabs and windows and cookies still function as in a normal session, but this data is deleted from all the private browsing mode Windows Open (tabs) are closed.

  • How do you get the list of bookmarks affixed permanently on the left side of the screen?

    I managed to get the bookmarks permanently open and displayed in a vertical column on the left side of the screen. I accidentally closed and cannot get it to appear again. How do you get the list of bookmarks permanently opened and displayed again? Thank you.

    You can enable or disable the power bookmarks bar by ' display > lateral bars > bookmarks "or Ctrl + B

    You can enable or disable the sidebar story power by ' display > lateral bars > History "or Ctrl + H

    Press the F10 key or press the Alt key to bring up the 'Menu Bar' temporarily if the menu bar is hidden.

  • Libretto U100 Bluetooth error message indicates - getting the list of files fail

    Hello

    I try to connect my Libretto U100 Bluetooth to a new Sony Ericsson mobile software Bluetooth for exchanging information.

    I can connect and see the files on the mobile phone, but when I click on the folders, there is an error message indicating "getting the list of files doesn't have."

    New drivers must or is there something else I need to set up at all?

    Previously, I was able to connect to any other mobile phone with no problems.

    Thank you in advance for help you.

    Hello

    I m sure that it s is not a Bluetooth problem or a cell phone if it s possible to connect Sony Ericsson and other mobile phones. Unfortunately, I'm not very familiar with this laptop but I found this site with FAQ on your mobile phone.

    http://www.Ericsson.com/Contact/FAQ.shtml
    http://www.Esato.com/Help/FAQ.php

    In addition, you should check the manual of the phone. I sure you will find a description of m

    Good luck

    Good bye

  • In Windows Media Player 11 when spend to add songs, how get the list to stop starting at the top?

    With WMP11, when adding pieces of the current reading library, I often change between two tabs. My question is every time I switch back to the library to add more songs, tab how can I get the list to stop starting at the top? I have a number of songs scrolling on there where I left last can be very inconvenient. I remember with an older version when you leave the library, that he would stay where you left it. Yet once, how can I stop the library always start at the top and instead pick up where I left off?

    Thank you very much

    Reinstalling wmp11

  • Problem with DVD player and get the error code 19 Device Manager

    Original title: TSSTcorp CDDVDW SH - 224DB ATA device

    Windows cannot start this hardware device because its information of configuration (in the registry) is incomplete or damaged. (Code 19)

    How to fix it please Message Please please how to fix it

    Hi Emerald,

    Please contact Microsoft Community. I understand that you have a problem with the CD\DVD drive and get the error code 19 Device Manager. I've surely you will help solve this problem.

    To better understand the issue, I would like to know if you have any recent software or hardware on the computer changes before this problem?

    This problem might have occurred because of these reasons:

    1. Install or uninstall the CD or DVD recording programs.
    2. Uninstall Microsoft Digital Image.

    Try the steps listed here and see if it helps:

    I suggest you try the procedure described in article which will correct corrupted registry entries. Check if it helps.

    Your CD-ROM or DVD drive is not recognized by Windows or other programs
    http://support.Microsoft.com/kb/314060/en-us

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information on how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    Hope this information helps. Reply to the post with an up-to-date report of the issue so that we can help you further.

Maybe you are looking for

  • No. Save button in ff 38

    When I go into options to change the setting of the page there is no record button click on when the operation is complete. so, how do save you changes?

  • How to re-download the messages from the server

    On my first PC with Windows 7-64 bit, I have my server settings to leave messages on the server for 55 days. I need to re-download the old messages in Thunderbird probably because of some problems with Time Warner Road Runner sometimes a blacklist em

  • Failure motherboard on Qosmio G30-175

    My G30-175 simply refused to power one morning without warning and in the middle of important work. And after about 3 weeks without a backup. At first, I thought it was a power supply problem and taken to a store and tried other adapters sector and b

  • Cannot receive e-mail from specific sender

    I was sent an important e-mail from the Student Finance regarding my student loan, but on student finance site it says that users of microsoft accounts cannot receive e-mail from them and I need to contact my provider.  I find the Microsoft support W

  • Premium Fax C309a series

    Everything worked well for about 2 years when one day appeared a rattling noise (the stronger at the lower left front of the printer) with flashing of the display and all the buttons on the front.  Front power switch has no influence whatsoever so ha