updating char

40 pts.
Tags:
ASCII
UPDATE statement
update operator set ascii(REVOKFLG)='0' where login like 'ospprov' error missing equal sign.
ASKED: January 5, 2010  11:59 AM
UPDATED: January 6, 2010  12:50 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

You are trying to update the result of a function here, and that is not allowed.

If you need to apply a function, then you should apply it to the new value you want to assign to the column, not to the column itself.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Denny Cherry
    What database platform are you using?
    65,490 pointsBadges:
    report
  • Gunzforlife
    Oracle 10g OPERATOR is the Object REVOKFLG is a field that's of CHAR type. either 0 or 1. I am trying to update the REVOKFLG which is displayed in ascii as '0' (flag uncheck). SQL> update operator set REVOKFLG=char(0) where login like 'ospprov'; update operator set REVOKFLG=char(0) where login like 'ospprov' * ERROR at line 1: ORA-00936: missing expression Please how can I update this?
    40 pointsBadges:
    report
  • carlosdl
    UPDATE operator 
    SET REVOKFLG='0' 
    WHERE login like ‘ospprov’;
    Am I missing something ?
    65,110 pointsBadges:
    report
  • Gunzforlife
    I had tried that earlier which actually made me ask questions about this. Unfortunately when I checked again by querying ( SELECT ascii(REVOKFLG) from OPERATOR where login like 'ospprov';) , REVOKFLG is (48) and not (0). For this I want to know if there is something I am missing?
    40 pointsBadges:
    report
  • carlosdl
    Yes, you get 48, because 48 is the code for the '0' character. Could you please explain why you need to use SELECT ASCII(REVOKFLG) instead of simply: SELECT REVOKFLG to get 0 as result ? There is no printable character for the ascii code 0. This code represents the null character, so I can't think of a way to get 0 when asking for the ascii code of REVOKFLG. You can use a number stored in a char column as a number (and not as a character) without any problems (and w/o the need of the ASCII function), or you could use a column of type NUMBER(1) if you feel more comfortable with it. I'm sure there is something that needs clarification here. Please provide as much deatils as possible about your requirement.
    65,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following