dbTalk Databases Forums  

Selecting against values outside the ASCII range!!!

comp.database.oracle comp.database.oracle


Discuss Selecting against values outside the ASCII range!!! in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrew Lowe
 
Posts: n/a

Default Selecting against values outside the ASCII range!!! - 04-06-2004 , 04:34 AM






Hi all,
I currently have to do some CAD software development, which is what I
normally do, for a system that is tied back into an Oracle DB, the Oracle
part being new to me.

My situation is that there is a column, call it "col3" in a table
that is defined as char(1) but somehow this column has the value 1, 3, 9,
11, 23, 35 and 43 in it. These are NOT the characters '1', '3', '9' etc but
the actual values is in the value for 'A' is 65 in the ASCII table. This is
causing me angst in that when I attempt to select against this column:

select * from table1 when col3 = 1

for the value 1, I get an error

ORA-01722: invalid number

If I in turn do

select * from table1 when col3 = '+'

where '+' is the ASCII character for value 43, one of the values I have, I
get data. Is there a way that I can somehow compare against the values that
are in the control area, less than 32, of the ASCII table, ie 1, 3, 9, 11,
23? I've looked at TO_CHR() and TO_NUMBER() but to my inexperienced eye,
they don't appear to do what I need.

Any thoughts greatly appreciated,

Andrew Lowe

p.s. I get this when I go through TOAD V7.6 back to Oracle 9i V9.2


Reply With Quote
  #2  
Old   
Yosua
 
Posts: n/a

Default Re: Selecting against values outside the ASCII range!!! - 04-15-2004 , 07:36 PM






declare the field as NUMBER(1) instead of VARCHAR() or better yet use single
or double quotes around the 1 in your select statement:: select * from
table1 when col3 = '1'
========================================

"Andrew Lowe" <agl (AT) wht (DOT) KILLSPAM.com.au> wrote

Quote:
Hi all,
I currently have to do some CAD software development, which is what I
normally do, for a system that is tied back into an Oracle DB, the Oracle
part being new to me.

My situation is that there is a column, call it "col3" in a table
that is defined as char(1) but somehow this column has the value 1, 3, 9,
11, 23, 35 and 43 in it. These are NOT the characters '1', '3', '9' etc
but
the actual values is in the value for 'A' is 65 in the ASCII table. This
is
causing me angst in that when I attempt to select against this column:

select * from table1 when col3 = 1

for the value 1, I get an error

ORA-01722: invalid number

If I in turn do

select * from table1 when col3 = '+'

where '+' is the ASCII character for value 43, one of the values I have, I
get data. Is there a way that I can somehow compare against the values
that
are in the control area, less than 32, of the ASCII table, ie 1, 3, 9,
11,
23? I've looked at TO_CHR() and TO_NUMBER() but to my inexperienced eye,
they don't appear to do what I need.

Any thoughts greatly appreciated,

Andrew Lowe

p.s. I get this when I go through TOAD V7.6 back to Oracle 9i V9.2




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.