Home » SQL & PL/SQL » SQL & PL/SQL » HELP PLZ
HELP PLZ [message #235662] Mon, 07 May 2007 11:15 Go to next message
sasha400
Messages: 17
Registered: May 2007
Junior Member
declare
     cursor customerCursor
     is select c_first||' '||c_last, c_address, c_city,c_state,c_zip ,c_dphone 
     from customer c;

      c_first    varchar2(30);
      c_last     varchar2(30);
      c_address  varchar2(30);
      c_city     varchar2(30);
      c_state    char2(2);
      c_zip      varchar2(10);
      c_dphone   varchar2(10);
     
    begin
       for c1 in (select count(c.c_id) count_c_id 
       from customer c  ) loop
        dbms_output.put_line('There are:'||c1.count_c_id);
      end loop;

      open customerCursor;
      fetch customerCursor into c_first, c_last,c_address, c_city,c_state,c_zip ,c_dphone ;
 
       dbms_output.put_line(chr(13) || chr(13));
       dbms_output.put_line('Clearwater Traders mailing List.');
       dbms_output.put_line('------------------------');

        while customerCursor%FOUND loop
        dbms_output.put_line(c_first||c_last||c_address||c_city ||c_state||c_zip ||c_dphone );
        fetch customerCursor into c_fist,c_last,c_address, c_city,c_state , c_zip,c_dphone );
      end loop;
      close customerCursor;
     end;
     /
    
ERROR



Re: HELP PLZ [message #235663 is a reply to message #235662] Mon, 07 May 2007 11:16 Go to previous messageGo to next message
Frank Naude
Messages: 4581
Registered: April 1998
Senior Member
I would help if you post the error as well.
Re: HELP PLZ [message #235665 is a reply to message #235662] Mon, 07 May 2007 11:20 Go to previous messageGo to next message
sasha400
Messages: 17
Registered: May 2007
Junior Member
ERROR
ORA-06550: line 29, column 92:
PLS-00103: Encountered the symbol ")" when expecting one of the following:

. ( , % ; limit
The symbol "(" was substituted for ")" to continue.1. declare
2. cursor customerCursor
3. is select c_first||' '||c_last, c_address, c_city,c_state,c_zip ,c_dphone
4. from customer c;
Re: HELP PLZ [message #235668 is a reply to message #235665] Mon, 07 May 2007 11:26 Go to previous messageGo to next message
Frank Naude
Messages: 4581
Registered: April 1998
Senior Member
Change:

fetch customerCursor into c_fist,c_last,c_address, c_city,c_state , c_zip,c_dphone );

to

fetch customerCursor into c_fist,c_last,c_address, c_city,c_state , c_zip,c_dphone;
Re: HELP PLZ [message #235673 is a reply to message #235662] Mon, 07 May 2007 11:39 Go to previous messageGo to next message
sasha400
Messages: 17
Registered: May 2007
Junior Member
now i got this error

ORA-06550: line 21, column 7:
PLS-00394: wrong number of values in the INTO list of a FETCH statement
ORA-06550: line 21, column 7:
PL/SQL: SQL Statement ignored
ORA-06550: line 29, column 9:
PLS-00394: wrong number of values in the INTO list of a FETCH statement
ORA-06550: line 29, column 9:
PL/SQL: SQL Statement ignored1. declare
2. cursor customerCursor
3. is select c_first||' '||c_last, c_address, c_city,c_state,c_zip ,c_dphone
4. from customer c;
Re: HELP PLZ [message #235676 is a reply to message #235673] Mon, 07 May 2007 11:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
You select 6 columns and give 7 variables.

Regards
Michel

[Updated on: Mon, 07 May 2007 11:55]

Report message to a moderator

Re: HELP PLZ [message #235679 is a reply to message #235676] Mon, 07 May 2007 11:54 Go to previous messageGo to next message
sasha400
Messages: 17
Registered: May 2007
Junior Member
where?
Re: HELP PLZ [message #235681 is a reply to message #235679] Mon, 07 May 2007 11:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
fetch customerCursor into c_first, c_last,c_address, c_city,c_state,c_zip ,c_dphone ;


Regards
Michel
Re: HELP PLZ [message #235686 is a reply to message #235681] Mon, 07 May 2007 12:04 Go to previous messageGo to next message
sasha400
Messages: 17
Registered: May 2007
Junior Member
I'am sorry i don't understand
where did I select 6 columns?
I am seeing 7c and 7v
Re: HELP PLZ [message #235688 is a reply to message #235686] Mon, 07 May 2007 12:13 Go to previous message
sasha400
Messages: 17
Registered: May 2007
Junior Member
I found it
Thank You.
Previous Topic: URGNT PLZ WHAT'S WRONG
Next Topic: spool ?
Goto Forum:
  


Current Time: Thu Dec 05 00:01:23 CST 2024