Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


search for a string in all stored procedures and functions

Posted on 2011-03-10
Medium Priority
Last Modified: 2012-05-11

  I'm on DB2 UDB 8.2
  Is there a way to query the database against all the procedures/functions/triggers to see if a particular string has been used?
  Please advise.
Question by:pvsbandi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4

Author Comment

ID: 35096728
Thanks! I queried something like this.
select distinct routinename from SYSCAT.ROUTINES 
where upper(text) like '%SUBSIDY%'

Open in new window

But upper is not working on this column. If i don't use upper or lower, i'm loosing many procedures which use subsidy in different case sensitivities.

How can i run this? Please help.
LVL 37

Expert Comment

ID: 35096880
what is subsidy?
is it an object name?
if so, you can search for it in the tables that document object dependencies
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks


Author Comment

ID: 35096946
The whole purpose of this search is to get all the routines that use Subsidy, as it is changing into something else. So, this search should get us a list of all procedures/functions etc that use subsidy.

  Can't we use UPPER() or LOWER() on a CLOB?
LVL 37

Expert Comment

ID: 35096954
you can't
and i will ask again
is subsidy a name of another object (table / view) ?

Author Comment

ID: 35097001
subsidy is a part of different columns like adoption_subsidy;guardian_subsidy, pay_subsidy etc.
LVL 37

Accepted Solution

momi_sabag earned 1500 total points
ID: 35097017
so this is not good

you can try to use the db2look utility to generate create statements of all your objects, and then use a regular text search tool (like notepad) to find that value

or, you can write a procedure that loops through the clob column, cuts it into smaller varchar values and check against them but it would be far more complicated

Author Closing Comment

ID: 35097249
Thanks Momi!

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question