Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sybase IQ - how to show stored procedure without wrapping text?

Using Sybase IQ v12.7. Executing sp_helptext ProcedureName shows the text of the stored procedure which is fine. However it wraps lines at 80 characters. The question is, how to show text text of a stored procedure without wrapping?

In Sybase Central Java Edition there is a feature see the text of a stored procedure (Tranact-SQL) without line wrapping. So the question could be restated in a different way: how does Sybase Central get the text of a stored procedure without wrapping the text at 80 characters?

Basically looking for a programmatic way to dump out stored procedures for diff-ing and version control.

Thanks to any responses!

like image 873
FuzzyWuzzy Avatar asked Oct 14 '10 08:10

FuzzyWuzzy


People also ask

How will you display the text of a stored procedure?

You can view the source text of a system procedure by executing sp_helptext when using the sybsystemprocs database. If the source text of a stored procedure was encrypted using sp_hidetext, SAP ASE displays a message advising you that the text is hidden.

What is wrapper stored procedure?

A wrapper business object for stored procedure allows you to group multiple stored procedures or execute the same stored procedure multiple times. The business objects corresponding to the stored procedures are added as multi-cardinality children of the wrapper stored procedure.

How do I edit stored procedures in Sybase?

Expand the Stored Procedures folder, right-click the stored procedure you want to edit, and choose Edit. Edit the stored procedure properties. Change the Name. Select the parameters to be used in the stored procedure.

How do I view a stored procedure in Interactive SQL?

In Tasks view, double-click the Procedures & Functions folder in the Contents tab, double-click the procedure you want to run, then choose Execute from Interactive SQL from the list of Procedure & Function Design Tasks.


1 Answers

sp_helptext does not do any wrapping - it breaks up the procedure definition text at the newline characters and returns each line as a row. If you want the whole thing returned as a single string, you can select the procedure definition directly from the system table:

select proc_defn from SYS.SYSPROCEDURE where proc_name='<procedurename>'
like image 97
Graeme Perrow Avatar answered Sep 23 '22 11:09

Graeme Perrow