Home » SQL & PL/SQL » SQL & PL/SQL » CHR(30)
CHR(30) [message #334476] Wed, 16 July 2008 15:08 Go to next message
shoaib123
Messages: 118
Registered: December 2007
Location: Chicago
Senior Member

The chr(30) should return the balnk space between numeric and alphabetic value. But it is not returning anything in this situation. Please small hint would be appreciated..

SQL> select 12345||chr(30)||'abcdef' from dual;
12345abcdef


[EDITED by LF: according to message #334480, topic title changed from "CHR(13)" to "CHR(30)"]

[Updated on: Thu, 17 July 2008 00:29] by Moderator

Report message to a moderator

Re: chr(13) [message #334477 is a reply to message #334476] Wed, 16 July 2008 15:22 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
chr(30) is a non-printable "row separator" [RS]; you want chr(32)

       For convenience, let us give more compact tables in hex and decimal.

          2 3 4 5 6 7       30 40 50 60 70 80 90 100 110 120
        -------------      ---------------------------------
       0:   0 @ P ‘ p     0:    (  2  <  F  P  Z  d   n   x
       1: ! 1 A Q a q     1:    )  3  =  G  Q  [  e   o   y
       2: " 2 B R b r     2:    *  4  >  H  R  \  f   p   z
       3: # 3 C S c s     3: !  +  5  ?  I  S  ]  g   q   {
       4: $ 4 D T d t     4: "  ,  6  @  J  T  ^  h   r   |
       5: % 5 E U e u     5: #  -  7  A  K  U  _  i   s   }
       6: & 6 F V f v     6: $  .  8  B  L  V  ‘  j   t   ~
       7: ’ 7 G W g w     7: %  /  9  C  M  W  a  k   u  DEL
       8: ( 8 H X h x     8: &  0  :  D  N  X  b  l   v
       9: ) 9 I Y i y     9: ’  1  ;  E  O  Y  c  m   w
       A: * : J Z j z
       B: + ; K [ k {
       C: , < L \ l |
       D: - = M ] m }
       E: . > N ^ n ~
       F: / ? O _ o DEL
Re: chr(13) [message #334478 is a reply to message #334476] Wed, 16 July 2008 15:27 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
shoaib123 wrote on Wed, 16 July 2008 22:08
The chr(30) should return the balnk space between numeric and alphabetic value. But it is not returning anything in this situation. Please small hint would be appreciated..

SQL> select 12345||chr(30)||'abcdef' from dual;
12345abcdef


Can you explain the logic behind choosing your subject-title to describe this question?
Re: chr(13) [message #334479 is a reply to message #334477] Wed, 16 July 2008 15:30 Go to previous messageGo to next message
shoaib123
Messages: 118
Registered: December 2007
Location: Chicago
Senior Member

Thanks and appreciated you help...
Re: chr(13) [message #334480 is a reply to message #334478] Wed, 16 July 2008 15:36 Go to previous messageGo to next message
shoaib123
Messages: 118
Registered: December 2007
Location: Chicago
Senior Member

I was trying to create a single blank space seprated flat file..and sorry i was trying to write the chr(30) in the subject line not chr(13)

[Updated on: Wed, 16 July 2008 15:37]

Report message to a moderator

Re: chr(13) [message #334521 is a reply to message #334480] Wed, 16 July 2008 23:23 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
was trying to create a single blank space seprated flat file

So why not just typing a blank space instead of using chr function?

Regards
Michel
Re: chr(13) [message #334524 is a reply to message #334476] Wed, 16 July 2008 23:39 Go to previous messageGo to next message
jyothsna1612
Messages: 68
Registered: June 2008
Member
Hi Shoaib,

I think the following ex: will help you
SQL> select 12345||chr(32)||'abcdef' from dual;

12345||CHR(3
------------
12345 abcdef


Thanks
Jyothsna
Re: chr(13) [message #334532 is a reply to message #334524] Thu, 17 July 2008 00:31 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Still the same question: why "chr(32)" and not just " "?

Regards
Michel
Re: chr(13) [message #334575 is a reply to message #334532] Thu, 17 July 2008 03:21 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

You could easy have found the correct "number code" that represent ' '
SQL> select ascii(' ') from dual;

 ASCII('')
----------
        32


Re: chr(13) [message #334581 is a reply to message #334575] Thu, 17 July 2008 03:57 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is true for you character set, is it true for ALL character sets?

Regards
Michel
Re: chr(13) [message #334591 is a reply to message #334581] Thu, 17 July 2008 04:46 Go to previous message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

It's was just a hint...

The rest is "trial and error" Smile
Previous Topic: Is it a good idea to use REF_CURSOR to select subset of data?
Next Topic: scheduler
Goto Forum:
  


Current Time: Wed Dec 07 02:48:25 CST 2016

Total time taken to generate the page: 0.15421 seconds