Re: stored procedure

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 1 May 2006 14:53:24 -0800
Message-ID: <44568354$1_at_news.victoria.tc.ca>


indianhuny (kesha_mehta83_at_hotmail.com) wrote:
: Hi everyone,
: I'm new to this and I need some help with stored procedures. i'm
: using oracle 9i and would like to create a stored procedure

perhaps

create or replace package
create or replace package body

: to enter an
: order in the ORDER table

  • one way might be SQLPLUS> exec my_pkg.enter_order('example','data');

: and find out if this is the 10th order for the
: customer. The procedure receives all the information in the CUSTOMER,
: SERVICE and ORDER_ITEM tables. If the customer exists in the database,

Sounds like typical programming logic. PL/SQL has numerous constructs such as IF THEN ELSE that might help, and it integrates easily with SQL to provide access to commands like SELECT (which can make use of the ever useful EXISTS).

: if yes give a 50% discount on that order.

maybe somthing like

amount := amount * discount;

(etc etc etc) Received on Tue May 02 2006 - 00:53:24 CEST

Original text of this message