Home » SQL & PL/SQL » SQL & PL/SQL » how can i get back my emp table 14 rows
how can i get back my emp table 14 rows [message #230570] Thu, 12 April 2007 04:03 Go to next message
iitraghu
Messages: 18
Registered: April 2007
Location: bengalore
Junior Member

Hi,
I have the emp table,
I deleted all 14 rows,
After that i dropped other table,
So the deleted rows in emp were commited,
How can i get those 14 rows back?

Bye..
Re: how can i get back my emp table 14 rows [message #230575 is a reply to message #230570] Thu, 12 April 2007 04:08 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

HI,
It is expected behaviour.

All DDL statement is AUTO COMMIT;
All previous statement also commit when use issue any DDL statement.

You should try below procedure ...
SQL> conn sys as sysdba
Enter password:
Connected.

SQL> conn hr/hr
Connected.
SQL> alter session set nls_date_format = 'hh24:mi:ss';
Session altered.
SQL> select sysdate from dual;
SYSDATE
--------
19:04:49
SQL> create table hrtest ( no number, name varchar2(20));
Table created.
SQL> begin
2 insert into hrtest values ( 1, 'aaa');
3 insert into hrtest values ( 2, 'bbb');
4 insert into hrtest values ( 3, 'ccc');
5 end;
6 /
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL> select sysdate from dual;
SYSDATE
--------
19:06:23
SQL> delete from hrtest where name = 'ccc';
1 row deleted.
SQL> commit;
Commit complete.
SQL> select * from hrtest;
NO NAME
---------- --------------------
1 aaa
2 bbb

SQL> edWrote file afiedt.buf
1 select * from hrtest AS OF TIMESTAMP 2 to_timestamp ('2006-11-16 19:06:23','YYYY-MM-DD HH24:MI:SS')
3* where name = 'ccc'
4 /
NO NAME
---------- --------------------
3 ccc
SQL> insert into hrtest 2 ( select * from hrtest AS OF TIMESTAMP 3 to_timestamp ('2006-11-16 19:06:23','YYYY-MM-DD HH24:MI:SS')
4 where name = 'ccc');
1 row created.
SQL> select * from hrtest;
NO NAME
---------- --------------------
1 aaa
2 bbb
3 ccc
Re: how can i get back my emp table 14 rows [message #230577 is a reply to message #230570] Thu, 12 April 2007 04:11 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
http://www.oracle.com/technology/sample_code/tech/sql_plus/htdocs/demobld.html
Re: how can i get back my emp table 14 rows [message #230594 is a reply to message #230577] Thu, 12 April 2007 04:44 Go to previous messageGo to next message
iitraghu
Messages: 18
Registered: April 2007
Location: bengalore
Junior Member

Hi,
I am getting the below error

SQL> start demobld.sql
SP2-0310: unable to open file "demobld.sql"
SQL>
Re: how can i get back my emp table 14 rows [message #230596 is a reply to message #230594] Thu, 12 April 2007 04:45 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
come on. Put some effort in it other than puking each and every error you get into this forum!
Previous Topic: give the sql query for the below scenario
Next Topic: unable to retrieve information from...plz help
Goto Forum:
  


Current Time: Fri Dec 09 04:16:57 CST 2016

Total time taken to generate the page: 0.06608 seconds