Home > Uncategorized > Search a string in a Long column

Search a string in a Long column

You can not search LONG columns in Oracle.

Here is what you can do to search for alll views which has word “Hello” in it. Little scripting

declare

cursor c_dbv is select owner,view_name,text from all_views ;

txt varchar(32000);

searchstring varchar(100) := ‘Hello’;

begin

for ct in c_dbv loop

if instr(lower(ct.text),lower(searchstring)) > 0 then

dbms_output.put_line(ct.owner||’.’||ct.view_name);

end if;

end loop;

end;

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: