pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how to put an special code in a string
3+ messages / 3 participants
[nested] [flat]

* how to put an special code in a string
@ 2003-04-23 02:33  jack <datactrl@tpg.com.au>
  0 siblings, 1 reply; 3+ messages in thread

From: jack @ 2003-04-23 02:33 UTC (permalink / raw)
  To: pgsql-sql

Hi all,

With pg/Sql, how do I put an special code in a string? Such as

''abc'' || <tab>||''xxx''||<cr/lf>

How do I specify a tab or cr/lf code? Thank you

Jack




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: how to put an special code in a string
@ 2003-04-23 06:50  Tomasz Myrta <jasiek@klaster.net>
  parent: jack <datactrl@tpg.com.au>
  0 siblings, 1 reply; 3+ messages in thread

From: Tomasz Myrta @ 2003-04-23 06:50 UTC (permalink / raw)
  To: jack <datactrl@tpg.com.au>; +Cc: pgsql-sql

Uz.ytkownik jack napisa?:
> Hi all,
> 
> With pg/Sql, how do I put an special code in a string? Such as
> 
> ''abc'' || <tab>||''xxx''||<cr/lf>
> 
> How do I specify a tab or cr/lf code? Thank you
C style should work. Try
<tab> -> \t
<cr/lf> -> \r\n ?
Regards,
Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: how to put an special code in a string
@ 2003-04-23 13:56  Jeff Eckermann <jeff_eckermann@yahoo.com>
  parent: Tomasz Myrta <jasiek@klaster.net>
  0 siblings, 0 replies; 3+ messages in thread

From: Jeff Eckermann @ 2003-04-23 13:56 UTC (permalink / raw)
  To: jack <datactrl@tpg.com.au>; +Cc: pgsql-sql

--- Tomasz Myrta <jasiek@klaster.net> wrote:
> Uz.ytkownik jack napisa?:
> > Hi all,
> > 
> > With pg/Sql, how do I put an special code in a
> string? Such as
> > 
> > ''abc'' || <tab>||''xxx''||<cr/lf>
> > 
> > How do I specify a tab or cr/lf code? Thank you
> C style should work. Try
> <tab> -> \t
> <cr/lf> -> \r\n ?

A generalized solution is to use the chr() function,
which can represent any ascii character, given the
decimal value as an argument.
So, <tab> is chr(9); <cr/lf> is chr(13) || chr(10)

__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-04-23 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-23 02:33 how to put an special code in a string jack <datactrl@tpg.com.au>
2003-04-23 06:50 ` Tomasz Myrta <jasiek@klaster.net>
2003-04-23 13:56   ` Jeff Eckermann <jeff_eckermann@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox