Check the Existance of  Table

Hi,
How to check the Existance of table, My require ment i have two tables lets say A And B, If table B does not exist then delete records in table A.
Can any one tel me how to write a query.
Thanks in Advance

hi,
whether your requirement is to check the existence of table B in the entire database or only in your schema.
because:
the user_tables contains the tables owned by the owner of the schema,
and all_tables caontains the tables that can be access by you,
and dba_tables contains all teh tables in your database.
so based on your req query any one of the table and check as suggested earlier by others.
and the 'tab' table also shows if there is any synonym with the table name as 'B'.
so if you are going for 'tab' table then also specify the column "TABTYPE = 'TABLE' ".

Similar Messages

  • Add field value to the existing internal table.

    how to add a field value to the existing internal table.
    DATA: BEGIN OF ITAB occurs 0,
                 EBELN TYPE EKPO-EBELN,
                 EBELP TYPE EKPO-EBELP,
                 AEDAT TYPE EKPO-AEDAT,
                 amount(10) type c,
               END OF ITAB.
    select * from ekpo
           into corresponding fields of table itab.
    itab-amount = '2400'.
    loop at itab where ebeln eq 70 .
           write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
             endloop.
    here output is not showing the amount field value.
    please tell me how to solve this problem urgent
    thanks in advance.

    Hi Sekhar,
        First let me know wheather you are assigning some value to the amount field externally to all records? if this is wright means check the below code.
    DATA: BEGIN OF ITAB occurs 0,
    EBELN TYPE EKPO-EBELN,
    EBELP TYPE EKPO-EBELP,
    AEDAT TYPE EKPO-AEDAT,
    END OF ITAB.
    select * from ekpo
    into corresponding fields of table itab.
    v_amount = '2400'.
    loop at itab where ebeln eq 70 .
    write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,v_amount.
    endloop.
    or if you want to modify perticular records in itab  then use below code.
    DATA: BEGIN OF ITAB occurs 0,
    EBELN TYPE EKPO-EBELN,
    EBELP TYPE EKPO-EBELP,
    AEDAT TYPE EKPO-AEDAT,
    amount(10) type c,
    END OF ITAB.
    select * from ekpo
    into corresponding fields of table itab.
    loop at itab.
    itab-amount = '2400'.
    modify itab index sy-tabix (or perticular line number).
    endloop.
    loop at itab where ebeln eq 70 .
    write : / sy-tabix,itab-ebeln,itab-ebelp,itab-aedat,itab-amount.
    endloop.
    Thanks,
    Suma.

  • This script is not checking the existing of the new created item

    Dear Friends
    I have This script is not checking the existing of the new created item I am using this script in side WHEN-BUTTON-PRESSED trigger
    I am using oracle Forms [32 Bit] Version 6.0.8.11.3 (Production)
    My script as the following :
    BEGIN
    BEGIN
    SELECT ITEM_CODE INTO :GLOBAL.DUMMY
    FROM IM_INVENTORY
    WHERE ITEM_CLASS = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.ITEM_CLASS)))
    AND ITEM_TYPE = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.ITEM_TYPE)))
    AND ITEM_LENGTH = :IM_NEW_ITEMS.ITEM_LENGTH
    AND ITEM_WIDTH = :IM_NEW_ITEMS.ITEM_WIDTH
    AND ITEM_HIGHT1 = :IM_NEW_ITEMS.ITEM_HIGHT1
    AND ITEM_HIGHT2 = :IM_NEW_ITEMS.ITEM_HIGHT2
    AND COLOR_CODE = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.COLOR_CODE)))
    AND SHAPE_CODE = TO_NUMBER(RTRIM(LTRIM(:IM_NEW_ITEMS.SHAPE_CODE)));
    -- get_err_message(87);
    SHOW_MESSAGE('This Item Already Exist !!!');
    RAISE FORM_TRIGGER_FAILURE;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    show_message('here');
    INSERT INTO IM_INVENTORY
    (ITEM_CODE,ITEM_NAME_A,ITEM_NAME_E,STOCK_ITEM,ITEM_CLASS,ITEM_TYPE,SUPP_CODE,ITEM_LENGTH,ITEM_WIDTH,
    ITEM_HIGHT1,ITEM_HIGHT2,COLOR_CODE,SHAPE_CODE,ITEM_SIZE_TYPE,VOLUME,CON_FACTOR,ITEM_PRICE1,
    ITEM_DISCOUNT,MIN_QTY,MAX_QTY,COSTING_METHOD,ITEM_COST,STANDARD_COST,WEIGHT,ITEM_PRICE2,ITEM_PRICE3,
    OPENING_COST,LAST_PUR_COST,QTY_FOR_PRICE2,QTY_FOR_PRICE3,ITEM_PRICE_METHOD,USER_ID,USER_DATE)
    VALUES(:IM_NEW_ITEMS.ITEM_CODE,:GLOBAL.LOC_VAR_A,:GLOBAL.LOC_VAR_E,'1',:IM_NEW_ITEMS.ITEM_CLASS,:IM_NEW_ITEMS.ITEM_TYPE,'0',
    :IM_NEW_ITEMS.ITEM_LENGTH,:IM_NEW_ITEMS.ITEM_WIDTH,:IM_NEW_ITEMS.ITEM_HIGHT1,:IM_NEW_ITEMS.ITEM_HIGHT2,
    NVL(:IM_NEW_ITEMS.COLOR_CODE,0),NVL(:IM_NEW_ITEMS.SHAPE_CODE,0),1,NVL(:IM_NEW_ITEMS.VOLUME,0),1,:GLOBAL.ITEM_PRICE1,0.00,0.00,0.00,'1',0.00,0.00,
    0.00,:GLOBAL.ITEM_PRICE1,:GLOBAL.ITEM_PRICE1,0.000,0.000,0.000,0.000,1,:IM_NEW_ITEMS.USER_ID,:IM_NEW_ITEMS.USER_DATE);
    standard.commit; -- NEW COMMITED
    clear_message; -- NEW COMMITED
         WHEN FORM_TRIGGER_FAILURE THEN
         SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    WHEN OTHERS THEN
    SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    END;
    END;
    Waiting for your valuable answer .
    Best regards
    Jamil Alshaibani

    Hi,
    I have written the script also with constants values but still it is not going to
    SHOW_MESSAGE('This Item Already Exist !!!');
    and the script is written as the following :
    BEGIN
    SELECT 1 INTO :GLOBAL.DUMMY
    FROM IM_INVENTORY
    WHERE ITEM_CLASS ='110'
    AND ITEM_TYPE ='110105'
    AND ITEM_LENGTH = 1
    AND ITEM_WIDTH = 1
    AND ITEM_HIGHT1 = 1
    AND ITEM_HIGHT2 = 0
    AND COLOR_CODE = '3001'
    AND SHAPE_CODE = '201' ;
    SHOW_MESSAGE('1- This Item Already Exist !!!');
    RAISE FORM_TRIGGER_FAILURE;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    show_message('here');
    INSERT INTO IM_INVENTORY
    (ITEM_CODE,ITEM_NAME_A,ITEM_NAME_E,STOCK_ITEM,ITEM_CLASS,ITEM_TYPE,SUPP_CODE,ITEM_LENGTH,ITEM_WIDTH,
    ITEM_HIGHT1,ITEM_HIGHT2,COLOR_CODE,SHAPE_CODE,ITEM_SIZE_TYPE,VOLUME,CON_FACTOR,ITEM_PRICE1,
    ITEM_DISCOUNT,MIN_QTY,MAX_QTY,COSTING_METHOD,ITEM_COST,STANDARD_COST,WEIGHT,ITEM_PRICE2,ITEM_PRICE3,
    OPENING_COST,LAST_PUR_COST,QTY_FOR_PRICE2,QTY_FOR_PRICE3,ITEM_PRICE_METHOD,USER_ID,USER_DATE)
    VALUES(:IM_NEW_ITEMS.ITEM_CODE,:GLOBAL.LOC_VAR_A,:GLOBAL.LOC_VAR_E,'1',:IM_NEW_ITEMS.ITEM_CLASS,:IM_NEW_ITEMS.ITEM_TYPE,'0',
    :IM_NEW_ITEMS.ITEM_LENGTH,:IM_NEW_ITEMS.ITEM_WIDTH,:IM_NEW_ITEMS.ITEM_HIGHT1,:IM_NEW_ITEMS.ITEM_HIGHT2,
    NVL(:IM_NEW_ITEMS.COLOR_CODE,0),NVL(:IM_NEW_ITEMS.SHAPE_CODE,0),1,NVL(:IM_NEW_ITEMS.VOLUME,0),1,:GLOBAL.ITEM_PRICE1,0.00,0.00,0.00,'1',0.00,0.00,
    0.00,:GLOBAL.ITEM_PRICE1,:GLOBAL.ITEM_PRICE1,0.000,0.000,0.000,0.000,1,:IM_NEW_ITEMS.USER_ID,:IM_NEW_ITEMS.USER_DATE);
    standard.commit; -- NEW COMMITED
    clear_message; -- NEW COMMITED
         WHEN FORM_TRIGGER_FAILURE THEN
         SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    WHEN OTHERS THEN
    SHOW_MESSAGE('Error : '||SQLERRM);
    RAISE FORM_TRIGGER_FAILURE ;
    END;
    Best regards
    Jamil

  • [HTML DB] How to use the existing database table?

    [HTML DB] How to use the existing database table?
    I installed Oracle 10g database in Computer A(Windows 2000), and I already create all the tables with data and the data size is about 300MB.
    In Computer B(Windows 2000), I installed HTML DB 1.6.
    How can I use /get the existing database table (in computer A) for HTML DB?
    Could anyone help me on this? I am newbie and I need some detail instructions. or Where can I find the examples.....
    Thanks

    Well I guess if you wish to retain that architecture, i.e. HTMLDB on one machine and your data on another, you will have to establish database links to access the data. Oracle documentation will describe how to achieve that.

  • Alternate fact table without disturbing the existing fact table in EIS

    I have a question in EIS, how to load or work with alternate fact table, without disturbing the existing fact table, pls provide me with some procedure and steps
    thank u in advance
    sunil

    Yes you can have multiple models and metaoutlines load one cube. I've done it before. The trick is you ahve one "master" metaoutline that you put all the measures in (even if they are manually added. You use that to build the cube. Then you can have multiple metaoutlines build different measures within the cube. The idea is you have to have them update different intersections or the last one in will be what you get. I have a client that gets sales info from one source, shipment info from a different relational source . in all I have 10 differnt models and metaoutlines that build one cube. you just lump the load statements into one CBS file. It works great (or as great as EIS works). The biggest issue is timing to make sure all the sources are available when the load is going to be doe. Of course you could build different parts at different times.

  • Checking the existance of a measure for the last 4 non-empty quarters

    I am trying to create a new calculated measure that will check the existance of another measure (call it [Measures].[TestMeasure]) against all of the quarters of the current year. Depending on whether the measure has a value in each of these quarters
    I want to do one of the following
    If there is data in the 4th quarter, but not quarters 3, 2, and 1, multiply by 4
    If there is data in the 4th and 3rd quarters, but not quarters 2, and 1, multiply by 2
    If there is data in the 4th, 3rd and 2nd quarters, but not quarter  1, multiply by 4/3
    If there is data in the 4th, and 2nd quarters, but not quarter  1, multiply by 2
    In all other scenarios, do nothing.
    Is there an elegant way to accomplish this?
    Scott 

    Hi,
    you could try this:
    var bExists = true;
    try {
    var childSubFormBlk = parent.childSubForm;
    } catch(e) {
    var bExists = false;
    if (bExists) {

  • Add columns in the existing Customer table in a Subject Area

    Hi All,
    Well I need to add two columns from Sales table(new table i created which has customer Id) and join it to the Customer Table which has the Customer Id and several columns. The Customer table was already in the RPD which has all the customer information. Now that i have this new requirement to add few columns from the Sales table to the Customer table in one Subject Area.
    What i have done so far is that I imported the sales table into the rpd, made a join in PHYSICAL LAYER on the customer ID of the Sales table to the Customer id of the Customer table and simply dragged the sales table to the Customer LTS in the BMM layer(NO MORE JOINS IN BMM)and dragged and dropped the same into the Presentation layer. The customer table is linked to one fact table in that subject area. So i thought that dragging the sales table columns in the customer table LTS will work because customer is linked to one fact in that subject area.
    Now, In the Answers when I dragged columns from customer & sales table I see only one record that is the first customer_id record from my Sales table but i know there are many common customer_ids between those two tables but its only picking the first customer id from the sales table.
    Any help will be appreciated..
    Normally if we need to add some columns to the existing tables in one subject area what is the best approach??

    Hi Balajee,
    SAPMM06E 0111 CUSTSCR1 SAPLXM06 0111 Subscreen: PO item
    for more information check with these links
    ADDING NEW FIELDS IN me21n
    ADDING NEW FIELDS IN me21n - (Screen exit / enhancment)
    hope this will useful to you.
    Regards!

  • How to check the value in Table CDPOS

    Mostly I can't see the following fields value in the table CDPOS,
      (1) CDPOS-VALUE_NEW
      (2) CDPOS-VALUE_OLD
    In fact, it should have values, so how to check the values, is there any special method needed?
    Thanks and best regards.

    Ferry Lianto,
    Thank you very much for your expertise.
    It's helpful to get some contents via FM:CHANGEDOCUMENT_READ_POSITIONS, the problem is, to some kind of DELETION operation, the log in table CDPOS is very simple, I still don't know which contents were deleted even though I found records in table CDPOS.
    Is there any other suggestions?
    Thanks and best regards.

  • How do you check the existance of a file in Linux?

    Hi,
    How do you check to see if a file in certain directory exists?
    I'm trying something like.
    if [ "ls fhs_jwesha_2.log" ]; then echo Here; else echo Not Here.;fibut I know that's not the right command.
    Anybody?

    Assuming from command line:
    [user@myhost /]$ [ -f /etc/passwd ] && echo "here" || echo "not here"
    here
    [user@myhost /]$ [ -f /etc/no_file ] && echo "here" || echo "not here"
    not hereFor a script, try:
    if [ -f /etc/passwd ]; then echo "here" ; else echo "not here" ; fi-troy
    http://troysunix.blogspot.com

  • How do I check the delete database table is successful?

    After delete all the records from the database table, how do I check it is successful?  When do I need to 'commit'?  (after delete table or after insert new data?)
    Thanks,
    Helen

    Hi,
      Check sy-subrc = 0..
      DELETE ZTABLE..OR INSERT ZTABLE...
      IF SY-SUBRC <> 0.
        MESSAGE E000 WITH 'DATABASE DELETE FAILED'.
      ELSE.
        COMMIT WORK...
      ENDIF.
    Thanks,
    Naren

  • Dragging the columns to existing logical table source.....

    Hi,
    I am just learning OBIEE 11g and I am using a turorial from oracle it is
    "Creating a Repository Using the Oracle BI 11g Administration Tool" for practice purpose.
    In this tutorial it is saying that drag that columns from phscial layer to Logica Table Source
    in BMM Layer to avoid creating a second logical table source.. But when I am trying to drag the columns to
    existing logical source it is disabling I mean which it is not allowing .. is there any other technique to
    do it... or Am i wrongly approaching.. .The below is brief description in the
    tutorial.
    "Drag all six columns from D50 Sales Rep in the Physical layer to D5 Sales Rep in the BMM layer. This action
    creates logical columns and adds a D50 Sales Rep logical table source to D5 Sales Rep.
    Rename the D50 Sales Rep logical table source to LTS1 Sales Rep.
    In the Physical layer, expand D52 Sales Rep Position.
    Drag POSTN_DESC and POSTN_LEVEL from D52 Sales Rep Position to LTS1 Sales Rep. Note that you are
    dragging the columns to the logical table source, not the logical table. Dragging to the logical table would create a
    second logical table source.
    Drag DISTANCE from D51 Sales Rep Parent Child to LTS1 Sales Rep. Again, you drag the column to the logical
    table source, not the logical table."
    help would be appreciated.
    Thanks and Regards,
    Sri_Oracle.

    Hi Sri,
    When you are dragging a physical column onto an existing Logical table source and if it does not let you do so, then it means that there is no physical join between the existing physical table(which the logical source is pointing to already) and new physical table (from which you are dragging the column now). So, please make sure, you have the join in place.
    Hope this helps.
    Thank you,
    Dhar

  • Error while deriving the currency from table

    i am getting the below error while simulating the payroll for india.
    Error while deriving the currency from table T001P & Error during Initialization of payroll.
    i am SAP HCM Trainee.. practicing at home.

    Pls check the currency in table T500C.
    You can use TCode OE00 for table maintenance T500C.
    Also check whether currency is there in table V_CURC and T510.
    Hope this will help.
    Regards
    Ghouse

  • How to know who has created a particular record in the data base table

    Hi All...
    Can any one tell me how to track the information about who has entered the records in to the data base table....
    Thanks in advance...

    You could check the Created By and Created On fields if your tables contains these fields.
    OR
    You could check the table DBTABLOG if table logging is enabled for the table
    OR
    You could check the Change document tables CDHDR and CDPOS.
    -Kiran
    Please mark useful answers

  • How to check the master data records in using SE16 transaction?

    Hi,
    Can you please help me to check the master data records using SE16 transaction?
    Loaded master data for Characteristic and want to check the records in the master data tables.
    Thank you for your help!
    Lakshmi

    Hi!
    Welcome to SDN.
    you have to check the master data tables.
    soo in Se16 you have to select the appropriate master data table and view the data.
    following thread explains about masterdata tables
    MasterData table?
    regards
    mohan
    Message was edited by:
            Mohan Krishna

  • Changing the pricing condition table

    Hi Gurus,
    As there is a shortage free tables I want to change the existing condtion table and to add new field to fulfill the requirement.Currently we have the table sales area/PH1-PH6 and I need to change it to sales area/PH1-PH6/material group2.While i am trying to change in V/04 system is not allowing and its showing the  following messages "Carry out repairs in non-original system only if they are urgen" andt "function code not allowed". Please let me know how to change the existing condition table.
    Regards,
    Hari CHalla.

    Hi
    I think you need to get the acces key to change the standard table from SAP in service market place.
    Regards
    Yatin Thakkar

Maybe you are looking for

  • Does Verizon Know How to Support 4G LTE ?

    Hello everyone, Let me start off by saying that prior to Christmas 2011 I had never had any problems with my 4G service other than the nationwide outages that Verizon owned up to. That being said, since 12/25/2011 my service has been a nightmare. I h

  • Date format in Discovere Reports

    We have created a workbook with a parameter which is supposed to show up an LOV for a parameter in the MON-RR format. Now this LOV shows up correctly in the Discoverer Desktop edition as MON-RR format, but when we view the same in Discoverer Viewer i

  • SharePoint 2010 client object model read survey list

    Hello all, please suggest me how to read questions and answers in a survey list using client object model if possible some code is fine. Like Cricket

  • Chart View

    Hi , In Chart view I have selected pie view , in pie view can i navigate to other dashboard when i click on legend ( heading / lable ) ? If its Normal barchart i was able to navigate to another dashboard .. by setting address of other dashboard at "A

  • Is Microsoft Project available for Mac

    I need Microsoft Project 2007 or some verision of it.