Get your CodeRanch badge!*
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 Java 8 in Action this week in the Java 8 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: 29287
    
140

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: 29287
    
140

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I get the list of only user defined Stored Procedures?
 
Similar Threads
DatabaseMetaData and Finding Triggers
Database Metadata
is this possible
Stored Procedure Overloading Error
SQL Query Problem