Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle error messages

Status
Not open for further replies.

joeythelips

IS-IT--Management
Aug 1, 2001
305
IE
Hi,

I have written the following script to update records in an oracle table.
However, when i execute the sql, i get 2 error messages:
1. ORA-00920: INVALID RELATIONAL OPERATOR
2. ORA-01756: QUOTED STRING NOT PROPERLY TERMINATED.

THIS IS MY SQL.


Update TestEuro
set amt_st_ch = '3.95'
where amt_st_ch = '3.75' OR '4.00'
/
Update TestEuro
set amt_st_ch = '4.70'
where amt_st_ch = '5.78'
/
Update TestEuro
set amt_st_ch = '6.75'
where amt_st_ch = '6.45'
/
Update TestEuro
set amt_st_ch = '7.00'
where amt_st_ch = '6.90'
/
Update TestEuro
set amt_st_ch = '7.10'
where amt_st_ch = '7.30' OR '7.43'
/
Update TestEuro
set amt_st_ch = '7.75'
where amt_st_ch = '7.50' OR '7.55' OR '7.85' OR '7.90'
/
Update TestEuro
set amt_st_ch = '8.75'
where amt_st_ch = '8.50' OR '9.50' OR '9.70' OR '10.40' OR 11.40'
/
Update TestEuro
set amt_st_ch = '12.00'
where amt_st_ch = '11.75' OR '11.95'
/
Update TestEuro
set amt_st_ch = '12.75'
where amt_st_ch = '12.70' OR '13.95' OR '14.00' OR '14.65' OR '14.75'
/
Update TestEuro
set amt_st_ch = '16.00'
where amt_st_ch = '15.75' OR '15.90' OR '15.95' OR '16.45' OR '16.95' OR '17.50' OR '18.95' OR
'20.00' OR '21.45' OR '22.40' OR '23.95' OR '24.00' OR '35.00' OR '36.00'
/
COMMIT;
 
You can not use OR for string operands. If I'm not mistaken you need IN() operator or boolean expressions:

amt_st_ch in( '7.30', '7.43')

amt_st_ch = '7.30' OR amt_st_ch = '7.43'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top