Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Lisa, Thomas P [IT]" <thomas dot p dot lisa at ssmb dot com>
Subject: RE: getting output of sp_helptext
Date: Mar 23 2002 5:42PM


David Owen wrote a perl script called that will dump out database DDLs. I'd suggest
you work with those output files.


-----Original Message-----
From: HANSON,DENNIS (HP-Roseville,ex1) []
Sent: Saturday, March 23, 2002 12:01 PM
To: SybPerl Discussion List
Subject: RE: getting output of sp_helptext

Hi David,

I also noticed the same behavior.  I'm not sure why or what is being done to
the text strings.  However, I do have a Perl script that returns the stored
procedures (including triggers) in a format that is identical to the format
that was used to create them.  I have two procedures.  One that will return
all of the stored procedures, and one that will returned a specified stored

If you would like I can send these two procedures to you.  You may have to
tweak here and there to get an exact match to your CVS entries, but it will
be closer then what sp_helptext returns.


-----Original Message-----
From: David J Iannucci []
Sent: Friday, March 22, 2002 6:26 PM
To: SybPerl Discussion List
Subject: getting output of sp_helptext

    I'm struggling with a frustrating problem now.  I'd like
to get the source text of a whole slew of stored procs out of
our database so that I can compare (diff) them en masse with
what we've got in CVS.

I note that sp_helptext returns the text of the procedure in
chunks, with newlines artificially attached to each chunk.  I
wrote a Perl script to collect these chunks from the output
of sp_helptext, "chomp" them, and re-concatenate them together.

The result, you'd think, would be identical to what had been
put into the database originally.  Apparently not.  In the
process of storing the source text, Sybase must be truncating
trailing whitespace, or something, from chunks, because after
I concatenate, I get words smooshed together with no whitespace
in between, viz. "where id = 10" becomes "whereid = 10".

Is this a well-known problem?  Am I missing something obvious?
If not, is there any way to get back OUT of Sybase exactly the
same source text that was put IN?  I'm using DBlib, if it makes
any difference.

Thanks for your time,

Dave Iannucci
Myriad Genetics, Inc.
Salt Lake City, UT