Subject | RE: [firebird-support] Re: How to add CRLF to VARCHAR column |
---|---|
Author | Jarrod Hollingworth |
Post date | 2006-02-02T00:35:08Z |
Hi Alan,
custom "SQL script"-like file which has additional functionality to check
and increment DB version numbers and a bunch of other stuff. It is run
manually but it isn't a system which can run arbitrary commands and we can't
introduce additional manual procedures. If I stick to vanilla SQL for this
solution then I don't see much benefit in adding the CRLF insert using SQL
as part of the upgrade script vs. doing it in the stored proc at runtime.
The solution that I have settled on is to create a stored proc:
CREATE PROCEDURE U_CRLF
RETURNS (
CRLF CHAR (2))
AS
BEGIN
CRLF = '
';
SUSPEND;
END
And use it where necessary in other stored procs. At least this way we will
only need to change one stored proc if the implementation changes (e.g.
retrieve CRLF chars stored in a special string definitions table).
Regards,
Jarrod Hollingworth
++ Q1: Where do you spend your time?
++ Q2: Are your projects profitable?
++ Q3: Are you billing your customers accurately?
++ A : Complete Time Tracking
++ Track your time EASILY and ACCURATELY
++ http://www.complete-time-tracking.com
> you don;t need a separate app - just include it all in the script..Our current upgrade system allows for the compression and encryption of a
> no?
custom "SQL script"-like file which has additional functionality to check
and increment DB version numbers and a bunch of other stuff. It is run
manually but it isn't a system which can run arbitrary commands and we can't
introduce additional manual procedures. If I stick to vanilla SQL for this
solution then I don't see much benefit in adding the CRLF insert using SQL
as part of the upgrade script vs. doing it in the stored proc at runtime.
The solution that I have settled on is to create a stored proc:
CREATE PROCEDURE U_CRLF
RETURNS (
CRLF CHAR (2))
AS
BEGIN
CRLF = '
';
SUSPEND;
END
And use it where necessary in other stored procs. At least this way we will
only need to change one stored proc if the implementation changes (e.g.
retrieve CRLF chars stored in a special string definitions table).
Regards,
Jarrod Hollingworth
++ Q1: Where do you spend your time?
++ Q2: Are your projects profitable?
++ Q3: Are you billing your customers accurately?
++ A : Complete Time Tracking
++ Track your time EASILY and ACCURATELY
++ http://www.complete-time-tracking.com