Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
执行以下查询时,我面临标题错误。
select to_number('FROM1', 'xxxxxxx') from dual;
错误 ORA-01722: 无效号码
FROM1值可以是:
FROM1
F1F65 F20B5 F204D
请提出解决方案。我需要将这些值转换为数字。例如,F1F65 将使用以下查询转换为 991077。
select to_number('F1F65', 'xxxxxxx') from dual;
你应该使用
select to_number(FROM1, 'xxxxxxx') from dual;
否则 Oracle 将 FROM1 解释为字符串,而不是变量。
select to_number(hex_value,'xxxxxxx') from hex;
SQL 小提琴演示