×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Getting the error ORA-06550: line 2, column 21: PLS-00103: Encountered the symbol "end-of-file" when

Getting the error ORA-06550: line 2, column 21: PLS-00103: Encountered the symbol "end-of-file" when

Getting the error ORA-06550: line 2, column 21: PLS-00103: Encountered the symbol "end-of-file" when

(OP)
Good day everyone!

I hope that you can help me on that one.
I am running Oracle 11G and I am not to familiar with the queries.
I am trying to run the following to search all tables and columns and I am getting an error.

here is the code:

DECLARE
match_count integer;
v_search_string varchar2(4000) := 'OPTX';
BEGIN
FOR t IN (SELECT owner,
table_name,
column_name
FROM all_tab_columns
WHERE data_type in ('CHAR', 'VARCHAR2', 'NCHAR', 'NVARCHAR2',
'CLOB', 'NCLOB') )
LOOP
BEGIN
EXECUTE IMMEDIATE
'SELECT COUNT(*) FROM '||t.owner || '.' || t.table_name||
' WHERE '||t.column_name||' = :1'
INTO match_count
USING v_search_string;
IF match_count > 0 THEN
dbms_output.put_line( t.owner || '.' || t.table_name ||' '||t.column_name||' '||match_count );
END IF;
EXCEPTION
WHEN others THEN
dbms_output.put_line( 'Error encountered trying to read ' ||
t.column_name || ' from ' ||
t.owner || '.' || t.table_name );
END;
END LOOP;
END;
/

Here is the error I get.

ORA-06550: line 2, column 21: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: := . ( @ % ; not null range default character

RE: Getting the error ORA-06550: line 2, column 21: PLS-00103: Encountered the symbol "end-of-file" when

perhaps you may need quotes around :1, as the SQL would read t.column_name = 'COLUMN_NAME'.

Also, you note that you are using Oracle 11, yet you posted in the Oracle 9i and earlier forum.

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


RE: Getting the error ORA-06550: line 2, column 21: PLS-00103: Encountered the symbol "end-of-file" when

(OP)
Thanks John for your reply.

I understand that the post if for Oracle 9 and older but I think that the post should continue to grow and should also include newer version of oracle.
I will give that a try and see if that resolve my issue.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close