Query specific data from an ORACLE database. If you want to query the name and field name of a table with a specific value from an oracle database, you cannot manually view the number of tables in the database one by one, at this time, it is necessary to write plsql to make the database query by itself. Here I wrote a plsql statement to query the name and field of the data table whose value is "57d486c2: 1385142d983:" in the database. Www.2cto.com SQL code -- query the table name and field name declare str varchar2 (100): = '57d486c2: 1385142d983: 'In the user table of the oracle database :'; sqlstr varchar2 (4000); tablename varchar2 (50); columnname varchar2 (50); cursor selectSqlCur is select table_name, column_name from region where data_type = 'varchar2'; begin open selectSqlCur; fetch selectSqlCur into tablename, columnname; while selectSqlCur % found loop sqlstr: = 'declar E '| 'scount number (10);' | 'in in select count (*) into scount from '| tablename | 'where' | columnname |' = ''' | str | '''; '| 'if scount! = 0 then' | 'dbms _ output. put_line (''' | tablename | '. '| columnname | ''');' | 'end if; '| 'end;'; -- print the SQL statement -- dbms_output.put_line (sqlstr ); -- execute the SQL statement execute immediate sqlstr; fetch selectSqlCur into tablename, columnname; end loop; end;