Question

Asked on 2005-03-04 at 03:44:03ID: 25472453

PL/SQL input Y/N

by: Mark_1976500

Rating8.8Very Good

I have a piece of PL/SQL that I want to ask the user to confirm a commit, displaying an 'Is this ok?' message and then either committing or rolling back depending on whether they enter Y or N. This is the code so far. Can anyone help fill in the gaps?

Thanks.

-- Ask user if it is ok to proceed

dbms_output.put_line('Do you want to save these changes?');
      return;

proceed:= YorN;

if proceed = 'Y' then
      dbms_output.put_line('Saved');
      commit;
    else
      dbms_output.put_line('Cancelled');
      rollback;
    end if;

  1. PL/SQL code - DBMS_OUTPUT.PUT_LINE
    I'm trying to see the result from a spool file but I only got "PL/SQL procedure successfully completed." How do I get to see the resutl from a spool file? set serveroutput on spool c:\test.log DECLARE v_rec_text VARCHAR2(500); v_fallback_plan VARCHAR2(10); v_fallback_plan_rate numbe…
  2. Ask for User input in PLSQL Loop
    I would like to get user inputs in PLSQL loop. I use variable substitution to get the user input. For example Begin Loop Exit when '&continue' = 'n'; -----------some work----------- End Loop; End; / SQL will prompt me for value for the parameter "co…
  3. commit statement in sql script
    Guys I have an sql script that I autogenerates an output. I would like to also have it add a commit to either every line or in blocks of say 100 can this be done without me adding in manually commit every so often I have attempted to do this but sqlplus doesnt recognise this so it fails. Any Ideas
  4. COMMIT Problem
    Hi, I am using Oracle forms builder,I have a problem of controlling which form to commit,if more than one forms are opened. Suppose i have opened 2 forms eg X,Y and only changes made in form X should be saved. I have opened the form through open_form('X'); open_form('Y');
  5. Record count on Database Block
    Hi all, I have 2 canvas (1 canvas having database block items ,2nd having control block items & FIND button also in Control block), My requirement is when i select any one of the lov and click on the find button(in 2nd canvas , control block canvas) then it navigates to the database block canvas and displays records, at that time i want to …

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
input user
Participating Experts
3
Solution Grade
A

Replies

 by: schwertner

Posted on 2005-03-04 at 04:08:45ID: 28313050

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: paquicuba

Posted on 2005-03-04 at 04:10:57ID: 28313051

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: paquicuba

Posted on 2005-03-04 at 04:19:44ID: 28313052

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: sujit_kumar

Posted on 2005-03-04 at 04:25:15ID: 28313053

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by:

Posted on 2005-03-04 at 04:27:26ID: 28313054

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert