New Line character in a String

I want to create a string which contains a new line character. In
Powerbuilder, I would
use  '~n'  but what do I use within a stored procedure in ASE 12.0?  I'm
trying to create
a mulit-line error message that is passed back from the stored procedure to
the
Powerbuilder front-end.

select @message = 'Line1~n Line 2 ~n Line 3"  should display like this:
Line 1
Line 2
Line 3

Thanks!



0
RM
3/27/2001 8:27:41 PM
📁 sybase.sqlserver.general
📃 4269 articles.
⭐ 0 followers.

💬 3 Replies
👁️‍🗨️ 837 Views

select @message = "Line 1" + char(10) + "Line 2" + char(10) + "Line 3"
select @message

RM wrote:

> I want to create a string which contains a new line character. In
> Powerbuilder, I would
> use  '~n'  but what do I use within a stored procedure in ASE 12.0?  I'm
> trying to create
> a mulit-line error message that is passed back from the stored procedure to
> the
> Powerbuilder front-end.
>
> select @message = 'Line1~n Line 2 ~n Line 3"  should display like this:
> Line 1
> Line 2
> Line 3
>
> Thanks!

0
Bret
3/27/2001 8:50:26 PM
If you get this to work, let me know.  I never could get this to work.  The
new line character would cause a new row to be in the result set when it
gets back to the PB datawindow.

Bob Densmore


"RM" <[email protected]> wrote in message
news:[email protected]
> I want to create a string which contains a new line character. In
> Powerbuilder, I would
> use  '~n'  but what do I use within a stored procedure in ASE 12.0?  I'm
> trying to create
> a mulit-line error message that is passed back from the stored procedure
to
> the
> Powerbuilder front-end.
>
> select @message = 'Line1~n Line 2 ~n Line 3"  should display like this:
> Line 1
> Line 2
> Line 3
>
> Thanks!
>
>
>


0
Bob
3/27/2001 8:58:51 PM
You may need to use CHAR(13) + CHAR(10).  I believe this would be a requirement on the PC 
side but not Unix.
-- 
Jim Egan [TeamSybase]
Senior Consultant
Sybase Professional Services

Get your free subscription to PowerTimes at http://www.powertimes.com
0
Jim
3/28/2001 3:29:41 PM
Reply: