ORA-00904: invalid column name [message #97563] |
Thu, 01 August 2002 06:32 |
pash
Messages: 1 Registered: August 2002
|
Junior Member |
|
|
i am trying to update a name like s'mith in my emp_name
table
the command i am giving is
update emp_name set name='s'mith' where emp_no=250;
i can't updat the name because of the '.
it give s error ORA-00904: invalid column name.can anybody help me and tell how to put the ' in
between the names.
the properties of the name column is varchar2.
It will be kind of u,if u help me
regards
pash
|
|
|
|
|
|
|
Re: ORA-00904: invalid column name [message #98330 is a reply to message #97750] |
Fri, 23 July 2004 04:22 |
Rob
Messages: 70 Registered: January 2000
|
Member |
|
|
In my opinion most transparent way of dealing with this kind of problem is by using characters from the ascii set.
The simplest way to obtain their values is using this routine:
begin
for i in 1..200
loop
dbms_output.put_line( i||' .. '||chr(i) );
end loop;
end;
From the result you can derive that the charater you need is character# 39. Your update statement using this technique will look like this:
update emp_name set name='s'||chr(39)||'mith' where emp_no=250
|
|
|
|
Re: ORA-00904: invalid column name [message #98508 is a reply to message #97563] |
Wed, 08 December 2004 08:52 |
Srikanth K Kota
Messages: 1 Registered: December 2004 Location: Panama City
|
Junior Member |
|
|
This is a common logical problem to the programmers. The best way to rectify this problem I feel is converting the ' (single quote) into a some other special charecter like #* or *# and inserting that into the database, in which database will have no problem. when you retrive the data then convert back the system into the ' (single quote) and display. Similarly one will also get problem with " (double quotes).
For this to implement is make a common fuction and just before inserting the data run the funtion and similarly after retriving the data run the another common function which will convert back the special charecters into your readable form.
If you can tell which programming language you are using, I will try to help you with the ready-made functions in that langugue.
|
|
|
|
A solution to ORA-00904 [message #98603 is a reply to message #97563] |
Thu, 27 January 2005 00:54 |
Chris
Messages: 128 Registered: November 1998
|
Senior Member |
|
|
I am not an expert with oracle, I get by running on oracle, mysql, mckoi, even mssql depending no the clients.
But, I do wonder, I really do, would it have been so difficult to place the NAME of the invalid column IN the error message.
I really do wonder who wrote this, and why they didn't do this, maybe it is a security setting, but when you are migrating versions of databases, and trying to run on test machines, and you get this, YOU REALLY would like a pointer to where the update code frazzled, instead of (in my case) a stack which contains only jakarta servlet classes...
Really, is it so difficult. I hate ORA-00904.
|
|
|