niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle
How to reveal hidden codes
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Malcolm Dew-Jones
*nix forums Guru


Joined: 04 Mar 2005
Posts: 418

PostPosted: Sun Feb 06, 2005 7:57 pm    Post subject: Re: How to reveal hidden codes Reply with quote

cschang (cschang@maxinter.net) wrote:
: I am not a frequent user of oracle programmer. I remember seeing the
: solution about four years ago and I can not find from my memory and from
: the web. I will appreciate if anyone can help. What I have is one
: varchar2 column containing text records as 'No comment.'. I want to use
: the DECODE(val, 'No comment.', '', val) to display the empty or other
: kinds of text. But it won't work. Hence, I used the length function to
: check on the No comment. value in the column and did return as 11. I
: remember there was a function I can display the binary code of every
: character of the data in the field. I also manually checked such value
: with
: SQL>exec :str:='No comment.';
: execution successfully

: SQL>select DECODE(:str, 'No comment.', '', :str) comments from dual;
: -----------------------------------------------------------

: I am using 9 R2 on Windows 2K. Thanks.


To display "binary" data in a character string, google "oracle character
function". It returns references to things like the "dump" function, plus
many others.



--

This space not for rent.
Back to top
Mark D Powell
*nix forums Guru


Joined: 23 Apr 2005
Posts: 701

PostPosted: Sun Feb 06, 2005 4:07 am    Post subject: Re: How to reveal hidden codes Reply with quote

C, I am a little confused by you post. You say that decode is not
returning what you want but you did not show your code or the response.

You can code multiple tests in the decode or in a CASE statement
contained in your SELECT list or WHERE clause such as
decode(val,NULL,'No Value','No Comments','Comment Missing',val).

The INSTR function can be used to find a string within a character
column. It returns the position where the string starts so any value >
0 is a hit.

HTH -- Mark D Powell --
Back to top
cschang
*nix forums beginner


Joined: 05 Feb 2005
Posts: 20

PostPosted: Sat Feb 05, 2005 7:28 pm    Post subject: How to reveal hidden codes Reply with quote

I am not a frequent user of oracle programmer. I remember seeing the
solution about four years ago and I can not find from my memory and from
the web. I will appreciate if anyone can help. What I have is one
varchar2 column containing text records as 'No comment.'. I want to use
the DECODE(val, 'No comment.', '', val) to display the empty or other
kinds of text. But it won't work. Hence, I used the length function to
check on the No comment. value in the column and did return as 11. I
remember there was a function I can display the binary code of every
character of the data in the field. I also manually checked such value
with
SQL>exec :str:='No comment.';
execution successfully

SQL>select DECODE(:str, 'No comment.', '', :str) comments from dual;
-----------------------------------------------------------

I am using 9 R2 on Windows 2K. Thanks.


C Chang
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 3:30 am | All times are GMT
navigation Forum index » Databases » Oracle
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts status codes meanings.. Linda W Squid 2 Sun Jul 16, 2006 6:50 am
No new posts databases hidden in phppgadmin Darren PostgreSQL 2 Thu Jul 13, 2006 7:44 pm
No new posts postfix smtp authenticated relay fails if banner is hidden Ramprasad Postfix 7 Tue Jun 27, 2006 3:29 pm
No new posts how to restore a hidden partition formless void Debian 8 Fri Jun 23, 2006 10:30 am
No new posts apr_dbd error codes and SQLSTATE Evgeny Shirykalov Apache 1 Fri Jun 23, 2006 3:36 am

Mobile Phone | Credit Reports | Agencia de viagens | Personal Finance | Credit Cards
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3678s ][ Queries: 20 (0.3017s) ][ GZIP on - Debug on ]