Home » SQL & PL/SQL » SQL & PL/SQL » Solution for ORA-06550: line 6, column 31: PLS-00103: Encountered the symbol ")" when expecting one (sql developer,4.1,windows7)
Solution for ORA-06550: line 6, column 31: PLS-00103: Encountered the symbol ")" when expecting one [message #664443] Tue, 18 July 2017 07:31 Go to next message
priya_t
Messages: 2
Registered: July 2017
Junior Member
Hi,

I am a beginner in plsql. I have created one cursor and I got following error in code please give solution.

code:
declare

display_cursor SYS_REFCURSOR;

display_request_id number(20);

display_concurrent_program_name varchar2(max);

display_responsibility_name varchar2(max);

display_user_name varchar2(max);

display_datetime varchar2(max);

display_completion_time varchar2(max);

display_start_time varchar2(max);

begin

Display_results(p_display => display_cursor );

LOOP

fetch display_cursor

into display_request_id ,display_concurrent_program_name ,display_responsibility_name ,display_user_name ,display_datetime ,display_completion_time ,display_start_time ;

exit when display_cursor%NOTFOUND;

DBMS_OUTPUT.PUT_LINE(display_request_id ||' | '||display_concurrent_program_name||' | '||display_responsibility_name||' | '||display_user_name||' | '||display_datetime||' | '||display_completion_time||' | '||display_start_time );

END LOOP;

CLOSE display_cursor ;

END;/

Error:
ORA-06550: line 4, column 44:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
Re: Solution for ORA-06550: line 6, column 31: PLS-00103: Encountered the symbol ")" when expecting one [message #664444 is a reply to message #664443] Tue, 18 July 2017 07:46 Go to previous messageGo to next message
Michel Cadot
Messages: 65255
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, remove all useless empty lines and comments.

With any SQL or PL/SQL question, please, Post a working Test case: create statements for all objects so that we will be able work to reproduce what you have.

When I execute your code here's what I get:
display_concurrent_program_name varchar2(max);
*
ERROR at line 7:
ORA-06550: line 7, column 1:
PLS-00114: identifier 'DISPLAY_CONCURRENT_PROGRAM_NAM' too long
ORA-06550: line 7, column 45:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
(
ORA-06550: line 9, column 41:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
(
ORA-06550: line 11, column 31:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
(
ORA-06550: line 13, column 30:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
(
ORA-06550: line 15, column 37:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
(
ORA-06550: line 17, column 32:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
(
ORA-06550: line 27, column 26:
PLS-00114: identifier 'DISPLAY_CONCURRENT_PROGRAM_NAM' too long
ORA-06550: line 31, column 50:
PLS-00114: identifier 'DISPLAY_CONCURRENT_PROGRAM_NAM' too long
ORA-06550: line 37, column 5:
PLS-00103: Encountered the symbol "/" when expecting one of the following:
( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited

In addition addition, there are 37 lines of code so how could you get an error at line 44?
Use SQL*Plus and copy and paste your session, the WHOLE session.

Also always post your Oracle version, with 4 decimals, as solution depends on it.

[Updated on: Tue, 18 July 2017 07:46]

Report message to a moderator

Re: Solution for ORA-06550: line 6, column 31: PLS-00103: Encountered the symbol ")" when expecting one [message #664445 is a reply to message #664443] Tue, 18 July 2017 07:53 Go to previous messageGo to next message
John Watson
Messages: 7186
Registered: January 2010
Location: Global Village
Senior Member
You would be better off beginning with something simple. Like this:
orclz>
orclz> declare display_cursor SYS_REFCURSOR;
  2  begin
  3  null;
  4  end;
  5  /

PL/SQL procedure successfully completed.

orclz>
So now you know that your first line is OK. Then add more to the block a little at a time.
Re: Solution for ORA-06550: line 6, column 31: PLS-00103: Encountered the symbol ")" when expecting one [message #664446 is a reply to message #664445] Tue, 18 July 2017 08:02 Go to previous messageGo to next message
cookiemonster
Messages: 12961
Registered: September 2008
Location: Rainy Manchester
Senior Member
Since when is:

varchar2(max)

legal syntax?
Re: Solution for ORA-06550: line 6, column 31: PLS-00103: Encountered the symbol ")" when expecting one [message #664447 is a reply to message #664443] Tue, 18 July 2017 08:15 Go to previous messageGo to next message
BlackSwan
Messages: 25751
Registered: January 2009
Location: SoCal
Senior Member
>I am a beginner in plsql
Beginner should write PL/SQL only 1 line at a time to reduce error count.

BTW, "MAX" is an Oracle reserved word & should NOT be used in variable declarations.
Re: Solution for ORA-06550: line 6, column 31: PLS-00103: Encountered the symbol ")" when expecting one [message #664448 is a reply to message #664447] Tue, 18 July 2017 08:45 Go to previous message
cookiemonster
Messages: 12961
Registered: September 2008
Location: Rainy Manchester
Senior Member
Nothing other than a numeric literal should be used when specifying the size of variables.
Previous Topic: Pivot columns and dynamically assign values based on column name
Next Topic: DBMS_JOB (NEXT_DATE / INTERVAL)
Goto Forum:
  


Current Time: Fri Dec 15 18:13:20 CST 2017

Total time taken to generate the page: 0.01837 seconds