I have a customer table that I'm dealing with in a sample database and
the problem wants me to build a PL\SQL program block that retrieves
each customer from the CUSTOMER table and creates a list that displays
each customer's name , address, and daytime phone number on a single
line.
This is what I have so far and I ran it, and came up with error, I
don't even know if I coded it right.
SQL> DECLARE
2 CURSOR customer_cursor IS
3 SELECT * FROM customer
4 customer_row customer_cursor%ROWTYPE;
5 BEGIN
6 OPEN customer_cursor;
7 LOOP
8 FETCH customer_cursor INTO customer_row;
9 EXIT WHEN customer_cursor%NOTFOUND;
10 DBMS_OUTPUT.PUT_LINE('Clearwater Traders Mailing List');
11 DBMS_OUTPUT.PUT_LINE(customer.c_first || customer.c_last ||
customer.dphone);
12 END LOOP;
13 CLOSE customer_cursor;
14 END;
15 /
customer_row customer_cursor%ROWTYPE;
*
ERROR at line 4:
ORA-06550: line 4, column 14:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 3, column 1:
PL/SQL: SQL Statement ignored
And the output is suppose to be displayed on a single line
Customer Name 1 Addresss Day Phone
Customer Name 2 Addresss Day Phone
so on through customer name 6
> Giving the crappy instructors that I have had, and the upfront honesty that
> this is a homework problem, I've got no problem with trying to give some
> help.
>
> So, Hal, I don't know exactly what you mean my "a list". Are you talking
> about the way you want to format the output?
>
> It would help do do a "DESCRIBE" on the tables you are working with and show
> us the result.
>
> Mike
>