wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to read the procedure code using sp_helptext 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 to read the procedure code using sp_helptext" Watch "How to read the procedure code using sp_helptext" New topic
Author

How to read the procedure code using sp_helptext

Elizabath Lima
Ranch Hand

Joined: Nov 23, 2005
Posts: 32
Hi,

Would you please tell me how i can read the stored procedure code from my sybase database through a java program. I read about sp_helptext.
How can i use to get the procedure code?
I'm calling the procedure using call dbadmin.GetRecords(). How can i get the same procedures code using some java code?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

Tested in MSSQL, probably also works (with some tweaks perhaps) with SyBase.

This works for both views and stored procedures.
[ January 07, 2008: Message edited by: Rob Prime ]

SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Elizabath Lima
Ranch Hand

Joined: Nov 23, 2005
Posts: 32
Yes, It is working without any issues.
Thanks Rob
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to read the procedure code using sp_helptext
 
Similar Threads
getting the resultset of a stored procedure?
Regarding reultset in stored procedures
Store Procedure
How to Pass %ROWTYPE as Input parameter for a Procedure?
CLOBS