Home » SQL & PL/SQL » Client Tools » popup (10g windows)
popup [message #298742] Thu, 07 February 2008 07:29 Go to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member

hi
is it right place to post the topic ...? ok...

after running the script in command prompt(windows),is it possible to get a popup message
saying YES to commit and NO to rollback
thanxs
Re: popup [message #298772 is a reply to message #298742] Thu, 07 February 2008 11:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64135
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
is it right place to post the topic ...?

No.

Regards
Michel
Re: popup [message #298838 is a reply to message #298772] Thu, 07 February 2008 23:50 Go to previous messageGo to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
where should i post
Re: popup [message #298843 is a reply to message #298838] Fri, 08 February 2008 00:19 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Here's one way to do that: once you start SQL*Plus session, you have to finish the job (i.e. rollback when you're still in SQL*Plus); otherwise, Oracle will COMMIT by default upon terminating the session.

This is the script: at the beginning, I'm inserting a record into the 'DEPT' table (Scott's schema); you'd put your statements here.

Now we'll have to decide whether to COMMIT or ROLLBACK. To do that, spool the answer into a file and run it.
-- FAQ.SQL
insert into dept values (0, 'Little', 'Foot');

prompt <C> to 'commit', <R> to 'rollback'
prompt
accept odg prompt 'What will you do? ';

set termout off;
set verify off;
set heading off;
set pause off;
set echo off;
column action newline;
spool todo.sql

select decode (upper('&&odg'), 'C', 'commit;', 'rollback;') action
from dual;

spool off;
set termout on;
@todo

undefine odg;

And here is the SQL*Plus session, just to illustrate how it looks like:
SQL> select * From dept;

        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

SQL> @faq

1 row created.

<C> to 'commit', <R> to 'rollback'

What will you do? r

Rollback complete.

SQL> select * From dept;

        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

SQL> @faq

1 row created.

<C> to 'commit', <R> to 'rollback'

What will you do? c

Commit complete.

SQL> select * From dept;

        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
         0 Little         Foot

SQL>


As of the right place to put your question to ... well, it definitely isn't "Server Administration" forum. There are plenty of them you could put it in (from Newbies via SQL Tools to Homework or even Windows).

I'll move it to SQL Tools one (as it deals with "how to" in SQL*Plus).
icon14.gif  Re: popup [message #298860 is a reply to message #298843] Fri, 08 February 2008 01:06 Go to previous messageGo to next message
oracle_coorgi
Messages: 185
Registered: September 2006
Location: INDIA-karnataka
Senior Member
hi
thanxs a lot for valid info on the feed back
and
thanxs for the valid script
one more thing can i not get a popup message as of prompt
<C> to 'commit', <R> to 'rollback'
as in forms and report
any way thanxs once agin
Thumbs Up
Re: popup [message #298866 is a reply to message #298860] Fri, 08 February 2008 01:21 Go to previous message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Pop-up? I don't know. What's the difference?

However, if you find that out, do share it with the rest of us.
Previous Topic: how to call a procedure/cursor
Next Topic: SQL Developer and Multiple Oracle Homes
Goto Forum:
  


Current Time: Thu Dec 08 06:00:15 CST 2016

Total time taken to generate the page: 0.28534 seconds