RE: simple select

RE: simple select

 

  

The problem is that Oracle is going to convert the value of the username
column to a number to do the comparison. In one database the username
column contains non-numeric values, in the other database all the values
are numeric. In any case you want to put the single quotes around the
data because the column is defined as either varchar2 or char. Otherwise
Oracle will be forced to use a full table scan to resolve the query
instead of a possible index that may exists on the username column.

Hope this helps, :-)

-----Original Message-----
From: michael lysenko
[mailto:oracledba-ezmlmshield-x96209283.[Email address protected]
Sent: Thursday, June 29, 2006 7:41 PM
To: LazyDBA Discussion
Subject: simple select

Hi DBA's

I have question which may be simple for you:

why i am getting error [1]: (Error): ORA-01722: invalid number when i am
executing: select * [table_name] where username = 4064319769
and to fix this problem i have to add sinle quotes for 4064319769 value.
and i am not getting this error when executing absolutely the same
select against another database which has the same tables structure?

Which setting is different between this databases?


M.



--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html


IMPORTANT NOTICE:
This message may contain confidential information. If you have received this e-mail in error, do not use, copy or distribute it. Do not open any attachments. Delete it immediately from your system and notify the sender promptly by e-mail that you have done so. Thank you.


Oracle LazyDBA home page