wood burning stoves 2.0*
The moose likes JDBC and the fly likes How can I get the list of only user defined Stored Procedures? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How can I get the list of only user defined Stored Procedures?" Watch "How can I get the list of only user defined Stored Procedures?" New topic
Author

How can I get the list of only user defined Stored Procedures?

Amrit Tiwana
Greenhorn

Joined: Jun 03, 2004
Posts: 24
I'm using getProcedures(.....) of DatabaseMetadata. I want to get list of only user defined stored procedures, but getProcedures gives me list of both(user+system).

Thanks
Amrit
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Amrit,
What database are you using? Many databases, such as db2 and Oracle, keep user defined stored procs under the userid/schema. This is one of the arguments that can be based to getProcedures().


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Amrit Tiwana
Greenhorn

Joined: Jun 03, 2004
Posts: 24
Jeanne, I'm using SQL Server 2000. As in default, Northwind database I want to filter out the stored procedures with TYPE = 'System'.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30076
    
149

Amrit,
It looks like Sql Server has an owner for each stored procedure too. Try filtering on that. You will need to know the owner of your stored proc because you can't say all except system.
 
 
subject: How can I get the list of only user defined Stored Procedures?
 
Similar Threads
Stored Procedure Overloading Error
is this possible
Database Metadata
SQL Query Problem
DatabaseMetaData and Finding Triggers