Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Update

Author  Topic 

searching1
Starting Member

3 Posts

Posted - 2008-09-18 : 16:02:03
When I try to execute the below SQL, I get and error message:
ORA-00927: missing equal sign. I've searched several sites, but cannot find the solution to this issue. Please help!

UPDATE TALENAME
SET
SUBSTR(FIELD1,6,1) = FILED2 WHERE EMPNO = 5551212;

or

UPDATE TALENAME
SET
SUBSTR(FIELD1,6,1) = 2 WHERE FIELD2 = 1;

hey001us
Posting Yak Master

185 Posts

Posted - 2008-09-18 : 16:17:15
what you are trying to do?

hey
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-09-18 : 16:34:29
That's because the SQL is DE-FILED2

Post the actual code



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

searching1
Starting Member

3 Posts

Posted - 2008-09-18 : 17:15:33
hey001us: I'm trying to update the last digit of field1 to match field2.
It's the substr that giving me problems. If I update using the entire field it works find.

field1 = 5555551 field2 = 0
I want to update field1 to 5555550

X002548: please excuse the typo, that is the actual code.

Does anyone know why I get this error "ORA-00927: missing equal sign"?

Thanks for the effort.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-18 : 17:19:48
quote:
Originally posted by searching1

"ORA-00927: missing equal sign"



You are using Oracle, but this site is for Microsoft SQL Server. You should post your question on an Oracle forum so that you get better help.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

searching1
Starting Member

3 Posts

Posted - 2008-09-18 : 17:27:20
Thanks tkizer. Excuse the post.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-19 : 04:04:58
quote:
Originally posted by searching1

When I try to execute the below SQL, I get and error message:
ORA-00927: missing equal sign. I've searched several sites, but cannot find the solution to this issue. Please help!

UPDATE TALENAME
SET
SUBSTR(FIELD1,6,1) = FILED2 WHERE EMPNO = 5551212;

or

UPDATE TALENAME
SET
SUBSTR(FIELD1,6,1) = 2 WHERE FIELD2 = 1;


That should be

UPDATE TALENAME
SET FIELD1= SUBSTR(FIELD1,1,LENGTH(FIELD1)-1)||FILED2
WHERE EMPNO = 5551212;


As said, post your Oracle related questions at Oracle forums like www.orafaq.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -