Database Delete from problem

how do i make it so that when i do a DELETE query to delete a entry in database so it doesnt say #DELETED# in the database?

NEVER MIND!!GOT IT

Similar Messages

  • Delete from inline view

    Hello members,
    No sorry, this is not about key preservation.
    Instead, I have two tables T1 and T2. I want to delete rows from T1 where primary key is also in T2.
    I thought that if I select only from T1 then I would delete from T1. But as it turns out it is the first table mentioned in FROM clause that gets deleted from.
    SQL> create table t1 (x number primary key, c1 varchar2(1));
    Table created.
    SQL> create table t2 (x number primary key, c2 varchar2(1));
    Table created.
    SQL>
    SQL> insert into t1 values (1,'a');
    1 row created.
    SQL> insert into t1 values (2,'b');
    1 row created.
    SQL> insert into t1 values (3,'c');
    1 row created.
    SQL> insert into t2 values (1,'X');
    1 row created.
    SQL> commit
      2  /
    Commit complete.
    SQL>
    SQL> delete (select t1.x from T2, t1 where t2.x = t1.x);
    1 row deleted.
    SQL> select * from t1 union all select * from t2;
             X C
             1 a
             2 b
             3 c
    SQL> rollback
      2  /
    Rollback complete.
    SQL>
    SQL> delete (select t1.x from T1, t2 where t2.x = t1.x);
    1 row deleted.
    SQL> select * from t1 union all select * from t2;
             X C
             2 b
             3 c
             1 X
    SQL> rollback
      2  /
    Rollback complete.
    SQL>
    SQL>
    SQL> select * from v$version where rownum = 1;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    SQL>Maybe I was home sick when Ms. Teacher covered this, maybe I just wasn't paying attention.
    Or something else? - Are there any logic and/or rules involved here, that I never heard of?
    Best regards
    Peter
    Edit:
    Seems that the select list has nothing to do with it, at all.
    This will delete from T2
    delete (select null from T2, t1 where t2.x = t1.x);And this will delete from T1:
    delete (select null from T1, t2 where t2.x = t1.x);Edited by: Peter on Apr 24, 2012 6:01 AM

    Actually this is about key preservation.
    In 9.2 documentation Oracle stated...
    "You can delete from a join view provided there is one and only one key-preserved table in the join."I do not recall whether this was actually the case in 9i but I think this was probably an outstanding doc bug. By 10g the documentation had changed to...
    "For a DELETE statement, if the join results in more than one key-preserved table, then Oracle Database deletes from the first table named in the FROM clause"I believe it would be more complete to say.
    "For a DELETE statement, if the join results in only one key-preserved table, then Oracle Database deletes from that table. If the join results in more than one key-preserved table, then Oracle Database deletes from the first table named in the FROM clause"

  • Dynamic record deletion from database table

    Hi,
    I need to delete selected records from database table(dynamic names). Table names are being passed from main program with some of their field names. The record to be deleted from the database table is being decided based on the fields passed for the table and their contains passed from the main program.
    It is not possible to write dynamic where clause for DELETE statement directly.
    So, I created a dynamic internal table and i am trying to fetch all records using SELECT statement(for which we can write dynamic where condition, something like...SELECT...WHERE (itab).  ) which need to be deleted in the iternal table.
    Piece of code :
              CONCATENATE c_im v_tablefield1 INTO v_imprtfield1.
              CONCATENATE v_tablefield1 c_in v_imprtfield1
                       into s_condition separated by space.
              APPEND s_condition TO t_condition.
              PERFORM GET_DYNAMIC_ITAB USING s_flds_agtab-tabname
                                    changing t_itab.
              ASSIGN t_itab->* TO <itab>.
    *Select the data (to be deleted) from the database table
               SELECT * FROM (s_flds_agtab-tabname) INTO TABLE <itab>
                 WHERE (t_condition).
    *Delete the records from the table
               IF SY-SUBRC = 0.
                 DELETE (s_flds_agtab-tabname) FROM TABLE <itab>.
               ENDIF.
    Here t_condition is of standard table of WHERETXT.
    t_condition at the run time before giving dump was:
    SPART IN IM_SPART
    AND KUNNR IN IM_KUNNR
    Here IM_SPART is renge type of SPART and IM_KUNNR is renge of KUNNR.
    I am getting a DUMP:
    The WHERE condition has an unexpected format.
    Error analysis                                                                               
    The current ABAP/4 program attempted to execute an ABAP/4 Open SQL
    statement containing a WHERE condition of the form WHERE (itab) or
    WHERE ... AND (itab). The part of the WHERE condition specified at
    runtime in the internal table itab contains the operator         
             IN (v1, ..., vn)                                        
    in incomplete form.                                              
    How to correct the error
    If the error occurred in a non-modified SAP program, you may be  
    able to find a solution in the SAP note system.                  
    If you have access to the note system yourself, use the following
    search criteria:                                                 
    "SAPSQL_IN_ILLEGAL_LIST"                               
    "SAPLZSD_TAB_REFRESH " or "LZSD_TAB_REFRESHU01 "       
    "Z_SD_REFRESH_AGTABLES"                                
    If you cannot solve the problem yourself, please send the
    following documents to SAP:                             
    I would like to know whether "IN" operator is allowed in (itab) of WHERE clause. While testing I changed the "IN" to "=" specifying a suitable value there. It worked. So please let me know if i can give "IN" operator using renge table in the dynamic where clause.
    Thanking you,
    Surya

    Hi again,  so if you can not use the IN in a dynamic where clause you might be forced to dynamically build the entire select statement,  Here is a sample program which may give you some ideas, notice that we are writing the select statement code, putting it in another program and generating the subroutine at runtime, then call this routine.  I'm sure that this will help you see what you need to do.
    report zrich_0003 .
    tables: kna1.
    types: t_source(72).
    data: routine(32) value 'DYNAMIC_SELECT',
                 program(8),
                 message(128),
                 line type i.
    data: isource type table of t_source,
                xsource type t_source.
    ranges:
            r_kunnr for kna1-kunnr.
    data: ikna1 type table of kna1.
    data: xkna1 type kna1.
    r_kunnr-sign = 'I'.
    r_kunnr-option = 'EQ'.
    r_kunnr-low    = '0001000500'.
    append r_kunnr.
    xsource = 'REPORT ZTEMP.'.
    insert xsource  into isource index 1.
    xsource = 'FORM dynamic_select'.
    insert xsource  into isource index 2.
    xsource = 'Tables r_kunnr ikna1.'.
    append xsource to isource.
    xsource = 'select * into table ikna1 from kna1'.
    append xsource to isource.
    xsource = 'where kunnr in r_kunnr.'.
    append xsource to isource.
    xsource = 'ENDFORM.'.
    append xsource to isource.
    generate subroutine pool isource name program
                             message message
                             line line.
    if sy-subrc = 0.
      perform (routine) in program (program) tables r_kunnr
                                                    ikna1.
    else.
      write:/ message.
    endif.
    loop at ikna1 into xkna1.
      write:/ xkna1-kunnr.
    endloop.
    Regards,
    Rich Heilman

  • ADF delete from database.

    Hi,
    I am trying to design a page which will delete a particular row from one or more database tables. The jdeveloper version is 11.5 and the database is oracle 10.2 version.
    How can I do it?
    Thanks

    Hi all, Thanks for the reply..
    Actually I am trying to delete one record at a time, from the same table, from which m populating it on the jspx..
    That means the list source and the base source are same..which is not possible..
    What can be the solution for it ??
    I tried to create a separate view object for population on jspx and kept it in list source.. And I am using different view object in base source.. Both view objects refer to the same table..
    But it is not working out..the problems are..
    The record is getting deleted only for the first time when i run it.. Even after getting deleted from database, the record shows up in the list..
    And when i do the same operation one more time in the same session, 1st record in the table is getting updated with the value which i tried to delete..
    And I am not using managed bean..
    regards

  • Delete from remote location with where clause between the two databases

    I want to delete records from a source database using dblink. The criteria for the delete is a where clause, that
    looks for the values between a table at source and the remote location. I get an invalid sql statement error.
    When i do a count(*) instead of a delete, I get rows returned.
    Can anyone see an the problem here ? I've tried qualifying the delete
    delete from tabl1@remote a, tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key");
    the error I get is ORA 00933 SQL command not properly ended....
    The * is between the 2 ands ...
    Edited by: sgonos on Nov 6, 2009 6:46 AM
    Sorry the * moved when I save it ...
    delete from tabl1@remote a, tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key");
    it's flagging the middle and ... a.title = b.title ... seems to like key ....
    Edited by: sgonos on Nov 6, 2009 6:51 AM

    You have 2 tables specified in the delete clause of your statement.
    It should maybe be something like:
    delete from tabl1@remote a
    where exists (select 'x' from tabl1_temp b where (a."id" =b."id") and (a."title" = b."title) and (a."key" = b."key"));
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem with tab access after user deleted from group

    9ias version 9.2.0.1
    There seems to be a problem (potential bug???) when deleting a user from a portal group. I have a portal page set up with multiple tabs. These tabs can only be accessed by users belonging to certain portal groups. When i add a user to a group, the user sees the necessary tabs when authenticated. However, if i delete this user from the group there is a problem. When the user re-logs into portal, they will see all the tabs belonging to the group they were deleted from. However, when they select this tab nothing happens and the portal goes into a state of flux (doesn't navigate). One way to resolve this is to go in as a portal admin, edit any tab and select apply. The portal then seems to refresh.
    This solution isn't practical. Is this a bug? Is there a patch or another solutions??? Thanks

    Hi Turloch! Thanks for your help!
    Those SQL Statements were extracted from the MS Access application that we will continue to use to access the data , now on an Oracle Database.
    I don't know what I can do to make this kind of statements works as it is on Access database. The first query, that I called Query1 works fine on Oracle, I just mentioned it because the 2nd Query , named Query2, use it.
    I'm not able to understand why when I change the 1st. query to a "make-table" query the Query2 works as desired, but if I keep the Query1 and Query2 as it is on the MS Access Application I got the ODBC error message and the ORA-00904 error message , related (I think!) to the FieldTmp field used on the LEFT JOIN statement (AND).
    As I told before, if I change the AND clause to compare to another field, as instance, field1 :
    FROM Query1 LEFT JOIN Table3
    ON (Table3.field1=Query1.Field2) AND
    (Table3.field5 = Query1.Field1)
    it works.
    Please, is there anything that I can do to keep the MS Access Application unchanged?
    Oracle = 8.1.6
    Oracle ODBC Driver = 8.1.6.4
    Oracle Migration Workbench = 1.3.1
    Thanks in advance,
    Elaine Viel Denadai

  • Problem in getting the database connection from a connection pool

    Hai All,
    I am facing a problem in getting the database connection from a connection pool created on weblogic server 8.1.
    I am using the Oracle database 8.1.7.
    I have configured my connection pool, datasource and JNDI in weblogic.
    In my java program i have the following code to retrieve the connection.
    import java.sql.*;    
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    class jdbcshp1 {
        public static void main(String[] args) {
         Connection connection = null;
         try {
               Hashtable ht = new Hashtable();
               ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");  // Wanna get rid of this.
               ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); // wanna get rid of this.
               // Get a context for the JNDI look up
               Context ctx = new InitialContext(ht);
            javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("myjndi1");
              //Create a connection object
              connection = ds.getConnection();
         The above code is working fine but, the two ht.put statements are creating problem.
    The problem is, after converting the application into WAR file it can be deployed
    on any machine or different port on same machine. My application fails if its deployed on
    weglogicserver which is at different port.
    Is there any way that i can get rid of those ht.put statements or any other way to solve the problem.
    any help is appreciated.
    Thanks in advance
    Pooja.

    Hai All,
    Firstly, thanks for ur reply.
    Even i have seen some code which uses context constructor with out any parameter and works fine.
    i dont understand why its not working for my code.
    When i remove those ht.put code and use context constructor with out any parameter, it giving an error.
    Context ctx = new InitialContext();
    javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("ocjndi");
    connection = ds.getConnection();The error is as follows:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    the above error is forcing me to include those code but if the port number is changed the code will not work. Plz let meknow if some setting have to be made.
    I appreciate all ur valuable help.
    Thanks once again.
    Pooja.

  • HT1338 I need to delete an older version of Microsoft Database Daemon from the startup items before I can open Microsoft Outlook - how do i do this on my MacBook Pro Mac OSX Lion?

    I have received a message when trying to open Mirosoft Outlook on my Mac - tekking me to delete the Microsoft Database daemon from the startup Items - I do not know how to do this.

    Open the Users & Groups pane of System Preferences, click on your user account, and remove it from the list of login items.
    (66083)

  • How to delete the problem-solution in Solution Database

    Dear Sir,
    I need to delete  the problem-solution in Solution Database which is already created in CRM ( IS01). However, I don't know how to delete.
    Please advise.
    Thank you and best regards,

    Dear Sir,
    I need to delete  the problem-solution in Solution Database which is already created in CRM ( IS01). However, I don't know how to delete.
    Please advise.
    Thank you and best regards,

  • Problem with using database link from oracle 7 to oracle 9i

    Hi To Every One
    I have two oracle database oracle 7.3.4.0.1 and oracle 9i 9.2.0.1.0.
    and the tns alias to connect to oracle 9i database is oracle9i and tns
    alias to oracle 7 database is oracle7.I have no problem in connect to
    these database using these tns aliases from either database.The tns
    alias for oracle 7 is available in tnsnames.ora file of oracle9i and
    tns alias for oracle 9i is available in tnsnames.ora file of oracle 7.
    So there is no connection problem from each other.Connection is
    working fine for each other but the problem with database links is
    like this
    Problem:
    when i create database link from oracle9i user or public database link
    from oracle9i for oracle7 user like this
    SQL ORACLE9I >CREATE DATABASE LINK ORACLE7 CONNECT TO <ORACLE7USER>
    IDENTIFIED BY <PASSWORD> USING 'ORACLE7';
    OR
    SQL ORACLE9I >CREATE PUBLIC DATABASE LINK ORACLE7 CONNECT TO <ORACLE7USER>
    IDENTIFIED BY <PASSWORD> USING 'ORACLE7';
    The links get created sucessfully but when i write command like
    SQL ORACLE9I> DESC <ORACLE7USER_NAME>.<ORACLE7USER_TABLENAME>@ORACLE7
    I RECEIVE A ORACLE ERROR LIKE
    ORA-12663 SERVICE REQUIRED BY CLIENT IS NOT AVAILABLE ON THE SERVER.
    OR IF MY COMMAND IS LIKE
    SQL ORACLE9I> SELECT <FEILD_NAME> FROM
    <ORACLE7USER_NAME>.<ORACLE7USER_TABLENAME>@ORACLE7;
    I RECEIVE AN ORACLE ERROR LIKE
    ORA-01002 FETCH OUT OF SEQUENCE.
    ORA-02063: preceding line from ORACLE7
    BUT IF I CREATE A LINK FROM ORACLE7 USER FOR ORACLE9I USER
    IT WORKS FINE.
    PLZ HELP ME WHAT IS THE PROBLEM THAT THE LINK FOR ORACLE 7 IS NOT WORKING WHEN
    IT IS BEING CREATED FROM ORACLE9I.
    Thank u.

    Oracle 9.2.0 does not support connectivity to Oracle 7. The newest version that will support this is 9.0.1.

  • MAIL: Trying to settle long-lasting problem. Mail always immediately downloads the messages I delete from any IMAP mailbox. I'm running out of HD space!

    BACKGROUND
    I only have 60GB of space on my MacBook Air. Currently, three long-standing IMAP accounts are taking up over 7GB of it!
    I have seen several related discussions about this kind of problem, but they all seem to have been solved or glossed over with setting up the IMAP interaction so that messages are deleted from the server in addition to the device or with a "Mailbox > Use This Mailbox For" fix that doesn't work for me. I like being able to save all of my email history on servers (I'm often surprised by how many years back I have to search to find a piece of information I need), but I can no longer stand losing so much of my very limited local space to really old mail.
    PROBLEM
    I'll refer to just one of the relevant accounts as "Gmail," since that's in parentheses when seen in these screenshots. These are its current Mailbox Behaviors settings:
    Under my Gmail Inbox in Mail, I have deleted every message from before 2013. The mail from 2013 is all that I want stored on my MacBook Air.
    Ultimately, I think this has something to do with the Archive (seen in the sidebar above, as well). Even when I've deleted everything from before 2013 in my Inbox, AND emptied the entire contents of Trash manually, the Archive still contains all of the mail from the server (yes, this account was started in 2011, but I have others that go back much further).
    The cherry on top is that when I delete the same messages from the Archive as I've deleted from the Inbox, Mail immediately begins re-downloading all of those messages. Last time I tried this my laptop had to download 23000 messages, but here's a screenshot of proof with a smaller sample:
    In case my Gmail server settings are useful to consider, here they are:
    Final Notes
    • There's a lot that I don't know about exactly how IMAP communication occurs between a device and a server. For my sake and the sake of anyone else who needs this kind of help, please clarify terms like "flags" and "archive" (since Gmail and Mail both use the term and I don't know think they mean exactly the same thing) if/when you use them.
    • If anyone does think that there's some sort of "Mailbox > Use This Mailbox For" solution to this, you should know that no matter what I have selected in Mail's sidebar (at no matter what level of indentation), the options available under that menu item are always grayed-out.
    • I want to keep using Mail. There's a lot that I like about it and I don't want to switch to Thunderbird or something else (remember, I need to save as much local space as I can).
    • I just upgraded to 10.9.0 Mavericks, but this problem has existed for me and behaved essentially just like this as long as I can remember. In fact, I think I recall the problem still existing before there was an Archive in the sidebar at all.

    UPDATE
    I still have the problem, but when I checked on this post to see if anyone had commented and I simply hadn't received an e-mail, I noticed that all but the last of the images I included have stopped displaying (I had friends check, too).  Most of them were just visual examples of what I was explaining in hopes of giving context and all available info that I may not have personally viewed as relevant, but the first one, about my account's Mailbox Behaviors settings sure is important. These are the settings I have:
    • Store draft messages on the server — Check
    • Store sent messages on the server — Check
    • Delete sent messages — One month old
    • Store junk messages on the server — Check
    • Delete junk messages — One week old
    • Move deleted messages to the Trash mailbox — Grayed-out and Check
    • Store deleted messages on the server — Grayed-out and Check
    • Permanently erase deleted messages when — Quitting Mail
    I hope this helps. Please comment if I'm leaving out any other important information.

  • DELETE FROM DATABASE + restored again?

    there is a statement
    DELETE FROM DATABASE <dbtab> (<ar>) [CLIENT <cli>]
    ID <key> .
    Suppose I have mistakenly deleted from the database
    can it be

    Hi,
    there is a syntax like DELETE FROM DATABASE as you mentioned.
    But never ever use that to delete a record in DATABASE TABLE as you cannot recover that data.
    hope this helps.

  • Problem connecting DataBase Link from windows oracle to oracle on Linux

    I'm facing a problem with database links from windows oracle to Oracle hosted on Linux server.
    I'm able to successfully create the Database Link using the following query on oracle database hosted on a windows server
    CREATE DATABASE LINK SampleDB
    CONNECT TO myuser IDENTIFIED BY password
    USING 'sample';
    The tns names entry on windows for database in Linux server is as follows
    DSOFT =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = sample)
    But while executing the query "select count(*) from doctor@SampleDB;" in sql developer on windows, I'm getting the following error
    SQL Error: ORA-12154: TNS:could not resolve the connect identifier specified
    12154. 00000 - "TNS:could not resolve the connect identifier specified"
    *Cause:    A connection to a database or other service was requested using
    a connect identifier, and the connect identifier specified could not
    be resolved into a connect descriptor using one of the naming methods
    configured. For example, if the type of connect identifier used was a
    net service name then the net service name could not be found in a
    naming method repository, or the repository could not be
    located or reached.
    Using the above tns entries, i'm successfully able to connect to the database in Linux server through sql developer installed on the windows machine. Then why i'm getting this error while executing the query on Database Link?. Can any one help me?

    1005745 wrote:
    I'm facing a problem with database links from windows oracle to Oracle hosted on Linux server.
    I'm able to successfully create the Database Link using the following query on oracle database hosted on a windows server
    CREATE DATABASE LINK SampleDB
    CONNECT TO myuser IDENTIFIED BY password
    USING 'sample';
    The tns names entry on windows for database in Linux server is as follows
    DSOFT =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = sample)
    But while executing the query "select count(*) from doctor@SampleDB;" in sql developer on windows, I'm getting the following error
    SQL Error: ORA-12154: TNS:could not resolve the connect identifier specified
    12154. 00000 - "TNS:could not resolve the connect identifier specified"
    *Cause:    A connection to a database or other service was requested using
    a connect identifier, and the connect identifier specified could not
    be resolved into a connect descriptor using one of the naming methods
    configured. For example, if the type of connect identifier used was a
    net service name then the net service name could not be found in a
    naming method repository, or the repository could not be
    located or reached.
    Using the above tns entries, i'm successfully able to connect to the database in Linux server through sql developer installed on the windows machine. Then why i'm getting this error while executing the query on Database Link?. Can any one help me?A database link is acting as a client to the target, remote database in exactly the same fashion and using exactly the same tns infrastructure as any other client trying to connect to that remote database. your ORA-12154 when querying a db link means exactly the same as if you had gotten it trying to connect with sqlplus, from the same server. Check the link SB provided. Keep in mind that the tnsnames file of concern is the one on the source database server.

  • Urgent -Create  RFC for update the database and delete from the database

    Hi Guy's,
    Please help me how  to create the RFC for update to databse and delete from database(step-by-step) procedure.
    Thanks and Regards,
    Sai.

    Hi,
    Please go through the following link,
    reward if helps.
    [RFC Step By Step|https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728]
    regards,
    mahantesh

  • Archive Deleted from primary database

    Dear Experts
    I have configured physical standby database on oracle 9.2.0.1
    an archive has been deleted from primary database. and it is not applied on standby database.
    How can I synch my standby database with primary database?
    please help me out
    thanks

    Do not need configure rman. Try this.This mean is you will get all changes from primary database without logs(archivelogs becuse you loss these) then apply these to stand by.This is a best way.First change SCN from Standby database then do these.
    You can get SCN from standby as
    select min (checkpoint_change#) from v$datafile_header

Maybe you are looking for

  • 3 reasons why i won't switch to Lightroom for now

    Lightroom is so nice, so intuitive & user-friendly that I almost switch from Bibble to Lightroom even if there are some very important features missing in order to call lightroom a professional grade application. Here are the major reasons why i wont

  • Recording Narration for Keynote?

    According to the KN User Manual, each KN slide can be narrated with an audio file so that the audio plays for that one slide only and stops when that slide leaves the screen. But the user manual does not say how to record this narration. Is there a w

  • My iPhone keeps calling someone I don't know

    Hi all, I have gotten three very irate calls from someone who's called ID is from Ohio.  He said my phone has called him over 40 times today.  I have no idea who this person is, and my call list shows no outgoing calls from anyone outside my contact

  • DNG file not workung with NEF files

    Can't detect .NEF files taken from my Nikon D800 E

  • Exporting PDFs?  Replaces images.

    I'm creating a newsletter that includes several pictures on different pages.  I export the Pages document as a PDF and during that transition it copies some of the images and replaces existing images on top.  Help!!