| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Accept Command
I have the following command where it allows the user to specify an
particular salesman id (repid [4 DIGIT NUMBER]) or by typing
"ALL"(CHAR) will display all records, but i also require the user to
be able to enter a date & if the date matches an order date to bring
up this record. The order date is on the table called "ord" and is
called "OrderDate" and the date on the order table is formated as
"DD-MMM-YY".
To put it directly, i want one accept command where the user can
either enter a repid, All or a date.
I have tried various ways, but with little joy & therefore turning to
the experts. Any advise or assistance would be greatful. Is this
possible or would i need to approach it from a diff. angle?
Set Linesize 150
Set Pagesize 75
PROMPT To view a report on sales orders based on a salesman, please
type his/her "Rep ID" number or type
PROMPT "ALL" to view all orders by all salemen. To view an order by
date, enter a valid date.
Accept UserRequest CHAR PROMPT 'Please enter "RepID, ALL or Date of
Order.: '
Set Verify Off
Select Distinct Cust.RepID, Cust.Name "Customer Name", Ord.OrdID
"Order ID", Ord.OrderDate "Order Date",
Item.ItemTot "Item Total", Item.Qty "Quantity", Ord.Total "Order
Total"
From Emp, Customer Cust, Item, Ord
Where ('&USERREQUEST'='ALL' OR instr('&USERREQUEST',
to_char(Emp.EmpNo))>0)
and Emp.Empno = Cust.RepID
and Cust.CustID = Ord.CustID
and Ord.OrdID = Item.OrdID
/
Received on Sat Dec 21 2002 - 05:35:18 CST
![]() |
![]() |