Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: HELP! Coding problems!

Re: HELP! Coding problems!

From: Fergus <sinhask_at_swbell.net>
Date: Wed, 05 Dec 2001 05:44:57 GMT
Message-ID: <tviP7.2192$Kd4.1323573404@newssvr11.news.prodigy.com>


What is the problem?

here is a suggestion :-)

Open cursor...
  exit when not found.
  loop thru cursor
  fetch records into variables
close cursor

"Dude" <liberal.democrat_at_prodigy.net> wrote in message news:vmhP7.4449$hu.980479034_at_newssvr17.news.prodigy.com...
> I am having a tough time trying to solve these two programming problems:
>
> 1.) I need to write a PL/SQL program that prompts the user for the
percent
> discount that should be applied to the cost of all 'JAVA' courses. Update
> the COURSE table decreasing the course cost for the 'JAVA' courses by the
> percent discount. Us an explicit cursor to retrieve all of the updated
> courses and produce output containing the course id, title, credits, and
> cost. Use a cursor FOR loop to shortcut the process of displaying the
> course information. Display the course cost as currency. Don't hardcode
> literals within the executable section. Create variables and assign
initial
> values in the declarative section.
>
> 2.) Write a PL/SQL program to display enrollment for each course section
> that a specified student is in. Accept a student id from the user.
> Retrieve all the course sections that the student is enrolled in from the
> ENROLLMENT table and store them in a PL/SQL table. Using another loop,
> retrieve a count of all students who are enrolled in each of the sections
> that are loaded into the table. Produce output like:
>
> Please enter the student id: 123
>
> Course section 95 has an enrollment of 1.
> Course section 125 has an enrollment of 1.
>
> Explicitly OPEN, FETCH data from, and CLOSE each cursor. Do not use FOR
> loops to shortcut the process.
>
> I really, REALLY, appreciate any suggestions and help that can be offered.
>
>
Received on Tue Dec 04 2001 - 23:44:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US