12703. 00000 - "this character set conversion is not supported"

12703. 00000 - "this character set conversion is not supported"

我正在使用一个函数来转换货币,但我收到此错误 12703。00000 - "this character set conversion is not supported",我不知道为什么。

这是我正在使用的代码

CREATE OR REPLACE FUNCTION convert(r_comm IN commande.ref_commande%type,
                   devise IN VARCHAR2)
RETURN commande.montant_ttc%type IS
mt commande.montant_ttc%type;
montant NUMBER(20) :=0;
BEGIN
    IF devise = 'dollar' THEN
        SELECT montant_ttc INTO mt FROM commande WHERE ref_commande = r_comm;
        montant := mt*10;
    END IF;
    IF devise = 'euro' THEN
        SELECT montant_ttc INTO mt FROM commande WHERE ref_commande = r_comm;
        montant := mt*11;
    END IF;
RETURN montant;
END convert;
/

DECLARE
r_comm commande.ref_commande%type :=1;
devise VARCHAR2(6) := 'dollar';
mt NUMBER(20);
BEGIN
mt := convert(r_comm, devise);
dbms_output.put_line(mt);
END;
/

错误 TABLE

好像调用到了不同的convert函数(oracle提供了convert函数)

The Oracle CONVERT() function converts a string from one character set to another.

解法:

我建议更改 function 的名称,因为 convert 是 oracle 函数。

在调用时使用您的 schemaname.function。但不建议使用相同的对象名称,因此选项 1 更好。

干杯!!