PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "HANSON,DENNIS (HP-Roseville,ex1)" <dennis_hanson at hp dot com>
Subject: RE: getting output of sp_helptext
Date: Mar 23 2002 5:00PM

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
procedure.  

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.

Dennis


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


Hi,
    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