Function to check for the existence of the table

Hi all

Is there a direct function that can let me know whether or not a particular Table exists in Oracle DB.

TIA

See you soon,.
Parag

There is no function to check, but we can write our own logic to check if it exists or not.

CREATE OR REPLACE FUNCTION CHK_TABLE(P_TABLE_NAME IN VARCHAR2) RETURN VARCHAR2 AS
M_EXISTS VARCHAR2 (1);
NUMBER OF M_CNT;
BEGIN
SELECT COUNT (1) IN M_CNT
FROM USER_TABLES HAS
WHERE A.TABLE_NAME = UPPER (P_TABLE_NAME);
IF NVL(M_CNT,0) = 0 THEN
M_EXISTS: = 'N';
ON THE OTHER
M_EXISTS: = 'Y ';
END IF;
RETURN NVL(M_EXISTS,'N');
END CHK_TABLE;
/

Satyam.

Tags: Database

Similar Questions

  • Windows cannot check for the error code 80070424 updates.

    I have windows vista premium x 64
    Windows Update stopped working and when I they do it manually it says windows cannot check for the error code 80070424 updates.
    I searched everywhere for an answer... Please help

    ----

  • java.sql.SQLException: JDBC LLR, table check failed for the table ' WL_LLR_ADMI

    Hello

    I am trying to install OSB in a different domain. I already have a suite of soa running.

    This is the directory structure
    Middleware/user_projects/domains

    (a) soa_domain
    (b) osb_domain

    Who, from the administration server for the BSO, I get error below.


    Error: -.
    < server failed. Reason: Last forest resource [JTAExceptions:119002] failed during initialization. The server cannot start unless all configured logging last resource (LLRs) initialize. Fault reason:
    javax.transaction.SystemException: weblogic.transaction.loggingresource.LoggingResourceException: java.sql.SQLException: check table JDBC LLR, failed for the table "WL_LLR_ADMINSERVER", line ' JDBC LLR field / / server ' record had an unexpected value ' soa_domain / / AdminServer' expected ' osb_domain / / AdminServer'* ONLY the domain and the server that creates a table original LLR can access *.



    I see the solution in https://blogs.oracle.com/epc/entry/technical_table_verify_failed_for but I have no doubt here.

    When I run

    Select RECORDSTR in the WL_LLR_ADMINSERVER where
    XIDSTR = "field of LLR JDBC / / server ';"

    I get the result like-> soa_domain / / AdminServer


    If I change it to osb_domain / / this AdminServer, will affect my soa_domain server... ? Please advice

    Published by: user10720442 on December 11, 2012 11:54

    Hello

    There are two possible solutions to this problem:

    Solution 1:

    To solve this problem reconfigures the basic information database of Point differently for each domain, if you have more than one domain. That, to change the port of the database and the name below two files in the field

    In the setDomainEnv.cmd (or .sh) file inside directory change DOMAIN_HOME/bin Point base port number and the name of the comic.

    Set POINTBASE_PORT = 9094
    Set POINTBASE_DBNAME = weblogic_eval2

    JDBC:PointBase:server://localhost:9094 / weblogic_eval2

    In the file wlsbjmsrpDataSource - jdbc.xml inside change DOMAIN_HOME/config/jdbc directory under entries with port of pointbase database updated and the name (this will be in two places in the file).

    Solution 2:

    If the domain name has been changed and do not want to change the database properties, then an update to the WL_LLR_ADMINSERVER table is possible:

    that is to say:
    Update SCHEMA_SAMPLE. Set RECORDSTR = WL_LLR_ADMINSERVER ' base_domain / / AdminServer' where XIDSTR = "JDBC LLR field / / server ';"

    Kind regards
    Kal

  • How to check for the two first digits?

    Can someone please... There is demand to have a hidden field on the form that will be filled with data. It's going to be 6 digits long and could start with 02 or 04. I need to check on the DocReady event, for the first two digits. If the first two digits are 02, the presentation of the form will remain as it is. If the first two numbers are 04, I'll have to show two hidden subforms. Can someone please provide an explanation on how to check for the first two digits of field 6 digits and do some actions.

    Thank you very much

    No, only in the event: Exchange.

  • primary key for the table

    I have a Gr_order table that was settled long ago, and now he needs to be filled
    with some more search data.

    "Orderid" is a primary key for the table, but the question is how can I insert "orderid" in the insert statement in the procedure. I couldn't find any name sequence. There are 1230
    documents that must be inserted.
    Desc Gr_order
    Orderid  Number Primary key
    Desc     Varchar2
    INSERT INTO gr_order (orderid,desc)  
    VALUES (???, upper(each_pom.desc);
    Thank you
    Sandy

    You can find the code that inserts into the table and see if it uses the sequence ;-). A sequence is not 'attached' to a particular table - this is the insert statement to determine whether a sequence should be used.

    You can check if the table has a trigger - some developers like to emulate the behavior of MS - sql server by having a trigger on the table that selects in a sequence. If it has such a release, then you just do your insertions without specifying order_id. But if the table does not have such a release, then you cannot know if the table was originally filled using a sequence or not (unless you can find the instructions for inserting somewhere).

  • Iterator for the table and form is a problem during the cleaning of the records

    Hello

    I use JDev 12.1.2.

    I have an object of the detail view. I represent a part of its fields in a table and the rest in a form. I use the same iterator. Basically, I dragged and dropped the object even from the view of the data control and created a table and form layout with the fields I wanted in each provision. I put in place a clear feature for the rows in the table with a clear"" key. -on click I delete the line of the iterator in the managed bean. When I do this the selected record is deleted and the next record is displayed. But fields entered in the form layout also gets deleted. (the form should also be showing the record currently selected - it shows but entrable fields in the form are deleted because of claire that I did on the previous line.) If anyone can help get this resolved?

    Not use the same iterator for the tables and forms here? The links are in the row (row.bindings...) for the table, but for the form it is (links...). The Delete on the current row operation is causing the iterator delete all fields of links instead of from the line? Please shed some light.

    Thank you

    UMA

    How do you rank on the iterator compensation?

    use resetActionListener in your clear button and let us know what is happening?

    Ashish

  • How can I exclude a level for the table of contents, but this amount as a bookmark?

    I know how to exclude a level for the table of contents (or rather include only levels I want to be included) and also how to create bookmarks from the table of contents entries, but how can I exclude a level for the table of contents, but always include it as a bookmark?

    Make 2 toc styles. One for the entries in the Bookmarks panel, you can generate a table of contents on the side of any page, and you must score in its definition to create bookmarks and other things that you use to build the table of contents for the visible part of your document to print. This should have unchecked the option create a bookmark in its definition.

  • variable binding can be used for the table in an explicit cursor

    I have an application that accesses a table on several different servers. I created a ref for the slider cursor variable and a varchar2 variable to define my query. variable I_server is a parameter to my procedure. Is it possible to rewrite the v_query using bind variable for the table/Server? I have included below v_query.

    v_query: = "SELECT rp.usr_id, rp.sun_sft_cat, rp.sun_start, rp.sun_hrs," |
    "rp.mon_sft_cat, rp.mon_start, rp.mon_hrs, |
    "rp.tue_sft_cat, rp.tue_start, rp.tue_hrs, |
    "rp.wed_sft_cat, rp.wed_start, rp.wed_hrs, |
    "rp.thu_sft_cat, rp.thu_start, rp.thu_hrs, |
    "rp.fri_sft_cat, rp.fri_start, rp.fri_hrs, |
    "rp.sat_sft_cat, rp.sat_start, rp.sat_hrs, |
    "rp.sun_sft, rp.mon_sft, rp.tue_sft, rp.wed_sft, |
    "rp.thu_sft, rp.fri_sft, rp.sat_sft, nvl (ei.wip_permanent_sched_seq, 0) ' |
    'FROM ' | I_server | "rp, wip_emp_information ei, |
    'wes, wip_emp_status_type West wip_emp_status' |
    "WHERE rp.usr_id = ei.employee_id' |"
    "AND wes.employee_id = ei.employee_id' |"
    "AND wes.status_type = west.status_type' |"
    "AND west.description =" STOREKEEPER "' |"
    "AND wes.effective_date = (SELECT MAX (wes2.effective_date)' |)"
    "OF wip_emp_status EMTE.2 |
    "WHERE wes2.status_type = wes.status_type' |"
    "AND wes2.employee_id = wes.employee_id' |"
    (' AND wes2.effective_date < = trunc (SYSDATE))' |
    "AND wes.status = rp.wk AND"Y"= 1'; -wk = 1 is the schedule for next week

    Rp_sched_cursor OPEN FOR v_query;

    If your intention is to do this:

    v_query := 'SELECT rp.usr_id, rp.sun_sft_cat, rp.sun_start, rp.sun_hrs,' ||
    ' rp.mon_sft_cat, rp.mon_start, rp.mon_hrs,' ||
    ' rp.tue_sft_cat, rp.tue_start, rp.tue_hrs,' ||
    ' rp.wed_sft_cat, rp.wed_start, rp.wed_hrs,' ||
    ' rp.thu_sft_cat, rp.thu_start, rp.thu_hrs,' ||
    ' rp.fri_sft_cat, rp.fri_start, rp.fri_hrs,' ||
    ' rp.sat_sft_cat, rp.sat_start, rp.sat_hrs,' ||
    ' rp.sun_sft, rp.mon_sft, rp.tue_sft, rp.wed_sft,' ||
    ' rp.thu_sft, rp.fri_sft, rp.sat_sft, nvl(ei.wip_permanent_sched_seq, 0)' ||
    ' FROM ' || :b0 || ' rp, wip_emp_information ei,' ||      --- Note the bindvariable...
    ' wip_emp_status wes, wip_emp_status_type west ' ||
    ' WHERE rp.usr_id = ei.employee_id' ||
    ' AND wes.employee_id = ei.employee_id' ||
    ' AND wes.status_type = west.status_type' ||
    ' AND west.description = ''WAREHOUSE EMPLOYEE''' ||
    ' AND wes.effective_date = (SELECT MAX(wes2.effective_date)' ||
    ' FROM wip_emp_status wes2' ||
    ' WHERE wes2.status_type = wes.status_type' ||
    ' AND wes2.employee_id = wes.employee_id' ||
    ' AND wes2.effective_date <= trunc(SYSDATE))' ||
    ' AND wes.status = ''Y'' AND rp.wk = 1'; -- wk = 1 is next week's schedule
    
    OPEN rp_sched_cursor FOR v_query USING i_server;
    

    So the answer is: no, you can do that.

    But then, my question would be: why would you do that?
    I guess that you have many "different servers. A cursor on the server will not hurt you.

  • JDev11g - prevention of query for the table running until ExecWithParams press

    JDev 11 g ADF-Faces with task flow creation web app - test a single page.

    I have five variable bind I have installed with reference LOV to display the name return ID's, two are dates that work now! I have the ExecWithParams button, then on a table that uses a VO with a custom query with the dregs.

    I need links to be filled, but the page takes a while to load, and my guess is that the request for the table tries to run, but does not receive all the data since the lie is empty at the start. The query runs great once I have complete binding and press the ExecWithParams button.

    How can I stop the query in the table to run until the ExecWithParams button is pressed? I'm guessing that this is the problem since it takes several minutes when the link to the browser is launched and makes the page actually. All requests for links are very simple, while the request of VO is very complex. Or maybe something else wrong that I'm not getting?

    Thank you, Ken

    Something that I use occasionally is the substitution of the VO executeQuery method.

        public void executeQuery() {
            if (getWhereClause() == null){
                setWhereClause("1=2");
            }
            super.executeQuery();
        }
    

    It works for running dynamic bind variable.

    For your case, you could do something like...

        public void executeQuery() {
            if (getNamedWhereClauseParam("YOUR_BIND_VARIABLE") == null){
                setWhereClause("1=2");
            }
            super.executeQuery();
        }
    
  • How to check for the application ID in a function of connection?

    Hello

    I have a connection procedure which is something like this:
    wwv_flow_custom_auth_std.login(
        P_UNAME       => :P58_USERNAME,
        P_PASSWORD    => :P58_PASSWORD,
        P_SESSION_ID  => v('APP_SESSION'),
        P_FLOW_PAGE   => :APP_ID||':15'
        );
    And the authentication procedure is this:
    create or replace
    FUNCTION  "ACL_CUSTOM_AUTH" (
        p_username IN VARCHAR2,
        p_password IN VARCHAR2
        )
    RETURN BOOLEAN IS
    BEGIN
      FOR c1 IN (SELECT 1 
                  FROM acl_employees
                 WHERE upper(userid) = upper(p_username)
                   AND mot_de_passe = p_password)
      LOOP
        RETURN TRUE;
      END LOOP;
      RETURN FALSE;
    END;
    I want to check for an application in the acl_employees table ID, because I want to check if this user is credited for THIS specific APP_ID, adding a following kind of code to the function of authentication:
    AND application_id = :app_id)
    The problem is that the connection API takes in charge only two parameters for custom authentication: user name and password. How can I switch the APP_ID to authentication?

    Thank you for your help.

    Christian

    Published by: France Christian February 23, 2010 06:23

    Published by: France Christian February 23, 2010 06:24

    It is sometimes easier to check the user before calling the connection custom Apex then past just a password to NULL to the connection works if the check fails. Something like that before the connection:

    DECLARE
    v_dummy NUMBER;
    BEGIN
    SELECT 1
    INTO v_dummy
    FROM acl_employees
    WHERE upper(userid) = upper(p_username)
    AND application_id = :app_id;
    EXCEPTION WHEN NO_DATA_FOUND THEN :P58_PASSWORD := NULL;
    END;
    
  • Error "function not allowed for the license.

    Hi all

    I get error "Function not allowed for license" when I'm collecting details of a custom user interface card.
    The user interface card called a Business Service that calls a service program.
    I wrote a page for the service program service.
    This error indicates which license?

    I use the BCC 2.3.1 and Eclipse SDK 2.2.0.5.

    Check the Admin Menu-> Installation Options framework-> Modules available to see if any module is disabled.

    Then go to the Menu Admin-> Configuration-> Feature Type = Module of Configuration feature and delete an entry of a module where the power is off.

    Try again the user interface card

  • Check for the required amount - point application

    Hello

    During the creation of point of Application, we get a drop down menu where we have to choose

    1 check sum required - Application level
    2 check amount required - user level
    3. check sum require - Session survey


    I'm creating an application-level element that allows to store USER_ID and ACCESS_LEVEL using the query
    «SELECT USER_ID, ACCESS_LEVEL IN FX_UID, FX_ACCESS_LEVEL FROM USERS WHERE UPPER (EMAIL_ID) =: APP_USER.»

    My question is what is the function of each of them and that will be suitable for the review above the request in the light of these values are used in the authorization of the page. If Access_level = 3, all pages are made available where as if Access_level is 1 then only read_only is enabled for the user.


    Thank you
    Shijesh

    OK, now I see what you were saying before. Then use this setting that I have described, and that should be all you need. Furthermore, your statement "select into" must reference the elements of the application as a bind variable.

    Scott

  • Check for the presence of malware

    How can I check for viruses/malware on my iMac with OS X El Capitan

    Go to http://www.etresoft.com/etrecheck , download and run EtreCheck, copy paste here the status report.  If there is any malware/adware on your system, it will appear, and then we'll tell you how to dispose of it here.

  • When I trouble shoot for why my printer is not working, it tells me that there are no drivers installed for my HP 6500 printer. How can I get one installed for her and where to check for the driver

    Our broken computer and we have relocated our software for our accounting program.  When we go to print, it does nothing.  Help out us and we were told that the printer, a 6500 Officejet from HP A doesn't have a driver.  How to get a driver on the computer it recognizes as one of the printer

    Hello Stephen,

    You can go to your printer manufacturer's Web site to download the driver for HP Officejet 6500 all-in-one printer from the link below.

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?product=3795314&LC=en

    Select your operating system , and then click Next. Follow the prompt to choose either the full

    the function print driver or the basic copy, scan driver.

    Good luck.

  • I also get the error code 80070005 when you try to use Windows Update to check for the updates

    I get this error code as soon as I try to check updates. It does not even say there are updates tells me to enable updates, but when I try it gives the code. I used Microsoft Fix and now it says everything is fixed and ok but it is not. So now what?

    Hello

    1. what Microsoft fixit did you run?
    2. don't you make changes to the computer before the show?

    I suggest you try the steps from the following link:

    Error: 0x80070005 when you try to install updates by using Microsoft Update or Windows Update
    http://support.Microsoft.com/kb/968003

    Note: When you perform a virus scan Malware, you will lose data that are affected by the virus. Microsoft is not responsible for the loss of this data.

Maybe you are looking for

  • only pages html not recorded in history. also cannot change home page

    The last time that Firefox actually saved a html page in history was May 16. Firefox will not save the pages I visit that are not html pages, a page ending in jpg, .doc, .pdf, etc.. I tried several time messing around with the options - picking don't

  • HP pavilion g6: I forgot my password on

    Please help me... i forgot my password on my HP pavilion on g6. Help, please.

  • DAQmx create several channels of

    I downloaded the program entry OR bridge-continues and tries to modify it slightly to allow several Wheatstone bridges to connect. Currently, it has the ability to connect to a single channel but don't not to acquire information from several channels

  • Internal drive is not found on my dell desktop 560

    I had a problem where something didn't I installed the new memory on a week before is increased from 4 GB to 8 GB, everything worked very well.  A few days ago I got a start failure. that I'm back. The next day I couldn't get and have not since. So,

  • How to read a text file in JDE

    Hello I'm developing an application where Ineed to read the whole part and a text file content.  Can someone give me some help which API orprocedure that I use. Thank you & best regards Anjan